Assertion density is reasonable per test
Why it matters
When the average assertion-to-test-block ratio falls below 1.0, the majority of test blocks have no assertions at all. This isn't a style issue — it means most of your test suite is exercising code paths without checking outcomes. Coverage tools will report lines as "covered" while the behavior of those lines remains completely unverified. ISO-25010:2011 testability requires that tests can detect deviations from specified behavior; a test block with no assertion can never detect anything.
Severity rationale
Medium because a low ratio signals systemic assertion absence rather than isolated gaps, but individual test blocks vary in severity depending on what they cover.
Remediation
Audit each it/test block and add at least one expect call that checks the actual output or state change produced by the code under test. Aim for a ratio above 1.0 project-wide:
// Before: exercises code, verifies nothing
it('finds user by id', async () => {
await service.find('user-1')
})
// After: asserts identity and shape
it('finds user by id', async () => {
const found = await service.find('user-1')
expect(found?.id).toBe('user-1')
expect(found?.email).toBeDefined()
})
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Test Reality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.testability — Testability (maintainability sub-characteristic)
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-slop-test-theater·automated