Inspiration
Every developer had to write them at some point in their career: unit tests. Although they are extremely helpful to write clean and working code, nobody is excited by the prospect of writing them. That is where our tool comes into play. Generate unit tests fast and easy, without having to waste hours writing them yourself.
What it does
Utilizing LLM's to generate unit tests for python functions with just a few clicks. With our PyCharm plugin the developer can simply right click on a function, choose between different test categories and will automatically get a ready to run testfile. These categories include:
- General: Test the correct functionality of the function.
- Edge Cases: Test for common edge cases like null values, not passed parameters etc.
- Security: Test for vulnerabilities like SQL-injection or arbitrary code execution.
- Exception: Test if possibly occurring exceptions are handled correctly.
- Other: The developer can define his own preferences for unit tests.
How we built it
- Python: Utilizing the python programming language for any backend code, as well as communicating with the ChatGPT API
- Kotlin: The Kotlin language helped us realize beautiful UI elements in our favorite JetBrains IDE as well as tying the whole project together
- ChatGPT: Utilizing one of the most advanced LLMs we generate unit tests blazingly fast without having to worry about writing the same boiler plate over and over
Challenges we ran into
At the beginning of this project our Kotlin experience was very limited, so getting into it took us some time.
Effectively communicating with the ChatGPT client and getting not just usable, but also precise code out of it.
Due to our first experience with Kotlin, there was a bit of a struggle in integrating the Plugin into PyCharm, but by the end we really got the hang of it
Accomplishments that we're proud of
Not giving up.
Creating a functional prototype.
Creating a product that will truly help developers.
Seeing the automatically created tests beeing integrated into our tool and running them for the first time.
What we learned
How to make, develop and integrate tools in Kotlin.
How to work together as a team and effectively communicate.
How to distribute tasks and workload equally.
What's next for TestBrains
Addition of a feature to regenerate prompts.
HackaTUM next year.
Built With
- chatgpt
- intellij-idea
- kotlin
- python
Log in or sign up for Devpost to join the conversation.