CS FundamentalsHardProduct-company placement

Instead of hand-picking examples, a developer states that for any list xs, sorted(sorted(xs)) == sorted(xs) and len(sorted(xs)) == len(xs), and a tool generates hundreds of random lists, shrinking any failure to a minimal case. What is this?

  1. A. Mutation testing
  2. B. Property-based testing
  3. C. Fuzz testing of network inputs only
  4. D. Pairwise testing

Correct answer: B. Property-based testing

Property-based testing (QuickCheck, Hypothesis) checks general invariants against generated inputs and shrinks counterexamples. Mutation testing changes the program, not the inputs.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic