Restructuring Among the ' most urgent is- sues in the CASE industry today is ' the need to devel- op better tools for restructuring, re-engineering and reverseengi- neering existing applications code into more easily expandable, maintainable systems. As outlined in previous columns, restructuring involves automatically converting unstructured source code into structured code; reengi- neering is used to standardize data defi: nitions, remove redundancies and anom- .. — alies in existing systems, and Finci reimplement the application in a new form; and reverse engineering is con- cerned with extracting high-level specifi- cations from existing code in the form > of data and process models." Rea Most computer-aided software engi- neering (CASE) tools currently don't provide facilities to restructure or re-en- gineer existing code; they are focused on automating the production of new appli- cations. However, as much as 80 percent of the pri ing effort in many in-: formation-systems is) organizations is directed toward the enhancement of ex- isting applications. B. 'Tackling a Thorny Task . Forward-engineering from graphical .. design specifications using a convention:" al CASE tool is much simpler to enact ' than true reverse-engineering, which de- mands the extraction of specifications » from existing systems. For instance,'' 1 more than 200 CASE vendors support: the conventional forward-engineering |" process, although very few vendors ' /'' have tackled the thorny task of reverse: ' engineering existing applications. In fact, no vendor has yet solved this problem :. ,. for both the data and process sides of / an application ;!": %W MJU Organizations nize the increasing serving the value of past software in- vestment through re-engineering the ex- isting software base. Many organizations have 10 million to 20 million lines of code that must be maintained and en: «: hanced for many more years; replacing ward-engineering technigues is impracti: cal at best. ia The restructuring of existing code is ' one of the simplest methods available to | reduce the cost of maintenance. Using : products such as Language Technology Ines Recoder or IBM's COBOL Structur- ing Facility permits existing unstruc- . tured COBOL programs to be restruc- tured automatically, As shown in the figure, these pro- grams take spaghetti-code input and proda pac structured code and ocumentation as output, The resul structured programs are identical ne functionality to the original unstruc- tured programs; however, the structured this large body of code using only for..." v "she bina: nji APPLIED INTELLIGENCE Či Code Is a Sound Investment in the Future code is typically 20 percent to 25 per: cent less expensive to maintain. In operation, the restructuring tool ex- |ecutes a complex algorithm to automati- cally structure the spaghetti code. First, it reduces the program to an abstract, control-flow design. This design is then analyzed and redesigned to achieve a cleanly structured control graph, which is then run through a COBOL generator to reimplement; the structured design. Documentation is produced in the form , of structure charts, control:£flow dia-- grams and reports on problem areas in the code, such as unreachable code, end-. less loops and poor structure. Specialized versions of these products 'tenance costs substantially by using automated tools to analyze its portfolio of COBOL programs, identify poorly structured routines and automatically restructure these programs. Metrics tools provide an objective evaluation of the cornplexity and guality of each pro- ' gram module. As illustrated in the figure, the re- structuring process does not extract specifications from the restructured code; it stopš short of making control- flow information accessible to the pro- grammer. : Some restructuring tools do provide interactive access to the controlflow di- agrams produced as part of the restruc- Restructuring and Reverse Engineering Of Software Processes Multiple Vendors Support Restructuring of Process Code; Unstructured code — PSA SA Ri KA ii Resiructuring Restructuring engine Extracted specifications (Process model) Reverse engineering Addition of system-design and business know- ledge through human programming experls No Vendor Yet Supports Its Complete Reverse Engineering Redesigned code and documentation Restructured code Documen- | Project tation manage- generator | ment tool specitications (Process model) Repository « Goals » Report designs « Screen designs » Strategies dis j MisRtnatiti ši iIHRGrTO lani" » Data models « Specitications » Process models » Rules « Data structures » Program structures — Organizations ions are beginning to recognize the increasing importance of preserving the value of past software through ; iste iron dev j " are available to restructure IBM's Cus- ' ' tomer Information Control System | gram (CICS) commands, such as POSA s Handle construct, which can cause hid: /' /, den control flow jumps whenever a par- ' ticular type of error occurs. To provide an objective measurement of the guality of the code, additional tools such as the Inspector from Language Technology. ' can be used to apply structure and com- plexity metrics to existing code. Organizations such as the Hartford In: . surance Group of Hartford, Conn,, have ' used restructuring and metrics tools in support of an applications-maintenance center. The company has reduced main- reengineering the existing software base. turing process. These tools, among them a new product called Chrysalis from Language Technology and the 'Via/Center product set from Viasoft Inc., extract controHlow information from the code and make this informa- | tion available to programmers on line. Using this information, prograrmers / can evaluate the structure and organiza- tion of the program, how control is passed between modules and how logic and data flow through the program. The Pprogrammer can use this information to enhance and malntain the program at the structure-chart level. E As shown in the figure, a desirable nesel, next step in the extraction of control in- formation from existing code is to pro- duce higher-level control abstractions, by extracting process specifications in the form of process models that are inde- pendent of the implementation environ- ment. These process specifications can then be combined with high-level data . models, which are stored in the reposi" of a CASE tool, and then enhanced at the design level and reimplemented in any supported environment. It is desirable to build systems that will be easy to change in the future. A major goal of software engineering is to make systems easy to enhance and maintain. Applications built today should be fully based on normalized data models in a CASE repository. To design systems that will ease fu- ture enhancement and migration, the following technigues are recommended: 6 Use CASE tools for planning, analysis, design and construction. 6 Use a code generator driven by the CASE design tools. e Adhere to the principles and prac: tices of information engineering. e Create procedure designs that are in- dependent of technology, which is likely to change. e Employ a code generator that can translate the designs into implementa- tions with different technology (for ex: ample, a tool that can generate code and data descriptions for different data- base environments). € Use fully normalized data models. € Use fully structured code built with an action-diagram editor that is part of a CASE environment. € Use a relational database whenever possible. € Use application standards such as IBM's Systems Application Architecture. € Use a database-management, system with field independence and features that enable changes to be made without rewriting existing programs. € Avoid unusual hardware, operating systems or facilities that could make fu- ture migration difficult. € Plan to do future maintenance by re- generation. € Make upper-level management fully aware of the business reasons for using soltware-engineering technigues and automation in applications development. Next week begins a series of articles on key industry trends in computer hardware, software, database environ- ment, communications and methodolo- gies that are having a profound impact, on the computer industry. 8 tory The concepts embodied, in reverse-engi- neering are described in the CASE volume dn The James Martin Report Series. For more information on this volume, call (800) 242-1240. For in- formation on seminars, contaci (in the United, States and Canada) Technology Transfer Institute, 741 10th St., Santa Monica, Calif. 90402 (213) 394-8305. In Europe, contact Savant, 2 New St, Carnforth, Lancs., LA5 9BX United Kingdom (0524 734 505.