01 · At a glance
What is the difference between a code review, a code audit and a penetration test?
A code review asks whether a change is correct, a code audit asks whether the codebase is sound, and a penetration test asks whether an attacker can get in. The table compares them side by side.
| Code review | Code audit | Penetration test | |
|---|---|---|---|
| Question | Is this change correct and safe to merge? | Is this codebase sound, and what do we fix first? | Can an attacker break into the running system? |
| Scope | One pull request or module | Whole codebase, tests, dependencies, build, licences | Deployed application, interfaces and infrastructure |
| Who does it | A teammate on the project | An independent engineer or firm | A security tester, often from outside |
| When | Every change, before merge | Before a rewrite, a deal, a handover or a launch | Before launch and on a regular schedule |
| Output | Comments on the change | A report with a fix-first list | Findings with proof of exploitation |
| Needs production? | No | No | Yes, a running target |
02 · Code review
What does a code review cover?
A code review covers one change: its logic, style, tests and side effects.
- 01
It is usually done by someone on the team, as part of the normal flow of work. It is fast and repeated, and it catches mistakes before they merge. Because it is part of daily work, the cost per change is small. It does not tell you the state of the code that was already there, such as old libraries, missing tests or licence terms nobody checked, and a team can review every change for years and still carry old problems nobody looked at.
03 · Code audit
What does a code audit cover?
A code audit covers the whole codebase and its setup: structure, tests, dependencies, security basics, data access, build and deploy, licences and AI readiness.
- 01
It is done once, or at a few set moments, by someone outside the team who has no stake in how it was written. The output is a report you can act on. It does not run the system, so it needs no test environment and no downtime. The code audit checklist lists 40 checks across those areas.
04 · Penetration test
What does a penetration test cover?
A penetration test covers a running system, and the testers act like attackers.
- 01
NIST's glossary, citing SP 800-115, describes it as evaluators imitating real attacks to find ways around the security of an application, system or network, often chaining several weaknesses together (checked 17 Nov 2026). It finds what can be exploited today. It does not read your code for maintainability, licences or test gaps, and it needs a live target, which a code audit does not.
05 · Choosing
Which one do you need?
Match the check to the decision you face. The three are not rivals, and the mistake to avoid is using one in place of another.
You are merging code daily
Code review, built into the team's habits.
You are about to rewrite, buy, hand over or launch
A code audit, since the decision depends on what the whole codebase contains.
You have a live system with sensitive data or a security questionnaire to answer: a penetration test, often after an audit has cleared the basics.
You have AI-written code going to users
Start with a review of that code; see how to review AI-generated code before it ships.
06 · Overlap
Where do the three overlap?
They overlap on security: a reviewer may spot an injection flaw, an auditor may find a leaked key, and a tester may exploit both.
- 01
They differ in evidence. A review gives an opinion on a change, an audit gives a reasoned finding from the code, and a penetration test gives proof that something works against the live system. Pick the evidence your decision needs, whether that is a buyer, an investor, a security questionnaire or your own engineers.
07 · Order
Should you do them in a set order?
Yes: the audit first, the penetration test second, because the audit is cheaper to run and needs no live system.
- 01
An audit removes the obvious holes and old components cheaply, so a tester spends time on harder problems. A penetration test is separate work, run by a specialist security testing firm.
- 02
Request a code audit quote and we will agree a fixed price after a scoping call.