Traditional software development often follows a “test-after” approach, where tests are written after production code to validate its behavior. This is referred to as [[Test-After Development (TAD)]].
While TAD ensures production code is tested, it doesn’t always guarantee that the tests themselves are thorough or aligned with requirements. Key questions include: Do the tests cover edge cases? Are they correctly asserting expected behavior? Do they fail when the code is incorrect?
Validating tests requires careful review, techniques like [[Mutation testing]] (introducing bugs to ensure tests catch them), or peer reviews. Peer reviews, akin to manual testing of tests, come with risks like [[Ego depletion]], memory distortion, and cognitive biases, which can affect accuracy.
In contrast, [[Test-Driven Development (TDD)]] or [[Test-First Development (TFD)]] flip the process. Tests are written first based on specifications, and production code is created to pass those tests. This method inherently prioritizes test validity, as the entire development process revolves around them.