I Wrote This Software. So Why Am I Asking AI How It Works?

Share
Hand-drawn illustration of legacy software source code examined through an AI magnifying glass, revealing links between a form, module, report, and database.
AI can help trace relationships in legacy software and rebuild development context before changes are made.

Working in IT consultancy often means keeping quite a few plates spinning.

One day I might be working on a website. The next could involve SEO, organising data, maintaining a database, producing reports, troubleshooting something unexpected, or returning to a software development project.

Eventually, it is the software development plate that demands attention.

An established application needs a change.

There is just one small problem.

I have not looked at the source code for months.

Or even years.

First, Remember How the Thing Works

There is quite a difference between knowing what a piece of software does and remembering exactly how you made it do it.

I may know the application inside out from a user's point of view. I may even have designed and written the thing.

That does not mean I can immediately remember which module handles a particular process, where a value is calculated, which database tables are involved, or why a slightly odd-looking piece of code seemed like a perfectly sensible idea several years ago.

So before changing anything, there is usually a period of getting reacquainted.

Open the project.

Browse the forms and modules.

Search for familiar routines.

Follow function calls.

Check the database.

Run the application.

Set a few breakpoints.

Gradually, it starts coming back.

"Ah, yes. That's how that works."

And occasionally:

"Why on earth did I do it that way?"

Usually followed five minutes later by:

"Ah. That's why."

What If You Could Ask the Software Questions?

This is where I have started to find AI-assisted development particularly interesting.

Most discussion around AI and software development focuses on generating new code.

Describe what you want and an AI coding tool can produce functions, queries, classes, tests, and sometimes surprisingly large chunks of an application.

That is useful.

But when returning to an established codebase, my first requirement is often not:

Write some code for me.

It is:

Help me understand this software.

Give an AI development environment access to an existing project and suddenly you can start asking questions about it.

What are the main parts of this application?

How is it structured?

What happens when the user does this?

Where does this value come from?

Where is it stored?

What else depends on it?

Instead of rediscovering the application entirely file by file, I can begin exploring it question by question.

Rebuilding the Developer's Mental Model

I am not particularly interested in getting AI to produce a lovely description of every source file.

What I really want is to rebuild enough context to start thinking like the developer of the application again.

And that developer was...?

Oh yes. It was me.

The useful part is tracing the relationships.

Follow a workflow.

Find the relevant modules.

Trace the data.

Find the business logic.

Look at what depends on what.

At that point, AI is not simply explaining individual lines of code. It is helping me piece the application back together in my head.

And when it is software you previously developed yourself, something else happens.

The analysis starts jogging your memory.

"Of course. I remember this now."

The knowledge was not necessarily lost.

It was just hiding somewhere behind everything else I have been doing since I last looked at the code.

Software Is More Than Source Code

Understanding source code is not necessarily the same thing as understanding the software.

An established application may also depend on databases, configuration, external files, reports, third-party components, documentation, the environment it runs in, and the way people actually use it.

Then there are the business rules.

Documentation explains intent and context.

Source code reveals implementation.

Running software reveals behaviour.

Put those together and you get a much better picture than you would from staring at source code alone.

AI can help join some of those dots, find relationships, and point towards the areas worth investigating next.

AI Can Help You Remember. It Cannot Remember for You.

There is, of course, a catch.

An AI-generated explanation of an application does not suddenly become the definitive technical specification just because it sounds convincing.

It may not have seen everything.

It may misunderstand a relationship, miss an external dependency, or confidently explain what some code appears to do without knowing why it needs to do it.

So the important parts still need to be checked against the actual application, source code, data, documentation, and behaviour.

For me, that is the right division of labour.

Let AI speed up the exploration.

Let it find things.

Let it trace relationships.

Let it point me in the right direction.

But I am still responsible for deciding whether what it is telling me actually makes sense.

Understanding Before Changing

Eventually, we get back to the reason I opened the project in the first place.

There is a feature to add.

But by now I am asking much better questions.

Where should it go?

Which existing processes will it interact with?

What data does it need?

What already depends on the part I am about to change?

Could this apparently small modification have consequences somewhere completely unexpected?

The architecture is becoming familiar again. I have found the relevant code. I understand more of the relationships around the proposed change.

Now I am interested in asking AI to help me write something new.

AI coding tools are often discussed in terms of how quickly they can generate code.

I am becoming just as interested in how effectively they can help us understand the code that is already there.

For consultants and developers who regularly jump between projects, that ability to rebuild context could be extremely useful.

The objective is not to hand understanding over to AI.

It is to use AI to shorten the journey back to understanding it ourselves.

Read the full article on the Kayem Computing website:
https://kayem-computing.com/software-development/understanding-legacy-software.html

Enjoyed this article? Subscribe to Kayem Computing and receive new articles directly in your inbox whenever they are published.