Zum Hauptinhalt springen

Ask for Tests That Prove the Risk

Write a test request that names the behavior that must fail when broken.

code-review-skills5 min read

A reviewer wants tests for an auth guard but only writes “add tests.” Risk → failure mode → right test level → expected assertion. Vague test requests invite broad happy-path tests that pass while the risky branch remains broken. Please add tests for this. Required: add a guard test where permissions is null and the user is not an org admin; expected result is 403, not a thrown exception. This should fail if the null branch bypasses the guard again. Risk The auth guard can throw or bypass when permissions are null. The risk tells the author which behavior matters.…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Kontakt aufnehmen