CS FundamentalsHardProduct-company placement

Before refactoring a legacy pricing module with no tests, a developer records its current outputs for many inputs, including results she suspects are wrong, and asserts those outputs. What are these tests called?

  1. A. Acceptance tests, since they encode exactly what the customer wants
  2. B. Characterisation tests, pinning down how the code behaves today
  3. C. Mutation tests, since they measure the suite's power to detect changes
  4. D. Smoke tests, since they only check that the module runs at all

Correct answer: B. Characterisation tests, pinning down how the code behaves today

Characterisation (golden-master) tests describe what the code does, not what it should do, giving a safety net for behaviour-preserving refactoring. Suspected bugs are fixed later as deliberate, separate changes.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic