LOGISTICS

AI in the migration of the railway mission-critical system

Apenas 90 diasto migrate the code
-70%code volume

Executive Summary

One of Brazil's largest railway operators depended on a mission-critical system to control train circulation in a busy region of its national logistics operation.

The complexity, maintenance difficulty, and integration challenges of this system indicated the need for modernization, but the operation could not stop.

To ensure the system's long-term sustainability and a gradual transition, Squadra was chosen as the digital partner to perform a Technological Migration (Lift-and-Shift), using AI — through the Genius platform — as an accelerator and cognitive amplifier for the team, allowing code modernization (as-is) and testing to be completed in just 90 days.

What would have been a manual migration taking years was completed in months using AI, with security, speed, and zero incidents after migration, resulting in a more modern, flexible architecture aligned with the operation's future demands.

The Challenge

The system controlled train circulation on one of the busiest railway sections in the country. The operation demanded continuous technological evolution, and the challenge was significant:

  • Strategic supplier management: the maintenance of the mission-critical system was concentrated with a single specialized supplier, which motivated the client to seek a partner with greater response and evolution capacity, compatible with the operation's scale.

  • Technical complexity of a robust legacy system: system developed in C++ over more than a decade, with over 300K lines of code. The absence of formal documentation represented the central challenge of the migration, requiring an innovative approach to understand and preserve all business logic.

  • High-precision validation: It was essential to ensure technological evolution without compromising current functional performance; the system's reliability did not allow for error margins.

The Solution

Genius in action: Software archaeology with AI

The solution was conducted as a "software archaeology" approach, using AI techniques to explore the legacy C++ code, extract business rules, and understand the system's internal logic.

Discovery with Genius: opening the black box

The client's system had been operating for decades without adequate documentation. To understand it from the inside out, Squadra created two specialized Turing Bots:

  • C++ Code Instrumenter: inserted logs into the legacy code to capture, at runtime, which parts of the system were actually used and how they behaved.

  • Log Visualizer: graphically analyzed the generated logs, making visible what the code actually did.

Design with AI: pattern-guided architecture

With the solver's operation mapped, the design phase needed to translate decades of implicit logic into a modern and sustainable architecture. AI assistants specialized in architectural patterns were fed with the knowledge extracted during Discovery and used to create diagrams and technical specifications, accelerating design, ensuring adherence to best practices, and reducing rework in subsequent phases.

Build with AI: from C++ to .NET at scale

With the system map in hand, two Turing Bots led the construction, and custom tools ensured validation:

  • Dependency Analyzer: mapped the relationships between legacy classes, enabling a safe, incremental migration plan.

  • Jack (Mass Migration): translated C++ code to C# (.NET) with semantic analysis and generative models, responsible for exponential acceleration in the final phase.

Customized testing: validating the impossible

Without a consolidated testing environment, the team developed its own tools to ensure migration reliability:

  • Spreadsheet Comparator: automatically cross-referenced data exported from the old and new databases, listing discrepancies with precision.

  • Genius Data Compare: persisted results in CSV before writing to the database, allowing controlled comparisons and preventing data contamination during testing.

  • Strategic delivery sequence: simpler modules first, the "heart" of the system last — maturing tools and aligning teams before the most critical stage.

Results

  • AI as an accelerator: Genius was strategically used in each project phase: discovery, design, and build, accelerating deliveries and ensuring quality. Its application was decisive in meeting the challenging 90-day deadline, compressing months of work into weeks.

  • Risk eliminated: the client ended its dependence on a single supplier for a mission-critical system, gaining Squadra as a partner with greater technical capacity to evolve the solution and support business needs in the long term.

  • Modernized operation at scale: with 100% of users already on the migrated version, the new system now supports a highly complex operation, covering over 90 terminals, +700 locomotives, and 1,643 km of railway network, based on a clean, documented, and independent foundation.

Metric

Result

Migration of the core component with Genius

From 9 months (traditional methods) to approximately 1 week

Reduction in code volume

70% less — from 1,300 to 400 functions

Delivered system

Cleaner, documented, and independent

Total delivery time

90 days

Code volume produced

300 thousand lines

Adoption of the new version

100% of users on the migrated version

Modules delivered

4 modules

Operational coverage

+90 terminals, +700 locomotives, 1,643 km of railway network

Testimonials

Without Genius, it would have been impossible to perform the code migration in 90 days.

Liliane Braga

Liliane Braga

Delivery Manager de uma grande operadora ferroviária

A system developed with current technology, designed to evolve, connect, and communicate with other systems, creating space for more integration, more accessible data, more efficient processes, and increasingly intelligent operations.

Fernando Germano

Fernando Germano

Especialista em Operações Ferroviárias na MRS Logística

AI has allowed us to modernize in a much safer, faster, and more economical way.

Haroldo Santos

Haroldo Santos

Delivery Director na Squadra

Want results like these?

Talk to our experts and find out how AI can transform your business.

Talk to an Expert →