Taking HotRod for a test drive

Version 2.0 of Netron’s software finds meaning in legacy Cobol apps

Redeploying a legacy application to a new environment, rather than building one from scratch, makes good business sense. It’s usually faster to reuse business logic (those parts of an application’s code that manage business functions) that has already been proven than to perform an entirely new analysis.

But that can be a costly and time-consuming process. A common approach is to manually inspect the code for sections with business relevance, then applying the same logic to the new system. Yet because most code deals with technical issues, you have to do a lot of digging to find the parts containing business logic. So a redeployment project could involve entire teams of developers.

A recent release from Netron Inc. offers relief for developers trying to find the business logic hidden in legacy Cobol applications. HotRod 2.0 acts as a sieve for Cobol code, trapping in its mesh all code that may have business rules. Unlike many of its competitors, HotRod doesn’t convert legacy code into other programming languages, although it does create documents for business rules that you can write into new software. But it’s still an impressive package.

Built-in knowledge

Similar products find business logic by either following a trail of data modifications or locating sequences of code that are similar to sequences you indicate; either way, you have to assess which data or code sequences are worth pursuing – a potentially costly and drawn-out process.

In contrast, HotRod comes with a built-in knowledge of typical Cobol code patterns that could contain business logic. The software sniffs around your code and assigns scores to each section according to how they conform to the built-in business logic patterns. Obviously, you’ll still have to evaluate each segment yourself. But you’ll be working only with subsets of code, not the whole application, which translates to time and cost savings.

I took HotRod for a test drive to see what it could do. The first step was to import some source code and create a repository using Merant Micro Focus’ Revolve application extension kit, which is necessary to run HotRod. I then launched HotRod, created a new project, and indicated the name of the Revolve repository as my project database. That gave me immediate access to all the modules in my application.

Find similar code

Next, I selected all the modules in my sample application and searched for clones. When you’re rewriting applications, you generally want to avoid redundancies (such as having two almost identical programs) because they can make conversion and maintenance unnecessarily cumbersome.

With HotRod, you can find those duplicates and near-duplicates by searching for literal similarity or by using a more refined technique that spots similar code despite semantic differences. I ran a search for literal similarity. Within a few seconds, HotRod found two identical modules and alerted me that about 80 per cent of the code was similar in each of four others.

Finally, I was ready to hunt down business rules. I began by letting HotRod classify my code with its built-in algorithms for business rules patterns. You can search using the standard mode, modify it with your own criteria, or apply only your criteria. In the standard mode, the program looks for paragraphs containing statements that perform such tasks as arithmetic operations or assigning values to fields.

Determining which set of criteria is most effective for you can be an exercise in trial and error. Thankfully, HotRod does the legwork for you, and each search took only a few seconds on my small set of programs. I chose the standard mode, and when the search was complete, HotRod presented me with a list of Cobol paragraphs arranged by numerical ratings it had assigned.

From my list of business-rule candidates, I selected one with the unlikely name of “Read_Next_Product.” Clicking the name opened a window with the actual code. To my surprise, the code contained instructions for preparing invoices and computing formulas for labour and materials costs. HotRod had correctly identified a set of business rules.

My next step was to save this information in a ROD (Reusable Object Document), a text package that documents business rules. Pointing and clicking on menus and toolbars transferred my source code to a ROD; I could also add notes to clarify its purpose. Clicking my new ROD window brought me to the original source code, which HotRod had marked in different colours to indicate which lines of code were contained in the ROD, and which were only referenced. With this useful feature you can scroll through the code and see how each section relates to the business rule that you are building.

At US$25,000 for a 10-user licence, HotRod is a significant investment. That investment is made even more burdensome when you consider that Merant Micro Focus’ Revolve costs US$32,000 for 10 users. If you need a utility that not only analyzes but also converts applications, you may want to look into more inclusive solutions like Relativity Technologies’ RescueWare or Netron’s own Jacada or Fusion. Even so, HotRod is a solid performer that could easily pay for itself in decreased analysis time.

Apicella is a technology analyst for the InfoWorld Test Centre. You can reach him at mario_apicella@infoworld.com.