pekral/test-redundancy
Larablocks Analysis
pekral/test-redundancy works with any PHP project: the latest release (0.2.6, Nov 8, 2026) doesn't depend on Laravel.
Recommendation checks
Use with careUse with care: meets 1 of 4 checks.
- Released in the last 12 months (Nov 8, 2026)
- First released under 90 days ago
- 2,425 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Too new to judge- Last stable release: Nov 8, 2026.
- 18 releases in the last 12 months.
- First released: Oct 22, 2026.
- Monthly downloads: 2,425.
- 4 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.
| Install | |
|---|---|
composer require pekral/test-redundancy |
|
| Latest Version: | 0.2.6 |
| PHP: | ^8.4 |
| License: | MIT |
| Last Updated: | Nov 19, 2026 |
| Links: | GitHub · Packagist |
test-redundancy finds the tests in a PHPUnit or Pest suite whose covered lines other tests already cover, and shows
what each of them asserts beyond those tests. It runs the tests once with per-test coverage and gives every candidate an
action: delete it, merge it into a dataset, review it, or keep it as the only test of an error path. The JSON output is
built for AI agents; --format=text is built for people.
Requirements
| Version | |
|---|---|
| PHP | ^8.4 with ext-libxml, ext-simplexml and ext-zlib |
phpunit/php-code-coverage |
^10.1, ^11, ^12, ^13 or ^14.5.1 — the one your PHPUnit or Pest installs |
| Coverage driver | pcov (the tool limits pcov.directory to the source directories) or xdebug |
| Test runner | vendor/bin/pest or vendor/bin/phpunit |
Installation
composer require --dev pekral/test-redundancy
The tool keeps its local state (the coverage map, the baseline, the file durations and the runner cache) in
.test-redundancy/. Add it to .gitignore:
echo ".test-redundancy/" >> .gitignore
Configuration
Optional. Without a test-redundancy.json in the project root, the tool reads src/ and app/, runs 2 parallel
processes, and picks vendor/bin/pest when it exists, otherwise vendor/bin/phpunit. The keys source, ignore,
env, processes, map and runner are described in Configuration.
Quick start
-
Analyse a test folder and read the report:
vendor/bin/test-redundancy tests/Unit/Billing --format=text[!WARNING] The tests always run in parallel, on the test tokens 1…
processes. Never start the tool next to another run of the same suite. -
Act on each candidate, from the top: the report puts the slowest candidates first. Follow its
steps, see How to read a candidate. -
Verify that every source line the analysed tests covered is still covered:
vendor/bin/test-redundancy verifyverifyexits with1and lists the lost lines when a change dropped coverage.
Without a path, analyse takes the test files the branch changes against origin/HEAD, or against --base.
vendor/bin/test-redundancy analyse --help lists every option.
What it does
- Finds candidates: test cases whose covered lines other test cases already cover, every dataset row separately.
- Compares contracts, not only lines:
differsBylists the literals, calls and keys a candidate has and its covering test lacks. - Says what to do: every candidate has an
actionand numberedsteps; a test of an error path that no covering test asserts is markedkeep. - Starts where it pays: files and candidates are ordered by the time each candidate took, so the slowest redundant tests come first.
- Proves nothing was lost:
verifyfails when a source line the last analysis covered is no longer covered. - Compares across files:
mapbuilds a per-test coverage map, andanalyse --acrosscompares with every mapped test.
Documentation
- Usage: commands, options, how the tool runs your tests, configuration,
verifyand--across. - Reading the report: the actions, the JSON fields, error paths, input combinations, failed tests and skipped files.
- Reference: the exact rules for
deleteandmerge-into-dataset, howdiffersBynames a difference, and how the analysis works. - Development: the Composer scripts and the CI matrix.
Testing
Contributing needs PHP 8.4+ with pcov.
composer install
composer test
composer check runs the full quality gate: Composer normalize, PHPCS, Pint, Rector, PHPStan, the security audit and
the tests with 100% coverage.
Changelog
See CHANGELOG.
Contributing
See CONTRIBUTING.
Security
See the security policy.
License
MIT. See LICENSE.
Alternatives to pekral/test-redundancy
Warm-worker test engine for Laravel + Pest — boots the app once per process and...
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| 0.2.6 | ^8.4 | MIT | |
| 0.2.5 | ^8.4 | MIT | |
| 0.2.4 | ^8.4 | MIT | |
| 0.2.3 | ^8.4 | MIT | |
| 0.2.2 | ^8.4 | MIT | |
| 0.2.1 | ^8.4 | MIT | |
| 0.2.0 | ^8.4 | MIT | |
| 0.1.10 | ^8.4 | MIT | |
| 0.1.9 | ^8.4 | MIT | |
| 0.1.8 | ^8.4 | MIT | |
| 0.1.7 | ^8.4 | MIT | |
| 0.1.6 | ^8.4 | MIT | |
| 0.1.5 | ^8.4 | MIT | |
| 0.1.4 | ^8.4 | MIT | |
| 0.1.3 | ^8.4 | MIT | |
| 0.1.2 | ^8.4 | MIT | |
| 0.1.1 | ^8.4 | MIT | |
| 0.1 | ^8.4 | MIT |