GitAuto Logo
  1. Home
  2. Pricing
  3. Docs
  4. Dashboard
  5. Blog
  6. Contact
  1. Home
  2. How It Works
  3. Use Cases
  4. Pricing
  5. Docs
  6. Dashboard
  7. FAQ
  8. Blog
  9. Contact

Coverage Enforcement

After running tests, GitAuto checks if code coverage reaches the target - 100% for new test files. It posts a coverage comment on the PR showing line, branch, and function coverage percentages. Uncovered lines are flagged and fed back to the agent so it can write additional tests to cover them.

Passing Tests Can Still Have Low Coverage

Without enforcement, tests that technically pass only cover the happy path. A function with five branches might get a test that exercises one of them, achieving 30% coverage while ignoring error handling, edge cases, and boundary conditions. The tests "pass" but provide minimal value.

Coverage enforcement creates a feedback loop: the agent writes tests, coverage is measured, uncovered lines are identified, and the agent iterates until the target is reached. This drives comprehensive test coverage rather than superficial test existence.

Why Models Only Test the Happy Path

Models have a strong bias toward generating the most obvious, straightforward test case. Testing error paths, edge cases, and boundary conditions requires adversarial thinking - imagining what could go wrong. Models default to "demonstrate the function works" rather than "prove the function handles failures." Without a feedback loop showing uncovered lines, the model considers its job done after one passing test. Training data and benchmarks reinforce this - most test examples in training data are happy-path tests, and code generation benchmarks only check "does the test pass," not "does the test cover edge cases."

How It Works

After the test runner finishes, GitAuto parses the coverage output to extract line, branch, and function coverage percentages for the source file being tested. For new test files (files that didn't exist before), the target is 100%. The coverage report identifies specific uncovered line ranges.

If coverage falls below the target, uncovered lines are sent back to the model with the source context, and another iteration begins. GitAuto also posts a coverage summary comment on the PR so reviewers can see the coverage achieved at a glance, even if 100% was reached and no manual review of coverage is needed.

Related Features

  • Test Execution - runs the tests that produce the coverage data
  • Untestable Detection - identifies code that cannot be covered, adjusting effective targets
  • Dead Code Removal - removes unreachable code that would otherwise reduce coverage percentages

Need Help?

Have questions or suggestions? We're here to help you get the most out of GitAuto.

Contact us with your questions or feedback!

Test Executionphpcs / phpstan Support

Getting Started

  • Installation
  • Setup

Triggers

  • Overview
  • Schedule Trigger
  • Test Failure Trigger
  • Review Comment Trigger
  • Dashboard Trigger

Coverage Dashboard

  • Overview
  • Python Testing
  • JavaScript Testing
  • Java Testing
  • Go Testing
  • PHP Testing
  • Ruby Testing
  • Flutter Testing
  • Multi-Language
  • Coverage Charts

Customization

  • Repository Rules
  • Output Language
  • GITAUTO.md

Integrations

  • CircleCI Integration
  • npm Integration

How It Works

Context Enrichment

  • Line Numbers
  • Full File Reads
  • Test File Preloading
  • Test Naming Detection
  • Error Baselines
  • CI Log Cleaning
  • Trigger-Specific Prompts
  • Coding Standards

Output Auto-Correction

  • Diff Hunk Repair
  • Diff Prefix Repair
  • Tool Name Correction
  • Tool Argument Correction
  • Import Sorting
  • Trailing Space Removal
  • Final Newline
  • Line Ending Preservation
  • Sanitize Tool Arguments
  • Lint Disable Headers

Quality Verification

  • Formatting
  • Linting
  • Type Checking
  • Test Execution
  • Coverage Enforcement
  • phpcs / phpstan Support
  • PHPUnit Support
  • pytest Support
  • Snapshot Auto-Update
  • Untestable Detection
  • Should-Skip Detection
  • Dead Code Removal
  • Quality Check Scoring
  • Quality Checklist

Safety Guardrails

  • File Edit Restrictions
  • Temperature Zero
  • PR/Branch Checks
  • Race Condition Prevention
  • Bot Loop Prevention
  • Webhook Deduplication
  • Duplicate Error Hashing
  • Infrastructure Failure Detection
  • Strict Tool Schemas
  • No-Change Detection

Token/Cost Management

  • Token Trimming
  • Outdated Diff Removal
  • Stale File Replacement
  • Skip CI Intermediate
  • CI Log Deduplication
  • Web Fetch Summarization
  • Context Forgetting
  • File Query Routing
  • On-Demand Diff

Resilience & Recovery

  • Model Fallback
  • Overload Retry
  • Forced Verification
  • Error Files Editable

Hallucination Prevention

  • Web Search
  • URL Fetching
  • Anti-Hallucination Prompts
  • GITAUTO.md Restrictions
  • Review Response Guardrails

Ready to improve your test coverage?

Go from 0% to 90% test coverage with GitAuto. Start for free, no credit card required.

Install FreeContact Sales

Product

  • Home
  • Why GitAuto
  • What GitAuto Does
  • How It Works
  • Use Cases
  • How to Get Started
  • Solution
  • Pricing
  • Pricing Details
  • ROI Calculator
  • ROI Methodology
  • FAQ
  • Blog
  • Contact

Dashboard

  • Dashboard
  • Coverage Trends
  • File Coverage
  • Credits
  • Open PRs
  • Usage
  • Triggers
  • Actions
  • References
  • Rules
  • CircleCI Integration
  • npm Integration

Documentation

  • Docs
  • Getting Started
  • Setup
  • Triggers
  • Coverage Setup
  • Customization
  • How It Works
  • Auto Merge
  • CircleCI
  • npm

Legal

  • Privacy Policy
  • Terms of Service

Connect

  • GitHub
  • LinkedIn
  • Twitter
  • YouTube
GitAuto Logo© 2026 GitAuto, Inc. All Rights Reserved