qodo-cover  by qodo-ai

CLI tool for AI-powered test generation and code coverage enhancement

created 1 year ago
5,124 stars

Top 9.9% on sourcepulse

GitHubView on GitHub
Project Summary

Qodo-Cover is an AI-powered tool designed to automatically generate unit tests and enhance code coverage for software projects. It targets developers and researchers seeking to streamline testing workflows and improve code quality. The tool offers a practical approach to increasing test coverage by leveraging Large Language Models (LLMs) to create new, qualified tests.

How It Works

Qodo-Cover employs a multi-component system: a Test Runner executes tests and generates coverage reports, a Coverage Parser validates coverage increases, a Prompt Builder crafts LLM inputs from codebase context, and an AI Caller interacts with the LLM for test generation. This approach aims to systematically improve test suites by iteratively generating tests that demonstrably increase code coverage, guided by LLM intelligence.

Quick Start & Requirements

  • Installation: pip install git+https://github.com/qodo-ai/qodo-cover.git or download standalone binaries.
  • Prerequisites: OPENAI_API_KEY environment variable, a Cobertura XML code coverage report (e.g., from pytest-cov with --cov-report=xml). Python and Poetry are required for development from source.
  • Usage: Run via CLI: cover-agent --source-file-path <path> --test-file-path <path> --project-root <path> --code-coverage-report-path <path> --test-command <command> --test-command-dir <dir> --coverage-type <type> --desired-coverage <int> --max-iterations <int>.
  • Examples: Detailed examples for Python, Go, and Java are available in the templated_tests/ directory.
  • Docs: https://github.com/qodo-ai/qodo-cover

Highlighted Details

  • Supports multiple programming languages (Python, Go, Java demonstrated).
  • Integrates with CI workflows (GitHub Actions preview available).
  • Compatible with various LLMs via LiteLLM, including OpenAI and Azure OpenAI endpoints.
  • Optional Weights and Biases integration for logging prompts and responses.

Maintenance & Community

Licensing & Compatibility

  • License: AGPL 3.0. This is a strong copyleft license, requiring derivative works to also be open-sourced under AGPL 3.0.

Limitations & Caveats

The tool currently focuses on unit tests and requires a Cobertura XML report. While supporting multiple languages and LLMs, advanced scenarios and broader test generation pains are still under development according to the roadmap.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
3
Star History
152 stars in the last 90 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Travis Fischer Travis Fischer(Founder of Agentic), and
3 more.

AlphaCodium by Codium-ai

0.2%
4k
Code generation research paper implementation
created 1 year ago
updated 8 months ago
Feedback? Help us improve.