Inspiration

DevTools are essential software utilities that streamline coding, debugging, and testing, improving developer efficiency and software quality. We chose DevTools as our hackathon track because robust testing is a critical yet time-consuming part of development, and automating test case generation enhances productivity while ensuring code reliability. To streamline the time-intensive process of code testing, we created GlitchGuard, a test case generator and executor that automates testing, in order to reduce development time. By eliminating the tedious task of creating test cases manually and capturing edge cases, GlitchGuard enhances software reliability and efficiency.

What it does

GlitchGuard is a CLI-based test case generator tool for C++ and Python, using frameworks like Catch2 and Pytest. By running a simple command (‘glitchguard filename.py’ or ‘glitchguard filename.cpp’), it would generate comprehensive test cases, including edge cases based on the source code’s logic. The tool saves test cases into structured files and automatically executes tests, displaying the results in the terminal. This reduces manual testing effort, allowing developers to focus on coding and improving software quality.

How we built it

The development team was divided into four roles:

  1. VSCode CLI (Command Line Integration), enabling GlitchGuard to run directly from the terminal.
  2. API Integration and File Input/Output, handling file operations and interactions with the Gemini API for test case generation.
  3. Python Test Case Generation and Execution, creating Pytest test cases which then get executed.
  4. C++ Test Case Generation and Execution, creating Catch2 test cases which then get executed. Each role contributed to ensuring effective test case generation for both Python and C++. This approach allowed for efficient task delegation and streamlined development.

Challenges we ran into

A major challenge was standardizing test case creation across multiple languages, as Pytest for Python and C++ test case generation differ significantly in implementation. We had to ensure consistent output formatting, and working functionality for both Python and C++ within GlitchGuard.

Accomplishments that we're proud of

We successfully automated test case generation and execution, saving developers hours of manual work. We ensured that we covered all test cases and accurate edge cases with real-world validation. Additionally, we integrated GlitchGuard into the CLI workflow, making it intuitive and easy to use.

What we learned

We gained valuable knowledge of Pytest and Catch2, which will help us in our future courses in C++ and Python as computer science majors. Additionally, we learned about File I/O and CLI-based tools, making the testing process more efficient.

What's next for GlitchGuard

Hopefully, in the future, we can extend compatibility to other commonly used languages, like Java, Rust, and more. Moreover, the C++ implementation has some latency issues and takes a while to generate the test cases, so we would optimize latency. Additionally, we have started looking into static code analysis techniques, and that’s something we could incorporate in the future to reduce runtime.

Built With

  • c++
  • catch2
  • clang
  • cli
  • gemini-api
  • pytest
  • python
  • vscode
Share this project:

Updates