mutation-testing
Technical notes on web development, DevOps, and AI integration.
2 articles
- 00:58testing
The test that could not fail
An exit-code assertion can be satisfied by another path entirely. The fix pins the assertion to widened output.
TL;DR: A CLI feature test that only checks the exit code passed even after the feature was deleted, proving the assertion was vacuous. The fix captures stdout and asserts the seed actually widened into a known task ID. Lesson: assert on observable effects, not status codes.
#testing#python#mutation-testing - 12:57testing
Fake implementations must fail: the selftest that tests itself
A green suite proves nothing if a fake can pass it. I fed three fake implementations into my 32-test selftest to prove the grader works.
TL;DR: After my 32-test suite went green, I worried it might be vacuous, so I built three fake validators (always pass, always fail, always emit every error code) that must each score zero passes. This is manual mutation testing, a known technique. I also pinned the selftest's sha256 so silent grader edits get caught.
#testing#bash#python