Inspiration

As developers, we are in charge of writing code and ensuring that the code we write is high quality and efficient. However, that usually means that we need to write enormous test files to create unit-tests and integration tests and spend days analyzing the code. These tasks take up more than 20% of a developer's day in the industry. We decided to streamline the process by creating an all-in-one tool to automate the first step in the CI/CD pipeline, without needing to leave your IDE.

What it does

Testronaut is a terminal application that leverages the power of Google Gemini to enhance various aspects of the software development lifecycle. It provides the following functionalities:

  • Test Case Generation: Automatically generates test cases for given code, helping developers ensure code reliability and reduce the time spent on manual test writing.
  • Code Performance Analysis: Analyzes code performance, identifying potential bottlenecks and areas for optimization.
  • Code Refactoring: Suggests and applies code refactoring techniques to improve code readability, maintainability, and efficiency.
  • CI/CD Pipeline Check: This check ensures smooth and reliable deployment processes by checking the CI/CD pipeline configuration for potential issues.

How we built it

Testronaut is built using Python and leverages the Google Gemini API. Key technologies and libraries include:

  • Python: The core programming language for the application.
  • Google Gemini API: Used to access the LLM's capabilities for code analysis, generation, and refactoring.
  • Node.js: Making the terminal beautiful and more accessible.
  • PyPi: Allowing for easy installation and publishing

We used a modular design, separating the different functionalities (test generation, analysis, refactoring, CI/CD check) into distinct modules for better organization and maintainability.

Challenges we ran into

We encountered several challenges during the development process:

  • Terminal Interface: Designing a user-friendly and informative terminal interface.
  • Error Handling: Implementing robust error handling to gracefully handle unexpected API responses or code analysis failures.
  • Context Management: Providing the right context to the LLM to ensure accurate and relevant results. This included figuring out how to best represent code structure and dependencies.
  • CI/CD Integration: Developing a reliable way to check various CI/CD pipeline configurations across different systems.

Accomplishments that we're proud of

We are proud of the following accomplishments:

  • User-Friendly Interface: Creating a command-line interface that is relatively easy to use and provides clear feedback to the user.
  • Functional Prototype: Developing a working terminal application that demonstrates the core functionalities of test case generation, code analysis, refactoring, and CI/CD checks.
  • Modular Design: Implementing a modular architecture that allows for future expansion and the addition of new features.
  • Streamlining the CI/CD Workflow: Creating a tool that addresses multiple stages of the development workflow without needing to leave your IDE or wait on others.
  • Integration with Gemini API: Successfully integrating with the Google Gemini API to leverage its code intelligence capabilities.

What we learned

Through this project, we learned a lot about:

  • Node.js for the Terminal: Creating a beautiful-looking terminal takes a lot of work and learning specific JavaScript Functions, but is extremely rewarding.
  • LLM Prompt Engineering: Creating effective, consistent, and accurate prompts requires many clever techniques that we learned throughout our heavy integration with Google Gemini.
  • PyPi Publishing: Publishing our packages on an easily accessible package manager increases accessibility, but requires many configurations that we learned.

What's next for Testronaut

We plan to further develop Testronaut by:

  • Expanding Functionality: Adding support for more programming languages and CI/CD systems.
  • Improving Accuracy: Fine-tuning the prompts and context provided to the LLM to improve the accuracy and relevance of the generated test cases and refactoring suggestions.
  • Increasing Security: Adding configuration options to route the prompts to other LLMs, increasing security and usability for those in the industry.
  • Plugin System: Creating a plugin system to allow developers to extend the functionality of Testronaut with custom modules.
  • Integration with IDEs: Exploring integration with popular Integrated Development Environments (IDEs).
  • More Robust CI/CD Checks: Adding more sophisticated checks for CI/CD pipelines, including security and performance testing.
Share this project:

Updates