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.
  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, including OpenAI, Vertex AI, and Azure OpenAI.
  • Coverage Validation: Specifically parses coverage reports (like Cobertura or Jacoco) to ensure tests are effective.
  • 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.