MenuRainCode Newsletter - May 2002Testimonials

Editorial

RainCode Online is a new, recently launched service. It is an online COBOL restructuring service: it reduces maintenance costs by renovating legacy COBOL code, and giving it a second life. After transformation, applications become much more readable and intelligible, with less GOTOs, a better structure and a better performance.

It is frequently experienced that 70% of the total costs of a system are devoted to maintenance and adjustments. Several studies have also demonstrated that restructuring legacy applications leads to a reduction of 40 to 50% in maintenance time and cost. Restructuring is obviously a cost-effective investment.

The process

One of the major advantages of RainCode Online is the fact that the whole code refactoring process is performed thru the web, without anything to install on your local systems:

  • The user submits on our website the COBOL sources he/she wants to restructure and chooses the transformations he wants to see applied to his code.
  • The renovation is performed on our server. This can take from a few hours to a few days, depending on the volume of the submitted sources, their complexity and the availability of our servers. Then, the user is notified by email when the restructuring is over.
  • The results of the transformations can be seen online. The user can change the parameters of the renovation and resubmit it again and again at no charge till the restructured code perfectly fits his needs.
  • If the user is completely satisfied with the results and is willing to put the restructured sources into production, he can order the restructured code by just a single click.

That means the user doesn’t buy a pig in a poke, he doesn’t pay anything till complete satisfaction.

Besides, the price of the renovation depends on the quality of the code, the user only pays for the transformations that were actually performed. In other words, if the submitted source is in relatively good state, the price to re-factor it will be low.

The process

To give you an idea of what RainCode Online is able to accomplish, we recorded the following statistics on the first ten applications we restructured:

  • On average, 75% of the GOTOs were removed.
  • In each program, we managed to re-create between 30 and 85 loops from GOTO-based equivalent constructs.
  • We typically reduced the size of a program to 60-90% of its original size, in terms of number of statements.

As an illustration, here follows a short example of how RainCode Online can transform a piece of badly structured COBOL code.

  A1001.
         MOVE     1              TO X-WRK-J.
         GO TO    A1003.
  A1002.
         ADD      1              TO X-WRK-J.
  A1003.
         IF         10      < X-WRK-J THEN
           GO TO    A1006
         END-IF.
         IF    FLAG(X-WRK-J) = '0' THEN
           NEXT SENTENCE
         ELSE
           GOTO    A1004
         END-IF.
         MOVE  'X' TO TABLE(X-WRK-J).
  A1004.
         IF    FLAG(X-WRK-J) NOT = '0' THEN
           NEXT SENTENCE
         ELSE
           GOTO A1005
         END-IF.
         MOVE 'Y' TO TABLE(X-WRK-J).
  A1005.
         GO TO A1002.
  A1006.
         EXIT.

Becomes:

  PERFORM WITH TEST BEFORE
         VARYING X-WRK-J FROM 1
                         BY 1
         UNTIL 10 < X-WRK-J
         IF FLAG(X-WRK-J) = '0' THEN
             MOVE 'X' TO TABLE(X-WRK-J)
         ELSE
             MOVE 'Y' TO TABLE(X-WRK-J)
         END-IF
  END-PERFORM.
 

The resulting reshaped source is equivalent to the original source in terms of functionality and semantics; it is shorter, better structured and obviously way more readable.

The technique

RainCode Online uses the RainCode technology without ever exposing the end-user to the intricaties of RainCode scripting. Renovation scripts are automatically applied and recognize a certain number of patterns, which are then transformed into better structured constructs.

Some examples of such transformations are:

  • Removal of unused labels or dead code,
  • Replacement of GOTO-based loops by equivalent more structured constructs,
  • Systematic use of optional keywords (THENs, END-IFs, etc…), and cosmetic enhancements, such as systematic indentation

Each step can take advantage of the result of the other steps, incrementally improving the quality of the code.

This method proves to be advantageous in many ways:

  • Executability is guaranteed. The risk of error is virtually null. If an error were made in a script that induces a non-equivalence between the initial and the restructured code, it would be infinitely repeated through the automatic process. It means that the probability of not catching it is close to null since it has already been tested on huge amounts of code.
  • Application gets much more readable and intelligible with better structure and even performance without any risk or eclipse effect: the program continues to run during the renovation process, and can be tested at any time.
  • As the process is automatic, it can be applied at will, even after potential manual changes were made; improvements can be made incrementally.

There is no risk. Just connect yourself to www.raincode.com/online and have a try.


© 2002-2006 RainCode -- comments to webmaster@raincode.com