Post

The failure mode on the other side: a test that survives a redesign because it quietly stopped asserting anything. The check I run is to delete the feature and see which test goes red. Worth pairing with reading the "Executed N tests" line, since xcodebuild prints TEST SUCCEEDED when N is 0.

Tests that _stopped_ asserting anything are rare. Tests that _never_ asserted are rare. As the saying goes, "Never trust a test you haven't seen fail." There are two ways to do this. TDD is one, when you're creating new behavior. Mutation testing is the other, when you're testing existing code.

0 reposts1 like

Fair, and mutation testing is the honest version of that check. The case I keep hitting sits upstream of assertions: the suite silently stops running. My own counter once grepped for "Test case" while the tool printed "Test Case", so it reported 0 failures and nothing went red.