Regression selection links tests to behavior that might break. Broader tests are useful when integration risks justify their cost.
Before you start
You should understand inputs, expected outputs and the boundaries of the component under test. State the risk a test should detect before choosing a tool or mock. Distinguish controlled dependencies from real integrations so the result does not imply more coverage than the test actually provides.
The practical goal is to reason through this situation: A sorting fix needs tied values and missing data, plus the affected listing integration. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Identify changed invariants
Choose cases that detect the original defect and adjacent risk.
Step 2: Cover relevant consumers
A helper change may affect multiple listings or serialization paths.
Step 3: Broaden from evidence
Additional checks are justified by coupling, failures or unresolved concerns.
Worked scenario
A sorting fix needs tied values and missing data, plus the affected listing integration.
A sorting patch changes null handling and ties. Focused cases cover those rules, while the affected listing integration verifies visible ordering and pagination. Repeating unrelated expensive suites adds little specific evidence unless the patch touches shared infrastructure; selection should explain which risk each check addresses.
Common mistake
Repeating every check without a reason can slow feedback without increasing relevant evidence.
Verify the behavior
Confirm the original defect fails before the fix and adjacent valid behavior remains intact.
Interview exercise
Choose coverage for a patch.
Answer and reasoning
Identify changed invariants and adjacent consumers, run focused checks first and broaden when failures or coupling justify it.
Continue learning
Compare the scenario with the Software Testing interview questions and test your understanding with the Software Testing MCQs. For terminology and implementation details, consult the reference material.