qodo-ai/qodo-cover

Qodo-Cover: An AI-Powered Tool for Automated Test Generation and Code Coverage Enhancement! 💻🤖🧪🐞

What it solves

Qodo Cover 旨在通过自动生成合格的单元测试来提高代码覆盖率。它减少了编写测试所需的开发人员手动操作,并确保新测试能真正为软件项目的整体测试有效性做出贡献。

How it works

该工具使用生成式 AI (通过 LiteLLM) 根据代码库创建测试。它通过四个主要组件进行运作:

  1. Test Runner: Executes test scripts and generates coverage reports.
  2. Coverage Parser: Validates that the added tests actually increase code coverage. n2. Coverage Parser: Validates that the added tests actually increase code coverage.
  3. Prompt Builder: Collects codebase data to construct prompts for the Large Language Model (LLM).
  4. AI Caller: Interacts with the LLM to generate the actual test code.

它支持多种语言 (Python, Go, Java) 并可以作为 CLI 工具或集成到 GitHub CI 工作流中。

Who it’s for

它适用于想要在不手动编写每个测试案例的情况下,自动扩展其测试套件并提高代码可靠性的软件开发人员和 DevOps 工程师。

Highlights

  • Multi-language Support: Works with Python, Go, and Java.
  • LLM Flexibility: Supports over 100 LLMs through LiteLLM,ing, including OpenAI, Administrator, Vertex AI, and Azure OpenAI.
  • Coverage Validation: Specifically parses coverage reports (like Cobertura or Jacoco) to ensure tests are effective.
  • Record & Replay: Includes a mode to record LLM responses to save API credits during repeated runs.
  • CI Integration: Can be run locally or as part of a GitHub CI workflow.