Test naming convention consistent
Why it matters
When a test fails, the first signal is the test name in the CI output. A name like "test1" or "works" tells an engineer nothing about what broke or what regression to investigate — they must open the test file, read the code, and reconstruct the intent. ISO 25010:2011 §6.5.5 classifies this as a maintainability defect: diagnostic value is a measurable property of a test suite. Poor naming also correlates with poor test structure — if a developer cannot name a test precisely, they often haven't defined precisely what they're testing.
Severity rationale
Low because vague test names do not break functionality but make failing tests significantly harder to triage, slowing down diagnosis and increasing the time bugs spend in production.
Remediation
Adopt the "should [verb] when [condition]" or "returns [result] given [input]" pattern. Update existing tests incrementally — start with the highest-churn files where test names are most frequently read.
// Bad naming: opaque in CI output
describe('auth', () => {
it('test1', () => { ... })
it('works', () => { ... })
it('login check', () => { ... })
})
// Good naming: self-explanatory on failure
describe('authenticateUser', () => {
it('returns a session token when credentials are valid', async () => { ... })
it('throws InvalidCredentialsError when password is wrong', async () => { ... })
it('throws AccountLockedError after 5 failed attempts', async () => { ... })
})
Choose it() or test() consistently — mixing both in the same codebase is a minor but visible inconsistency.
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 Code Quality Essentials Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.testability — Maintainability — Testability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from code-quality-essentials·automated