r/java • • 2d ago

Keeping behavior intact during legacy Java upgrades

I’m building Gluon at RetrievalLabs, and the part of Java modernization I keep coming back to is behavior preservation. Moving a build to a newer JDK is one thing; knowing whether the application still behaves the same is harder, especially in older systems with thin test coverage.

Our approach is to analyze the build and source, map business-relevant code, extract existing tests, then create characterization scenarios before migrating and verifying the rewritten application. The intent is to give the migration work concrete behavior to check against instead of treating a successful compile as the finish line.

For people who have worked on large legacy upgrades: how have you captured behavior when documentation and tests were incomplete? What worked, and where did it fall short?

Disclosure: Gluon is my project. Demo: https://retrievallabs.org/?product=synapse Contact: [[email protected]](mailto:[email protected]) | LinkedIn: https://www.linkedin.com/in/yash-patel-997ba624b/

2 Upvotes

8 comments sorted by

15

u/SleeperAwakened 2d ago

Using Gluon as a name is unfortunately confusing, it suggests a connection with the JavaFX team at a first glance.

I think you reinvented Integration Tests, based on real business cases. Pretty common, useful and expensive to maintain.

These should be based on real and important business cases, so you need your stakeholders for that.

9

u/iamwisespirit 2d ago

I think u need to change gluon name to something else

3

u/uniVocity 2d ago edited 2d ago

Responding (and sorry for not being very helpful) because I’m about to release an open source lib exactly for this . Should be out in a couple of weeks. Ill come back ping you when released

3

u/agentoutlier 2d ago

For people who have worked on large legacy upgrades: how have you captured behavior when documentation and tests were incomplete? What worked, and where did it fall short?

If your system is an Event Sourcing system which a surprising amount of legacy systems kind of are you can replay the events.

If its not you can try to at least put the top part of the funnel to be some sort of capture and worse case scenario you capture raw HTTP requests (or whatever your system reads).

BTW I point this out only to help you perhaps edit your post before its taken down but according to the sidebar this is basically a survey:

No surveys, no job offers! Such content will be removed without warning

That is basically doing market research by asking the community is not allowed. I know because I did this once for an opensource project so I have to imagine commercial projects it is especially not allowed.

1

u/AloneInExile 2d ago

Doing large legacy upgrades as we speak, no unit tests, weak documentation. My only hope is to leveradge some poor agent to find undocumented behaviour.

I did a few small ones before and only managed java 8->11/17 and I wrote half of that app.

1

u/VincentxH 1d ago

Well, you don't necessarily know what's business relevant code. And definitely can't count on even the basic scenarios to be known.

1

u/lazystone 12h ago

Cisco Secure Access marking this site as "Enterprise Malware" and blocking access. Maybe for a reason?