I built this after noticing AI coding assistants (Copilot, Cursor, Claude) generating tons of duplicate tests. They'd create 5 different test functions that all execute the same code paths - just with different names.
THE APPROACH:
Instead of comparing test code (text similarity), TestIQ analyzes which lines each test executes. If two tests have identical coverage, one is redundant.
REAL EXAMPLE:
54 AI-generated calculator tests:
- 39 exact duplicates (identical coverage)
- 168 subset relationships (test A covered by test B)
- 45 similar pairs (significant overlap)
Only 15 unique tests actually needed = 72% reduction.
KEY FEATURES:
• Built-in pytest plugin (one flag: --testiq-output)
• Interactive HTML reports with side-by-side comparison
• CI/CD quality gates to block redundant tests
• Parallel processing for large test suites
• Python 3.9+, MIT license
QUICK START:
pip install testiq
pytest --testiq-output=coverage.json
testiq analyze coverage.json --format html
Or try the demo:
testiq demo
This runs the actual 54-test calculator example and opens an HTML report.
TECHNICAL DETAILS:
Uses coverage.py under the hood for per-test line coverage. Compares coverage sets using Jaccard similarity. Identifies three types: exact duplicates, subset relationships, and similar tests (configurable threshold).
Would love feedback on the approach! Have others dealt with test suite bloat from AI-generated code?
Hi HN! Creator of TestIQ here.
I built this after noticing AI coding assistants (Copilot, Cursor, Claude) generating tons of duplicate tests. They'd create 5 different test functions that all execute the same code paths - just with different names.
THE APPROACH:
Instead of comparing test code (text similarity), TestIQ analyzes which lines each test executes. If two tests have identical coverage, one is redundant.
REAL EXAMPLE:
54 AI-generated calculator tests: - 39 exact duplicates (identical coverage) - 168 subset relationships (test A covered by test B) - 45 similar pairs (significant overlap)
Only 15 unique tests actually needed = 72% reduction.
KEY FEATURES:
• Built-in pytest plugin (one flag: --testiq-output) • Interactive HTML reports with side-by-side comparison • CI/CD quality gates to block redundant tests • Parallel processing for large test suites • Python 3.9+, MIT license
QUICK START:
Or try the demo: This runs the actual 54-test calculator example and opens an HTML report.TECHNICAL DETAILS:
Uses coverage.py under the hood for per-test line coverage. Compares coverage sets using Jaccard similarity. Identifies three types: exact duplicates, subset relationships, and similar tests (configurable threshold).
Would love feedback on the approach! Have others dealt with test suite bloat from AI-generated code?
Links: - GitHub: https://github.com/pydevtools/TestIQ - PyPI: https://pypi.org/project/testiq/ - Docs: https://github.com/pydevtools/TestIQ/tree/main/docs