CS FundamentalsVery hardProduct-company placement

Assertion (A): A test suite that mocks every collaborator of every class can pass while the integrated system fails. Reason (R): Mocks encode the test author's assumptions about how collaborators behave, and those assumptions can be wrong or become outdated.

  1. A. Both A and R are true and R explains A
  2. B. Both A and R are true, but R does not explain A
  3. C. A is true but R is false
  4. D. A is false but R is true

Correct answer: A. Both A and R are true and R explains A

Over-mocked tests verify code against imagined collaborators. Integration and contract tests check the assumptions against real implementations.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic