Code coverage and mutation testing are two technical approaches for evaluating test suite quality, especially relevant as LLM-generated tests become more common. Code coverage, while historically dismissed as a target metric, may be reconsidered for automated test generation since opportunity cost concerns are reduced. Mutation testing provides deeper validation by changing code and verifying tests fail appropriately, though it's language-specific and computationally expensive. Additional heuristics include checking cyclomatic complexity (should be 1 for tests), test size and readability, execution time, determinism across runs, and favoring strongly-typed languages for test implementation.

7m read timeFrom blog.ploeh.dk
Post cover image
Table of contents
Code coverage #Mutation testing #Heuristics #Conclusion #

Sort: