Maintainability of AI-written code
For engineers
Keeping AI-written code easy to change: duplication, dead code, over-engineering, codebase consistency and safe cleanup
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
An agent adds a new function that formats prices. What is the best first review step?
Check yourself · 2 of 5
In a diff you find a helper function that nothing calls. What is the usual right call?
Check yourself · 3 of 5
An agent adds an interface, a factory and a config object to send one email. What is the best question to ask?
Check yourself · 4 of 5
An agent uses a different HTTP library than the rest of your project. Which fix lasts longest?
Check yourself · 5 of 5
A docstring says a function returns None when the id is missing, but the code raises an error. What is the first thing to decide?
Topics
- Duplicated logic from generated code4 min read · Agents re-implement helpers that already exist; finding the copies and pointing the agent at shared code
- Dead code and leftover scaffolding4 min read · Unused functions, unreachable branches, debug logs, TODO stubs and fallback paths that never run
- Over-engineering and needless abstraction4 min read · Factories, config layers, defensive checks and wrappers nobody asked for, and how to ask for the simplest version
- Consistency with codebase conventions5 min read · Naming, error handling, layering and library choices that drift from the codebase, and the memory files and lint rules that prevent it
- Misleading comments and stale docstrings4 min read · Comments that narrate the obvious, describe an earlier version of the code, or promise behaviour the code lacks
- Refactoring AI code safely5 min read · Characterization tests first, small behaviour-preserving steps, and letting an agent refactor under a test harness
Start here
- AI Copilot Code Quality: 2025 research (GitClear) (opens in a new tab)ArticleFree
An analysis of how code churn, copy-pasted lines and moved code changed as AI assistants spread.
- Refactoring (Martin Fowler) (opens in a new tab)BookFree
The catalogue of small behaviour-preserving steps and the reasoning behind doing them one at a time.
- Is High Quality Software Worth the Cost? (martinfowler.com) (opens in a new tab)ArticleFree
Why internal quality pays back through faster feature delivery, the case for caring about maintainability.
Helps to know first
110 questions · last verified 2026-12