Chapter 10

Testing, fuzzing, formal evidence, and validation scope

This chapter treats a test as an experiment: it runs a program on chosen inputs in a stated environment and uses an oracle, a rule that decides whether an output is correct, to report pass or fail. The first entries describe the levels of testing, from unit tests §10.1 through integration and system tests §10.3 to regression tests §10.4, and oracles that work without knowing the exact expected output, as in differential, property-based and metamorphic testing §10.8. The largest group covers fuzzing §10.9, the automatic generation of very many inputs in search of crashes and other failures: mutation-based, generation-based and coverage-guided fuzzing §10.12, the harness that connects a fuzzer to the code under test, seed corpora and their minimization, dictionaries, structure-aware mutation §10.17, and the coverage measures that guide the search. Sanitizers §10.21, which add run-time checks that turn silent memory, arithmetic and concurrency §9.1 errors into reported failures, and two widely used fuzzing tools complete this part.

The second half asks how to choose tests and what passing them establishes. It covers fault injection §10.28, negative and positive controls §10.30, boundary values, equivalence partitioning §10.32, exhaustive enumeration §10.33, model-based testing §10.34, and the stand-ins for real components called mocks, stubs and fakes. It then treats tests that involve real hardware or nondeterminism: hardware-in-the-loop testing §10.36, deterministic replay §10.37, nondeterministic tests §10.38, and delta debugging §10.39, which shrinks a failing input to a small one that still fails. The final entries separate coverage from correctness and show how test results become an argument: assurance cases §10.41, revalidation when a dependency, or a dependency of a dependency, changes, independent review §10.44, and mutation testing §10.45, which checks whether a test suite would notice a deliberately changed program.

In this chapter

  1. 10.1 Unit test
  2. 10.2 Integration test
  3. 10.3 System test
  4. 10.4 Regression test
  5. 10.5 Test oracle
  6. 10.6 Differential testing
  7. 10.7 Property-based testing
  8. 10.8 Metamorphic testing
  9. 10.9 Fuzzing
  10. 10.10 Mutation-based fuzzing
  11. 10.11 Generation-based fuzzing
  12. 10.12 Coverage-guided fuzzing
  13. 10.13 Fuzz harness
  14. 10.14 Seed corpus
  15. 10.15 Corpus minimization
  16. 10.16 Input dictionary
  17. 10.17 Structure-aware mutation
  18. 10.18 Coverage metric
  19. 10.19 Edge coverage
  20. 10.20 Branch coverage
  21. 10.21 Sanitizer
  22. 10.22 AddressSanitizer
  23. 10.23 UndefinedBehaviorSanitizer
  24. 10.24 MemorySanitizer
  25. 10.25 ThreadSanitizer
  26. 10.26 libFuzzer
  27. 10.27 AFL++
  28. 10.28 Fault injection
  29. 10.29 Negative control
  30. 10.30 Positive control
  31. 10.31 Boundary-value testing
  32. 10.32 Equivalence partitioning
  33. 10.33 Exhaustive enumeration
  34. 10.34 Model-based testing
  35. 10.35 Mock versus stub versus fake
  36. 10.36 Hardware-in-the-loop testing
  37. 10.37 Deterministic replay
  38. 10.38 Nondeterministic test
  39. 10.39 Delta debugging
  40. 10.40 Coverage versus correctness
  41. 10.41 Assurance case
  42. 10.42 Incremental validation
  43. 10.43 Transitive dependency
  44. 10.44 Independent review
  45. 10.45 Mutation testing