Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Inheriting a Codebase Nobody Documented
SaaS & Product

Inheriting a Codebase Nobody Documented

Taking over an inherited codebase without a rewrite: a first-90-days plan to get it deploying, add monitoring, map it and test around what you change.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

Do not rewrite. Get it building and deploying reliably, add monitoring so you know what it does, write tests around the parts you must change, and document as you go. Rewrites of systems nobody understands are how six-month projects become eighteen-month ones.

The instinct to rewrite is usually wrong

Inheriting an undocumented codebase is unpleasant and the instinct is to start again. Resist it for at least a quarter. The existing system, whatever its faults, encodes years of business rules that nobody wrote down anywhere else.

A rewrite discards that knowledge and rediscovers it painfully, in production, one edge case at a time.

Week one: can you deploy it?

Before understanding anything, establish that you can build and deploy the system reliably from source. If you cannot, nothing else matters — you have a system you can look at but not change.

  1. Get the source into a repository you control, with full history if it exists
  2. Stand up a local or staging environment from scratch, documenting every step
  3. Deploy an inconsequential change end to end — a text label — to prove the pipeline
  4. Confirm backups exist and restore one somewhere safe

Weeks two to four: see what it does

Add monitoring and logging before changing behaviour. Error tracking, request logging, and basic metrics tell you which parts of the system are actually used, which is frequently surprising.

In most inherited systems, a meaningful share of the code serves features nobody uses any more. Knowing which is which changes what you bother to understand and what you can simply leave alone.

Weeks four to eight: build a map

Document as you explore, in whatever form you will actually maintain. A one-page architecture sketch, a list of external dependencies, the deployment process, and the five business rules that are least obvious from the code.

  • What talks to what, including anything scheduled
  • Which third-party services it depends on and who holds the credentials
  • Where the data lives and what the important tables mean
  • The bits that look wrong but are load-bearing — ask before touching

Change safely: tests around the edges

You will not retrofit comprehensive tests, and you do not need to. Write tests around the specific area you are about to change, so you can tell whether you broke it. Over time this builds coverage where change actually happens.

Every bug you fix should get a test first. That way the areas that break most become the areas best protected, which is exactly the right distribution of effort.

When a rewrite is genuinely justified

The platform is unsupported and cannot be updated. The system cannot be deployed at all. It is written in something nobody can hire for. Or the data model genuinely cannot express what the business now does.

Even then, prefer replacing piece by piece behind stable interfaces rather than a big-bang rewrite. It takes longer and it means you are never six months into something with nothing shippable.

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

How long before a new team is productive on an inherited system?

Small changes within two to four weeks, confident larger changes at two to three months. Systems with no tests and no documentation sit at the longer end.

Should we ask the original developer for help?

Yes, and pay for it if needed. A few hours of handover from the person who wrote it is worth weeks of archaeology, and most people are willing if approached reasonably.

What if the code is genuinely terrible?

Terrible but working is still a specification of what the business needs. Improve it where you touch it, and judge a rewrite on the criteria above rather than on how it reads.

How do we avoid this situation next time?

Documentation as a contractual deliverable, code in your repository from day one, deployment automated rather than manual, and more than one person who has touched each area.

Keep reading

More on SaaS & Product

Start here

Inherited software nobody understands?

We take these on regularly. A short review tells you what you have, what it would cost to maintain, and whether replacing it is genuinely justified.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →