Prerequisites & Discovery Inputs
Have the following assets, repositories, and architectural context accessible before executing this evaluation:
- Branch changes and pull request descriptions
- Code testing requirements and metrics
Problem Statement
Without a structured code review protocol, reviews often focus on stylistic issues (formatting, naming) rather than logical correctness, security, performance, and maintainability. This checklist provides developers and reviewers with a set of engineering criteria to ensure high codebase standards.
When to Use
Use this checklist as part of the pull request template, code review processes, or when teaching junior engineers about clean code principles.
Step-by-Step Guide
Step 1: Logical Correctness and Intent
- Verify the code meets the business requirements and functions as expected under edge cases.
- Look for off-by-one errors, infinite loops, and race conditions.
- Ensure proper error handling is implemented with informative log messages.
Step 2: Performance and Resource Use
- Check for performance bottlenecks (e.g., N+1 query patterns, excessive memory allocations).
- Validate database queries use appropriate indexing.
- Review resource utilization (e.g., closing file streams, network connections, database handles).
Step 3: Maintainability and Testability
- Check for clean module boundaries and proper separation of concerns.
- Ensure unit and integration tests cover the new code paths.
- Avoid introducing unnecessary third-party dependencies.
Checklist Items
- Code changes solve the original business problem without introducing regression defects.
- New functionality is covered by automated unit or integration tests.
- No database queries are executed inside loop bodies (N+1 query pattern is avoided).
- Exceptions and errors are caught, handled gracefully, and logged with appropriate context.
- No hardcoded configuration, secrets, API keys, or environment settings exist in the code.
- Naming of classes, variables, and methods is clear and conforms to the codebase conventions.
- Code complexity is kept low, splitting large methods into smaller, cohesive units.
- Third-party dependencies are only introduced if they are necessary and actively maintained.
Architectural Invariant · Production Hardening
Architecture specifications are only as sound as their verification in running production. In high-throughput systems, ensure every interface boundary maintains isolated timeout budgets, automated fallback circuits, and zero reliance on unmetered external dependencies.
Frequently Asked Questions
Practical insights on performance executionWhy avoid N+1 query patterns in reviews?
Executing database queries within loops causes high latency and database CPU exhaustion as user concurrency grows.
