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?
- A. Acceptance tests, since they encode exactly what the customer wants
- B. Characterisation tests, pinning down how the code behaves today
- C. Mutation tests, since they measure the suite's power to detect changes
- 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A new filter must be added to a 400-line untested method. Instead of editing the method's logic, the developer writes the filter as a new…
- A quality-attribute scenario reads: 'During peak sale traffic, a shopper's search request is answered by the catalogue service within 2 s…
- A project planned to finish in month 10 actually finishes in month 13. Why does its schedule performance index (SPI = EV / PV) show 1.0 at…
- An activity not on the critical path has a total float of 3 days and a free float of 1 day. It is delayed by 5 days, and nothing else…
- Which loop invariant lets you prove this binary search correct for a sorted list a? python lo, hi = 0, len(a) - 1 while lo <= hi: mid =…
- A team has 40 open defects; 15 new ones arrive and 25 are fixed each week. If these rates hold, how long until the backlog is cleared?