How to document an existing software system
Start with the questions people ask, let a tool read the repository for the inventory, then add by hand what only exists at run time. This guide does that on a real open-source system with eight modules, including the calls the scan missed and the parts it got wrong.
10 min readModelling practice4 of 6
The short answer
- Write for the questions people already ask. Three diagrams that answer them are worth more than a full model nobody opens.
- A repository scan gives you the inventory in minutes: modules, interfaces, tables, deployment nodes. It is a draft, and some of it is wrong.
- Calls between services are the part scans miss most, because they live in configuration and in names resolved at run time.
- Reasons are in nobody's code. Ask for them, date them, and write them down as decisions.
01Write down the questions, not the sections#
Most efforts to document an old system start from a template and stop at section two. A shorter way is to ask the next five people who touch the system what they needed to know and could not find. The answers are nearly always versions of these:
- What are the parts, and which of them can I deploy on their own?
- What calls what, and what happens when that call fails?
- Which part owns this table?
- Why is it built like this, and may I change it?
The first three can be answered from evidence. The fourth needs people. Keep them apart, and fix the boundary of the work before you start: how to scope a model covers where to stop.
The example here is Spring Petclinic Microservices, an open-source sample system (Apache-2.0), at commit 81152fa of 24 November 2026. It is small enough to check every claim and real enough to have surprises.
02Let a tool build the inventory#
The repository already lists most of the parts: build files name the modules, compose files name the nodes, SQL files name the tables. Reading them by hand is slow and no more accurate than a program. On 29 November 2026 we scanned the repository with the Discover tab in Archyno, which reads files and does not use AI. It read 147 files.

Two habits make a scan useful. Read the list of what it could not see before you read the result. And import everything but draw little: 136 elements is a catalogue, and the 43 that describe applications, their data and technology are still too many for one page.
03Add the calls the scan missed#
The scan found the services and none of the requests between them. The only lines it drew from one service to another are the start order in the compose file. That is not a detail: it is question two on the list. The tool says so itself: "Method bodies, runtime wiring and dependency-injected calls are not visible to it." Two searches found most of them.
Routes in configuration. Searching application.yml files for lb:// gives four lines, all in the API gateway: vets-service, visits-service, customers-service and genai-service.
Host names in code. Searching Java files for http:// followed by a service name gives three more. Two belong to the gateway. The third is in VectorStoreController: the GenAI service calls the vets service. Read the lines above it before you draw it. The method returns early when vectorstore.json is on the classpath, and the repository ships that file. In a default build the call is in the source and never runs.
One call has no URL anywhere. AIDataProvider asks the discovery client for instances of customers-service and takes the first. No search for a URL finds it. Reading the constructor of each class that sends requests does, so search for the client types too: RestClient, WebClient, DiscoveryClient.
That makes six calls between the gateway and the business services. The diagram at the top shows all six, with the one that normally does not run as a dashed line. The GenAI service turns out to be more connected than its name suggests: it also adds owners and pets through the customers service, so it is a writer, not only a chatbot.
04Draw the one request that matters#
Do not draw every use case. Pick the request that crosses the most services or causes the most incidents. Here it is the owner page: one request from the browser becomes two calls, and the second has a fallback.
The sequence diagram records something users can see and no structure diagram can hold: when the visits service is down, the page still loads and the visits are simply missing. A support engineer needs that sentence more than any box. The sequence diagram guide explains the notation.
05Find out who owns the data#
Services that share a table are one service in two deployments. So read the schema files and ask which service owns each table, then look for a key that crosses the line. In Petclinic there is exactly one, and it exists in only one of the two schemas:
FOREIGN KEY (pet_id) REFERENCES pets(id)
The default setup uses in-memory HSQLDB, where the visits schema has no such key. With the MySQL profile, the README starts one database named petclinic and the three services share it. So the visits service cannot get its own database until that key goes. For a sample this is a fair choice. In your system, a line like this is the most valuable thing the work will find.
06Read the findings with care#
Once there is a model, rules can run on it. Archyno's governance view gave this one 38 out of 100, with 117 findings.

A low score on day one says more about the model than about the system. 43 findings are "no owner", because code does not say which team owns it. Fill that in first: it is the largest group of the important findings, and people know the answer.
The six critical findings say that a part has no alternative path around it. Compare them with what you learned in step 4. The visits service is on that list, and the gateway has a fallback for it, which the model cannot know. Another entry is the parent project from step 3, which is not a running part at all. A finding is a question to answer, and "accepted, because" is a good answer if you write it down.
07Write the rest in this order#
arc42 is a free template with twelve sections. For an existing system, fill the ones that have evidence first.
| arc42 section | Evidence | What to write |
|---|---|---|
| 3 Context and Scope | Users, external systems | The edges of the container diagram. Here: clinic users and OpenAI. |
| 5 Building Block View | The scan, corrected | The container diagram at the top, and the catalogue behind it. |
| 6 Runtime View | One or two requests | The owner page with its fallback. |
| 7 Deployment View | Compose or Kubernetes files | Which part runs where, with ports and start order. |
| 9 Decisions | People, commit history | Why it is like this. Date every entry and name who said it. |
| 11 Risks and Debt | Steps 5 and 6 | The shared key, and each finding you accepted. |
Leave the other sections empty until somebody asks. An empty heading tells the reader that nobody has looked. A guess tells them something false.
Then make the second scan part of the routine. Scanning again in Archyno shows what is new, changed, unchanged and gone from the code, and leaves what people drew alone. Keeping a model current explains how to attach that to work that already happens. You can create a free account and scan a public repository, or see what else the model can answer.
In one line each
- 01Collect real questions first; they decide which diagrams exist.
- 02Scan for the inventory, then search configuration and code for the calls it missed.
- 03Correct the draft before you trust any ranking built on it.
- 04Draw one request with its failure path, and look for keys that cross a service boundary.
- 05Fill in owners and reasons by asking people, with a date and a name.
08Common questions#
Where do I start when I inherit an undocumented system?
Collect the questions first: what runs, what calls what, where the data is, what breaks if one part stops. Then build an inventory from the repository and the deployment files, because those cannot be out of date in the way a wiki page can. Draw one container diagram before anything else.
Can documentation be generated from code?
The structure can: modules, classes, tables, interfaces, deployment nodes. Run-time behaviour only partly, because routes, service names and injected dependencies are often settled in configuration. Intent not at all. A generator cannot tell you why a service was split or which coupling was accepted on purpose.
Which diagrams does an existing system need first?
One container diagram, one deployment view if the deployment is not obvious, and a sequence diagram for the one or two requests that cause the most incidents. Add a class diagram only for a part that is hard to understand from its code.
Do I need arc42 to document an existing system?
No, but its twelve sections are a good checklist, and it is free. For an existing system, fill sections 3, 5, 6 and 7 from evidence, then 9 and 11 by asking people. An empty section that says nobody knows is useful; an invented one does damage.
In this series
- 01UML vs C4 vs ArchiMate
- 02Scoping a model
- 03Naming conventions
- 04Document an existing system
- 05Validate UML automatically
- 06Keeping a model current
Related reading
Modelling practice
Modelling practice
Structure diagrams
Behaviour diagrams
Modelling practice
Modelling practice