Make the suite trustworthy
Challenge on lesson: Checkpoint: Advanced Testing
Implement audit_suite(records) and plan_fix(record):
- audit_suite(records) returns {'sound': [names], 'flaky': [names]} โ flaky when any of the four boolean causes is set (uses_time, uses_random_unseeded, shared_state, order_dependent); both lists keep input order
- plan_fix(record) returns the ordered list of concrete fixes for a flaky record โ the exact four strings from the diagnose drill โ or [] for a sound one
- the plan's fixes map 1:1 in order: time โ inject a clock; randomness โ seed it; shared state โ isolate the world; order dependence โ construct prerequisites
The invariant: after applying every fix in the plan, re-running diagnose_flaky on the record yields 'sound'.
Back to lesson: Checkpoint: Advanced Testing