Automated Software Maintenance

The work everyone defers, done by machine and returned for review. GreenCode refactors element by element, writes the missing tests and documentation, replaces deficient libraries and ports obsolete languages, then hands it all back as pull requests a team can approve or reject.

The work that never gets funded

Maintenance is risky, invisible and unsponsored. A change to a system with no tests, no current documentation and no living author can break something that matters, so the bare minimum is done and the rest is deferred indefinitely. The cost of doing it properly explains why: manual maintenance runs at $3 to $8 per line of code, with quality assessment, re-testing and project management on top. At that price a million-line application is never cleaned up. It is simply carried.

Automating the work changes what is affordable. GreenCode's second pipeline stage takes maintenance that a team would never be given time for and performs it as a repeatable, measured pass over the whole system.

What goes in and what comes out

An old system with gaps, generated artefacts filling them, the result returned as an approved pull requestView full size
Gaps found, artefacts generated, changes returned for review.

The stage is driven by the artefacts the mapping stage produced. Static analysis of the indexed code, assessed against recognised quality, security and green software criteria, yields a machine-readable action list in JSON alongside a human-readable report. That list is the work queue.

Generative models then work through it element by element rather than attempting the system in one pass, and produce four kinds of change.

  • Refactoring of the implicated code: dead and duplicated logic rationalised, inefficient constructs rewritten, structure simplified where complexity is doing no useful work.
  • The missing artefacts: unit tests in standard frameworks, in-code and external documentation, and commit messages that explain each change.
  • Dependency work driven by the bill of materials: deprecated, vulnerable or wasteful libraries replaced with better-supported and better-performing equivalents.
  • Modernisation and language porting, including heterogeneous cases such as moving a Visual Basic 6 application to C#, with forms, classes, modules and controls migrated and syntax conversion and API mapping automated.

Everything lands on an optimisation branch and comes back as documented pull requests, with the reasoning attached. The maintaining team reviews and approves rather than inherits. Nothing reaches the trunk that a human has not accepted.

Why iterating beats one shot

The project's review of the state of the art is candid about generated code. Single-pass generation is regularly outperformed by iterative, workflow-based approaches that combine translation, test generation, error correction and call-graph analysis, and copilot-style tools have produced siloed, developer-centric practices that create new forms of AI-induced technical debt at team level. The same review lists a general-purpose replacement for IDE copilots as a non-priority.

The distinction is one of scope. A copilot helps one developer type faster in one file. This stage treats the whole system on one pass, with a record of every change, which is the only level at which duplicated logic, an obsolete dependency or an inefficient pattern repeated three hundred times can actually be dealt with.

How it is assured

Iteration is bounded and checked, not open-ended. After each pass the quality assessment is re-run against the same criteria to confirm the uplift is real, and the generated tests are executed to confirm behaviour has not shifted. The project's requirements set a combined measure covering quality assessment issues, security flaws and error rate that must not rise during optimisation, so an energy gain bought with new defects does not count as a gain. Maintainability is tracked as a composite index, with cognitive complexity expected to hold steady or fall.

This is also a low-energy precursor to the benchmarking stage. Tidier code with fewer redundant operations frequently saves energy before anything has been profiled, and it leaves the later stages a cleaner system to optimise.

What a team gets

A codebase that arrives with the tests and documentation it should always have had, dependencies that are current, obsolete languages retired, and a reviewable trail of what changed and why. That is the mechanism behind legacy code modernisation, and the reason hours move from scaffolding to features, which is what increased productivity and accelerated software development describe. Automated maintenance of a whole codebase is one of the deliverables GreenCode will bring out of the project.

To trial it on a system of your own, get in touch through the contact page.

  • Pipeline stage 2 of 5
  • Input the codebase index, the bill of materials and a machine-readable action list
  • Output refactored code, generated tests, documentation and commit messages
  • Delivered through pull requests from an optimisation branch, for human review
  • Manual maintenance cost it displaces $3 to $8 per line of code
GreenCode

Want this benefit for your own systems? Talk to the GreenCode team about a trial.

Get in touch