Remediation regression suite
Test requirements, not attack success
A regression suite checks that a correction preserves legitimate work while enforcing restrictions. Use fixed, ordinary fictional inputs and expected results written before implementation. R1 needs a same-team editor update that succeeds and a viewer update that fails, plus inactive, missing and cross-team cases. A suite containing only denials could pass a broken always-deny function.
Worked example: permitted update
An active editor of team A updates record A with A & B. Expect allow, a new record containing the original note, and the HTML text A & B. The old input record remains unchanged. The event is {operation: update, outcome: allow} conceptually; raw note text does not belong there. The exact JSON expectation is kept in the restricted answer file.
Check boundaries and side effects
Exercise lengths 0, 1, 80 and 81; verify a Unicode note and whitespace-only input. A viewer must not receive a new record after a denied update. Compare complete results, not just status. Check that the input record stays equal to its initial copy, that HTML text encoding is correct and that audit keys are exactly the allowed set. These are local function assertions, not tests of a running web app.
Record failure and retest
A failed check identifies a mismatch between expected and observed behavior, not automatically its cause. Record case ID, revision and difference, correct the specific control, then rerun the full suite. Do not weaken expected results to make the suite pass. Keep evidence for both allowed and denied behavior and note omitted integration tests.
Practice: compare your results
Use fixtures/cases.json and write expected results independently. Run your own local assertions; compare with the admin reference only after submitting your attempt. Explain why the starter should fail positive cases and why an overly broad role-only decision violates R1. No service or external test runner is required.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Remediation regression suite — knowledge check
Apply capstone remediation principles to fictional scenarios.
Why include a successful update case?
What should a denied update return?
What is expected for an 81-code-point note?
What should be compared besides status?
What follows a correction?