Two developers talking beside a monitor of code
An audit tells the owners what they have.

A code audit is an independent review of a software codebase and the system around it, done by people who didn't write it. It ends in a written report that tells the owners what they have, what is risky, and what it would take to change it safely.

That is the short answer. The longer one depends on which kind of audit you mean, because the phrase covers several different jobs. Here, "code audit" always means a software code audit, not a financial or compliance audit.

Key takeaways
  • A code audit is an independent review of a codebase and the system around it, ending in a written report that ranks what was found by risk to the business.
  • There are four common types: code quality, security, whole-codebase, and pre-acquisition. They answer different questions and are not interchangeable.
  • A code audit is not a code review, a security audit or a penetration test. Each checks something different, at a different time, for a different reader.
  • You need one before a decision you can't easily undo: a rewrite, a migration, a purchase, a budget, or the day the one person who understands the system leaves.
01

What does "code audit" mean?

The meaning is in the two words. "Code" is the source code, plus everything needed to build, deploy and run it: configuration, database schemas, scheduled jobs and scripts. "Audit" means the review is independent and ends in a record someone else can check.

So a software code audit has three features that separate it from ordinary engineering work:

  • Someone outside the team does it. People who wrote the code have reasons, good ones, for not seeing its problems.
  • It covers the whole system at a point in time. Not one change, not one module.
  • It ends in a written report with evidence. Each finding points to a file, a setting, a log line or a person who confirmed it, so your own engineers can check it.

A code auditor is the person doing that work: someone who reads a codebase they didn't write, runs the analysis tools, traces how the system is built and released, talks to the people who maintain it, and writes up what they found.

02

What are the types of code audit?

Most audits fall into one of four types. The type decides the scope, the length and who reads the report.

TypeThe question it answersTypical readerWhat it leaves out
Code quality auditCan this code be changed safely and cheaply?Engineering lead, CTOBusiness risk outside the code
Security code auditWhere can this code be attacked or leak data?Security teamWhether anyone can maintain it
Codebase auditWhat is this whole system, and what would it take to fix, keep or replace it?The people who pay for the systemLive attack testing
Pre-acquisition auditDoes the code hold up to what the seller says about it?Buyer, investorLong-term roadmap detail

A code quality audit looks at maintainability: duplication, complexity, tests you can trust and how hard the code is to change. A security audit looks for vulnerabilities. A codebase audit covers both and adds architecture, data, dependencies, releases and who can change what. A pre-acquisition audit is a codebase audit with a deadline set by a deal.

When someone asks for "a code audit", ask which of these they mean. A security-only report can pass a system that nobody can safely change.

03

Code audit vs code review vs security audit vs penetration test

These four get mixed up constantly. They are different jobs.

Code reviewCode auditSecurity auditPenetration test
What is checkedOne changeThe whole codebase and systemSecurity controls and codeThe running system, from outside
WhenEvery day, before mergeBefore a decisionPeriodically, or for compliancePeriodically, or before launch
WhoA teammateAn outside reviewerSecurity specialistsTesters acting as attackers
MethodReading the diffReading code, running tools, tracing the systemReviewing controls, code and configTrying to break in
OutputComments, approvalA report ranked by business riskA list of security findingsA list of exploited weaknesses

A code review keeps new problems out. A code audit finds the ones already in. A penetration test proves whether one specific kind of problem, an exploitable security weakness, can be reached from outside. None replaces the others. For the day-to-day difference between review and audit, our code audit checklist goes further.

04

When do you need a code audit?

You need one when you are about to make a decision that is expensive to undo, and you don't fully know what you own. These are the usual moments.

You inherited code you didn't write

An agency handed it back, a contractor left, or you bought a company. You own the code, but nobody on your team has read all of it. An audit turns "we think it works" into a written list of what is there.

You are about to rewrite or migrate

A rewrite has to reproduce everything the old system does, and the only complete record of that is the code. Read it first. We wrote more on this in before you rewrite a legacy system.

A platform is reaching end of support

When a runtime, framework, database or operating system loses vendor support, you have to choose: upgrade, migrate or replace. The right route depends on what is built on top of it, which only the code can tell you.

The one person who understands it is leaving

Retirement, resignation or a reorganization. If a module has a single person who can change it safely, that is a risk with a date on it. An audit names those modules while the person is still there to answer questions.

You need a number for a budget

Leadership asks what it would cost to fix the system. Without a written picture of the system, any figure is a guess. An audit gives the estimate something to stand on.

Several systems are competing for attention

If you have a portfolio of old applications, don't audit all of them. Score them first with a legacy system assessment, then audit the one in the worst corner.

05

What happens during a software code audit?

The work moves from reading the code at rest to watching it run, then to writing it up and checking the findings with the people who know the system.

  1. Inventory. List every application, database, scheduled job and script, with its size and language.
  2. Static read. Read the code and run analysis tools: dependency and vulnerability scans, secret scans across the full version history, duplication and complexity checks.
  3. Data layer. Catalogue the database: where the business logic lives, which constraints exist, and which tables more than one application writes to.
  4. Dynamic read. Trace one or two real transactions end to end while the system runs, and look at how the database behaves under real load.
  5. Write and verify. Turn findings into a ranked report, then check each one with the people who maintain the system. Findings that don't survive that check come out.
  6. Walk-through. Present the report to the people who decide.

The tools in steps 2 to 4 are public. Your own team could run them. What an audit adds is the reading that turns their output into a short, ranked list someone can act on.

06

What do you get at the end?

A useful audit report has a one-page summary for people who don't read code, an architecture overview of how the system really fits together, a risk register with each finding ranked and backed by evidence, and an honest list of what the auditor could not determine. It should also say what it would take to fix the top findings, so the business can weigh the work against everything else on the list.

What it should not be is a sales document. If every finding leads to "hire us to fix it", the report is a proposal, not an audit.

07

What the 30-day assessment covers

Our 30-day assessment is a codebase audit of one system, fixed in scope, at a price agreed before we start. In week one we read the system at rest. In week two we read it while it runs. Week three is writing and checking findings with the people who know the system, and in week four we walk the pack through with the people who decide.

You get seven documents, from an executive summary and an architecture overview to a risk register, ranked and evidenced, ending with a fixed-price quote for whatever comes next. Your own team can act on the report, or we can do the work as a separate project with its own scope and price. Either way, the report stands on its own.

Pick a time to talk about the system you'd look at first.