Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Inheriting Code You Did Not Write
Python & Django

Inheriting Code You Did Not Write

Taking over an existing Python project: five checks for the first day, understanding what it does, and getting it under control before changing code.

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

Can it be run, is it in version control, are the dependencies current, does it have tests, and is anything about to expire. Those five in the first day.

The first day

  1. Can it be run locally? If not, that is the first problem
  2. Is it in version control? With history, ideally
  3. Are dependencies current? Audit for known vulnerabilities
  4. Are there tests, and do they pass?
  5. What is about to expire? Credentials, certificates, unsupported versions
The fifth is the urgent one. An expiring credential or an unsupported Python version is a deadline you inherited without being told about it.

Then understand what it does

  • What triggers it — schedule, request, event
  • What it reads and what it writes
  • What external services it depends on
  • What happens when each of those fails
  • Who currently relies on its output

Get it under control before changing it

  1. Version control, if it is not already
  2. A local environment that works, documented
  3. Characterisation tests around the important behaviour
  4. Monitoring, so you know if it stops
  5. A backup of whatever it depends on

Changing code you do not understand, with no tests and no monitoring, is how inherited systems break in the first month.

Common findings

FindingFrequency
Credentials in the repositoryVery common
Dependencies years out of dateVery common
No testsCommon
No monitoringCommon
Runs on one person's machineMore common than you would hope

Write down what you find

A one-page summary: what it does, what it depends on, what is wrong, what is urgent. That document is worth having whether you keep, fix or replace the system.

It is also what lets a non-technical owner decide what to fund.

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

What if it only runs on one machine?

That is a continuity emergency. Getting it running elsewhere, documented, is the first task.

Should we rewrite it?

Not until you understand it. Most inherited systems need specific fixes rather than replacement.

How long does an assessment take?

One to three days for a typical service, depending on how much documentation exists.

What if there is no documentation?

Normal. Characterisation tests document behaviour as you go, which is more reliable anyway.

Keep reading

More on Python & Django

Python & Django

An API Other Systems Can Depend On

Designing a Python API service others can depend on: validation at the boundary, consistent errors and status codes, early versioning and documentation.

Python & Django

Moving and Transforming Data Reliably

Building data pipelines in Python that cope with malformed input: restartable stages, quarantining failures, reconciling counts and alerting on absence.

Start here

Inherited a system nobody understands?

Five checks in the first day tell you where you stand. Happy to run the assessment.

  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 →