Recover Before You Rewrite: Turning Legacy Logic Into Reviewable Modernization Requirements
A practical guide for application owners, product managers and modernization teams facing a knowledge gap—not simply a ticket-quality problem.
Before asking how quickly a legacy application can be rewritten, ask a harder question: Which business decisions must survive the change?
When the intent is known, clearer requirements can help teams deliver it. When the intent is missing, better-written tickets are not enough. Teams first need to investigate existing processing logic, distinguish business rules from technical mechanisms and resolve exceptions with people who understand the domain.
The goal is not to treat old code as an unquestionable specification. It is to turn the behavior embedded in that code into evidence that business and engineering teams can review together.
AI can support that investigation. But translating logic into another language is not, by itself, proof that the business behavior has been understood or preserved.
What AI-assisted translation does—and does not—establish
On a modernization project, Publicis Sapient data engineering manager Giridhar Giri Kothandaraman needed to move legacy data-processing logic into a cluster-based parallel processing environment. He defined prompts and used Sapient Slingshot to translate that logic into a PySpark data-processing module.
The translation provided a faster starting point than a fully manual approach. It did not finish the engineering work. Kothandaraman still needed to understand the requirements, validate the code and confirm that it worked correctly in its intended environment. He also refined how credentials were handled through a secrets manager.
That experience offers two important lessons. First, a translated module still needs validation against business requirements. Second, modernization involves operational and security decisions that cannot be settled by translating processing statements alone.
It does not establish that code translation automatically recovers business intent, or that every exception survives unchanged. The proposed workflow below builds on that distinction: investigate first, expose uncertainty and validate requirements before implementation.
A proposed workflow: From processing logic to approved intent
This is a suggested working approach, not a description of a packaged Sapient Slingshot feature or the exact process followed on that project.
1. Bound the investigation around a business outcome
Start with one processing flow whose output matters to the business. Define what enters the flow, what it produces and who relies on the result.
The application owner should identify the relevant modules, dependencies and operating context. The product manager should articulate the outcome that modernization must protect. Engineering should establish which code and configuration versions are being examined.
Agree on the review boundary before generating requirements. A useful starting question is: “What must remain true about this output after modernization?” If the team cannot answer yet, record that as a discovery objective rather than filling the gap with an assumption.
2. Examine behavior before inferring purpose
Read the processing logic in manageable sections. Where approved AI assistance is appropriate, use it to help explain unfamiliar code, summarize transformations and identify branches requiring closer inspection.
Ask for evidence-linked descriptions: which condition triggers a branch, which fields it uses, what changes and what output follows. Keep those observations separate from explanations of why the business needs the behavior.
For each section, distinguish:
- Observed behavior: What the implementation appears to do.
- Candidate business rule: The business interpretation that needs validation.
- Technical mechanism: How the behavior is implemented today.
- Unknown: What the available evidence cannot establish.
A technically convincing explanation should not become an approved requirement simply because it reads well.
3. Recover exceptions as deliberately as the main path
Do not stop at the typical transaction. Examine alternative branches and ask domain experts which unusual scenarios affect the outcome.
Kothandaraman’s earlier work on customer-service transactions illustrates why this matters. In a separate assignment, he built an algorithm to reconstruct case lifecycles and measure productivity. Switching between cases and leaving cases open overnight complicated the calculation. Time spent away from work could not simply be counted as productive time. Getting the algorithm right required repeated testing and refinement.
That was not the PySpark modernization project. Its relevance is the nature of the knowledge: an exception can define whether a calculation is meaningful.
For the flow under review, ask: What interrupts normal processing? What happens when work resumes? Which elapsed intervals count, and which do not? Where are those decisions represented in the logic—and where do they depend on knowledge outside it?
4. Make uncertainty a reviewable work product
Maintain an uncertainty register alongside candidate rules. For every unresolved question, record the evidence, competing interpretations, potential business impact, decision owner and next action.
Use explicit statuses such as observed, inferred, disputed and validated. Avoid an unsupported confidence score that makes an interpretation look more certain than the evidence allows.
An entry might ask whether a branch represents an intentional exception or an outdated workaround. Do not silently decide to preserve or remove it. Assign the question to someone authorized to resolve it.
Where an uncertainty could materially change an output, treat it as a blocker for implementing the affected requirement—not as a note to revisit after coding.
5. Have domain experts validate requirements before implementation
Bring domain experts a compact review pack: the candidate rule, its location in the existing system, relevant examples, exceptions and unresolved questions. Ask them to validate the business meaning rather than approve a technical paraphrase they cannot readily challenge.
Separate two decisions:
- Does this accurately describe current behavior?
- Should the modernized system preserve that behavior?
Those answers may differ. Record whether each behavior will be preserved, intentionally changed, retired or investigated further. Have the product manager confirm the desired outcome and the application owner confirm the affected scope.
Then express the approved decision as a testable requirement, including conditions, expected results and exceptions. Keep intended changes distinct from behavior-preservation requirements so implementation teams know which differences are deliberate.
6. Validate the implementation and its operating environment
Once the relevant requirements are approved, use them to guide implementation and testing. AI-assisted translation can accelerate the first version; engineers remain responsible for evaluating the result.
Compare legacy and modernized outputs on agreed examples where behavior should remain unchanged. Investigate differences rather than assuming either implementation is automatically correct. For intentional changes, test against the newly approved expectation.
Maintain a separate set of operational acceptance criteria. Kothandaraman’s credential-handling refinements show why this matters: preserving a calculation does not establish that the new module handles credentials appropriately or works correctly in its target environment.
Business acceptance, engineering validation and operational readiness should each have an accountable reviewer.
Suggested rule-to-requirement-to-test traceability template
The following is editorial guidance for organizing modernization work. It is not an existing Sapient Slingshot product feature. Use it in a shared document or delivery repository, with stable identifiers that connect decisions to implementation and test evidence.
Field | What to record
- Rule ID and evidence | Unique identifier; module, version and relevant processing location
- Observed behavior | Conditions, inputs, transformation and output visible in the existing implementation
- Candidate business meaning | Plain-language interpretation, clearly marked as inferred until validated
- Exceptions and uncertainties | Alternative paths, missing context, disputed interpretations and linked questions
- Domain decision | Preserve, change, retire or investigate; rationale, reviewer and date
- Requirement ID and statement | Approved behavior, scope, conditions and expected result
- Acceptance examples | Normal, exception and boundary scenarios with agreed expected outcomes
- Test IDs and evidence | Linked tests, results, discrepancies and their resolution
- Implementation reference | Modernized component and version implementing the requirement
- Approval status | Business validation, engineering review and remaining blockers
For illustration only, a row inspired by the separate customer-service example could connect candidate rule R-01, “Exclude confirmed non-working intervals,” to requirement REQ-01, “Productive duration must exclude intervals classified as non-working under the approved rules.” Test T-01 would check an agreed overnight interruption example against a domain-approved expected duration.
This is not a recovered project artifact. Its unresolved question—how an interval is classified as non-working—must be answered before the requirement is ready. The template should expose that gap, not conceal it.
Measure recovered understanding, not just translated code
For an initial modernization slice, consider tracking the proportion of candidate rules with domain decisions, unresolved high-impact questions, requirements linked to acceptance examples and unexplained output differences.
These suggested measures shift attention toward readiness to implement and accept change. A large volume of translated code is not a substitute for agreement about what that code must accomplish.
Publicis Sapient’s approach to AI-assisted development emphasizes the whole software development lifecycle and the expertise of people who guide, inspect and take responsibility for AI outputs. Applied to legacy modernization, that means giving requirements recovery the same attention as code generation.
Start with one consequential flow. Recover its rules, challenge its exceptions and make its uncertainties visible. Then rewrite against intent that the business has actually reviewed—not intent that the team has merely inferred.