Menu

1 / 3

Characterization tests before a banking COBOL migration to Java, hands-on

DEV Community: java·Wallace Espindola·about 2 hours ago
#KgXx8M15
#devtojava#devto#dev#port#java
Reading 0:00
15s threshold

You've been asked to move a bank's monthly interest calculation off the mainframe. The COBOL program is short, the logic looks like one line of arithmetic, and someone on the team has already said "we can port that in an afternoon". They're right about the afternoon. The port will compile, the unit tests you write for it will pass, and it will still be off by a cent on some accounts.

That cent sums up the trouble with legacy banking code. The rules live in the code rather than in a document, and the code carries semantics (truncation, packed decimal, implied decimal points) that a reasonable-looking Java port changes without anyone noticing. So before you port anything, you pin down what the legacy system actually does and make it the judge.

This article covers the hands-on part: the files you read, the files you add and the commands you run to put one COBOL rule under characterization tests, port it to Java 25 and prove the port is equivalent.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.