Test files present and organized
Why it matters
A codebase with no test files has no automated verification that the core logic works correctly after a change. Every refactor, dependency upgrade, or new feature becomes a manual regression risk. ISO 25010:2011 §6.5.5 identifies absence of test infrastructure as a reliability defect. For AI-built projects specifically, the lack of tests is a compounding risk: the original author may not remember the edge cases, and future changes can silently break behavior that was never encoded as an assertion.
Severity rationale
Medium because absent tests mean every change ships with no automated regression check, making regressions in business logic invisible until a user reports them.
Remediation
Set up a test framework appropriate for your stack. For Next.js/React with TypeScript, Vitest + Testing Library is the standard starting point.
npm install -D vitest @testing-library/react @testing-library/user-event jsdom
Add to package.json:
{
"scripts": {
"test": "vitest",
"test:coverage": "vitest run --coverage"
}
}
Create your first test co-located with the module it covers:
// src/lib/format-price.test.ts
import { describe, it, expect } from 'vitest'
import { formatPrice } from './format-price'
describe('formatPrice', () => {
it('formats a whole dollar amount', () => {
expect(formatPrice(1000)).toBe('$10.00')
})
it('returns "Free" for zero', () => {
expect(formatPrice(0)).toBe('Free')
})
})
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