52 / 87 · 02 AI-Augmented Test Design · Quality Gates for AI-Generated Test Suites← prev⊞ allnext →☰ Read as one page
8.5The Gate Escalation Pattern
When a gate fails, do not just report the failure. Provide actionable guidance:
class GateResult:
def __init__(self, name: str, passed: bool, details: str, fix_suggestion: str):
self.name = name
self.passed = passed
self.details = details
self.fix_suggestion = fix_suggestion
# Example usage
results = [
GateResult(
name="Assertion-free tests",
passed=False,
details="3 tests have no assertions: test_process_order, test_send_email, test_cleanup",
fix_suggestion="Add assert statements verifying the expected outcome. "
"At minimum, check return values or database state changes."
),
GateResult(
name="Flaky detection",
passed=False,
details="test_token_expiry failed 1 of 3 runs",
fix_suggestion="This test likely depends on real time. Use freezegun or "
"unittest.mock.patch('time.time') to make it deterministic."
),
]