CS FundamentalsHardProduct-company placement

A mutant changes `if (x > 10 && x < 20)` to `if (x >= 10 && x < 20)`. Which single test input kills (distinguishes) this mutant?

  1. A. x = 11
  2. B. x = 15
  3. C. x = 20
  4. D. x = 10

Correct answer: D. x = 10

The two versions differ only at x = 10: the original gives false, the mutant true. At 11 and 15 both are true and at 20 both are false, so those inputs leave the mutant alive - which is why boundary tests kill relational-operator mutants.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic