Creating a GPT Test Generator Bun App with AI Assistance.
📖 New Ebook Available
Build Your First MCP Server: A Developer's Guide to Wrapping Existing APIs for AI Agents to Use
Learn to create powerful AI integrations step by step
Today, I had an exciting experience working with OpenAI's ChatGPT to create a Bun app called GPT Test Generator. This application generates test cases for your code with the help of ChatGPT. In this post, I'll walk you through the process of creating this app and how I collaborated with the AI.
As a developer, I always struggle with writing tests. While it's an essential part of the development process, it can be time-consuming and tedious, taking away from the creative side of coding. That's where GPT Test Generator comes in. It automates the process of generating test cases, giving me more time to focus on building the core functionality of my applications.
Go check out the GitHub Repo for this project here. There is a README.md
that explains how to run this yourself with our own API key from OpenAI.
Throughout the development process, I worked closely with ChatGPT, asking it questions and receiving assistance in various aspects such as improving the UI, handling errors, and enhancing the user experience. The AI helped me to create a better application, demonstrating the potential of AI-assisted development.
In the GPT Test Generator app, the test_types are the different types of tests that can be generated for a given code input. These test types were prompted by passing example tests and test APIs into the prompt of the API call, making them more accurate and up-to-date.
Currently, the app uses the GPT-3.5-turbo model to generate the test cases, but I'm eagerly waiting for my turn on the GPT-4 API waitlist. The addition of these test types ensures that the app generates a wide range of test cases, improving the accuracy and effectiveness of the generated tests.
I had a great time pair-programming this with ChatGPT.
That's all for now!
Want to Chat About AI Engineering?
I hold monthly office hours to discuss your AI Product, MCP Servers, Web Dev, systematically improving your app with Evals, or whatever strikes your fancy. These times are odd because it's weekends and before/after my day job, but I offer this as a free community service. I may create anonymized content from our conversations as they often make interesting blog posts for others to learn from.
Book Office Hours