{"slug": "show-hn-find-overlapping-rust-tests-with-mutation-testing", "title": "Show HN: Find overlapping Rust tests with mutation testing", "summary": "A developer released cargo-test-prune, a Rust tool that uses cargo-mutants to generate mutants and then applies a greedy set-cover algorithm to suggest which tests can be removed. In a run on a previous revision of the repository, 11 tests faced 108 generated mutants: 73 were caught, 23 survived and 12 failed to compile; after removing the 5 tests the tool suggested, the remaining 6 tests caught the exact same 73 mutants. The author built the tool as a countermeasure to test suites that grow monotonically, particularly when coding with AI, and noted the repository itself was written using AI.", "body_md": "To tackle the ever-increasing number of tests, I built cargo-test-prune.\n\nThe idea behind it is to use cargo-mutants to generate mutants, and then solve the set cover problem for those mutants to suggest which tests can be eliminated. (use a greedy algorithm to cover the detected mutants with fewer tests)\n\nI came up with this as a countermeasure against the monotonically increasing tests that tend to accumulate, especially when coding with AI.\n\nIn fact, this very repository was also written using AI.\n\nI ran this tool on a previous revision of this repository. There were 11 tests and 108 generated mutants: 73 were caught by the tests, 23 survived, and 12 failed to compile. I removed the 5 tests suggested by the tool and re-ran the same 108 mutants. The remaining 6 tests caught the exact same 73 mutants.\n\nTests partly serve as documentation, so simply applying this isn't necessarily recommended, but since writing less code still holds value in the AI era, I think this tool could be quite useful.\n\nComments URL: [https://news.ycombinator.com/item?id=50230702](https://news.ycombinator.com/item?id=50230702)\n\nPoints: 1\n\n# Comments: 0", "url": "https://wpnews.pro/news/show-hn-find-overlapping-rust-tests-with-mutation-testing", "canonical_source": "https://github.com/yasuyuky/cargo-test-prune", "published_at": "2026-10-25 12:02:00+00:00", "updated_at": "2026-10-25 12:12:33.227102+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "artificial-intelligence"], "entities": ["cargo-test-prune", "cargo-mutants", "Rust"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-find-overlapping-rust-tests-with-mutation-testing", "markdown": "https://wpnews.pro/news/show-hn-find-overlapping-rust-tests-with-mutation-testing.md", "text": "https://wpnews.pro/news/show-hn-find-overlapping-rust-tests-with-mutation-testing.txt", "jsonld": "https://wpnews.pro/news/show-hn-find-overlapping-rust-tests-with-mutation-testing.jsonld"}}