Hidden Logic and Siloed Knowledge
The D-Flow FM calculation kernel is largely written in Fortran. Over the course of several decades, the software has been continuously developed and expanded. This has resulted in an extensive codebase that incorporates a great deal of technical and domain-specific knowledge.
At the same time, senior developers and domain experts who had worked on the original software retired or left the organization. This posed a risk that some of the historical context and knowledge regarding undocumented dependencies would be lost.
It was therefore important for Deltares to regain full control of the existing software architecture. Developers needed to be able to get quick answers to questions about:
- Exact call trees, dependencies, and the use of global variables and global state.
- The consistency in content between the Fortran code and the official technical reference documentation, including TechRef PDFs.
- Complex code paths that take a long time to analyze completely using traditional search methods.
Re:App Reverse Architecting
Together with SUE, Deltares launched an “ Reverse Architecting ” project to fully analyze and map the D-Flow FM kernel using Re:App, SUE’s AI-driven solution for Application Modernization. The goal was not to immediately replace the existing software, but first to gain insight into how the application is actually structured and how code, dependencies, and technical documentation are interconnected.
Bringing Code and Context Together
The entire Fortran codebase, consisting of approximately six million lines of code, was incorporated into Re:App , along with CMake build configurations, utility libraries, and technical documentation.
This allowed Re:App not only to analyze individual files, but also to identify connections across the entire application.
Knowledge Graph and Hybrid Search
In Re:App, SUE configured a hybrid search architecture in which elements from the source code—such as subroutines and variables—were directly linked to relevant documentation and hydrological formulas.
This Knowledge Graph makes it possible to answer questions not only based on textual similarities, but also based on the actual relationships within the software architecture.
Specialized AI agents
Specialized subagents were deployed for specific analyses. This allows, among other things, for the automatic generation of visual Mermaid call-tree diagrams.
By defining tasks and context for each agent, the analysis remains focused, and complex architectural questions regarding a large codebase can be examined in detail.
Validation by domain experts
The results were then tested and validated by developers and domain experts at Deltares. Using the chat interface at Re:App , they were able to ask specific questions about the architecture, code paths, and technical documentation, and verify the answers immediately.
From millions of lines of code to immediate insight
The D-Flow FM calculation kernel was reverse-engineered using Re:App. This allows Deltares to gain insight much more quickly into the structure, dependencies, and hidden logic within a large and mission-critical legacy codebase. The approach was evaluated against predefined success criteria and compared with standard AI coding assistants, such as GitHub Copilot.
Insight into the entire codebase
While traditional AI coding assistants primarily operate within a local context, Re:App can analyze relationships across the entire repository.
This allows developers to ask questions about top-level entry points, complex dependencies between modules, and the broader architecture of the application.
Code and documentation are directly linked
Re:App links source code to internal coding guidelines and technical reference documentation.
Questions about, for example, hydrological formulas can therefore be directly linked to the relevant implementation and associated source information.
Less room for hallucinations
Through its integration with the Knowledge Graph, Re:App bases its analyses on files, subroutines, and interrelationships that actually exist within the codebase.
This reduces the likelihood of incorrect or fabricated references and makes the results easier for developers to verify.
Architectural Connections Revealed
In addition to summarizing large and complex routines, " Re:App " also highlights interdependencies and potential inconsistencies between modules.
This not only provides insight into what individual pieces of code do, but, more importantly, into how the application functions as a whole.
From hours of searching for answers to just seconds
In the past, investigating complex code paths often took hours or even days and involved, among other things, manual searches using tools such as grep.
With Re:App , developers can ask the same architectural questions directly and, within seconds, gain targeted insights into the relevant code, dependencies, and documentation.
To learn how SUE is modernizing a legacy application step by step, visit the page Application Modernization.
"We are pleased with the results of the project. Re:App provides us with an easier way to gain a better understanding of the complex code behind our software."
Let’s talk
Let’s talk
* required