Design and Implementation of CodeSourcerer: A Proxy-Based Test Generation System for GitHub CI/CD Pipelines
摘要
Modern software development demands efficient testing to ensure code quality and reliability. CodeSourcerer is an innovative tool that automates test suite generation within GitHub’s continuous integration pipeline by detecting code changes via a pre-authorized GitHub app and forwarding them to a microservices-based proxy server. This server constructs a comprehensive payload that is processed by a fine-tuned generative AI model (Gemini) to produce targeted test suites. Once the generated tests are received, a GitHub app creates a randomized sandbox branch incorporating both the developer’s changes and the generated tests, and a predefined workflow executes the test suite to verify accuracy. Based on the outcome, if test failures occur, a robust retry mechanism leveraging context caching (using Redis) is activated for up to three attempts, capturing essential metadata and error logs to resolve transient issues. This integrated approach streamlines testing processes, enhances continuous integration reliability, and supports agile software development practices.