U APPLICATION DEVELOPMENT i PG WEEKN APRIL 23, 1990 š z Making the C To help main: — tain and enhance the billions of lines of existing application code, programmers need powerful |. reverse-engineer- ing tools that can both derive pro- cess models and data models: -' from existing code, and help rebuild these ap- je plications within distributed-processing : z a more modern environment. Reverse-engineering is a software tech- nology that has as its goal the migration of old systems into a cleanly engineered form that can be enhanced easily. The re- ality is that true reverse-engineering tools that convert existing data definitions and procedural code into high-level specifica- tions are not yet available. ' For instance, computer-aided software engineering (CASE) tools are oriented toward the specification and implemen- tation of new applications, and thus fall short of providing much assistance in'' the support and improvement of exist- ing application code. zen kn ' There's a lot of confusion in the field about what is meant by reverse-engi- neering. To clear up the confusion, con-. sider the three categories of tools that support various components of reverse- engineering: € Restructuring Engines. These tools automatically convert unstructured source code (such as COBOL) into struc- tured code. The goal is to reduce mainte- nanče costs, improve guality, extend the life of old systems and enable program :/' enhancements to be made in much less '' time. The process automatically creates a structured version of the original source code without changing its func- tionality. i ; beli ' Re-engineering Tools. These tools an: alyze the source code to identify its structure and detect data redundancies, | nonstandard names and unused code, /' | Documentation is produced that lists' cross-reference tables, structure charts and relationships between files, records and fjelds. An analyst can interact with the tool to resolve inconsistencies and restructure process or data definitions. The standardized definitions can then be stored in the repository of a CASE tool for further analysis. | pi prvi % Reverse-Engineering. The term 're- verse-engineering" should be reserved .: for tools that are capable of synthesiz- ing unstructured data definitions and processing definitions up to the level of pure specifications, independent of envi- rese specifications can then a forward-engineering process to reimplement the application in the same or a different environment, using . standard CASE technigues. Extraction of specifications from existing data defi-. nitions and process code is an extraordi.. narily difficult task, which has been solved, to date, only on the data side. ' Most CASE tools that claim reverse" | j l ASE m ise | rav PRA engineering capabilities actually support: functions. They don't syn-'" thesize low-level data and process defini: data-structure diagram into a high-level - data model (or conceptual schema). €. gram are first captured from | files and analyzed using a form of re: — with the tool "The result tions up to the level of environment: .. independent; specifications. " Ualalo: 'The figure illustrates the functions performed by a true reverse-engineering tool. Reverse-engineering of data func- tions are shown on the left of the figure; reverse-engineering of process functions are shown on the right. ' h As shown, conversion of data defini- tions into specifications is done at three "levels: capture of physical data defini- tions in the program; development of a schema description contained in a data- structure diagram; and conversion of the for Di | rue Reverse-Engineering Tools version of data definitions into an inter: : mediate form called a data-structure di: ; agram. The data in the old program is likely to be unnormalized. The data- structure diagrams need to be normal- ized and the normalized structure made to conform to a data model. 'The data model is a pure specifica- tion, typically expressed in the form of an entity-relationship diagram. - At this point, the data definitions from the program have been converted into a data model, at the specification level. From that data model, new data structures can be created for the same database-management environment or a different environment. The Stages of Reverse and Forward Engineering Goat Is Tb Convert Data Definitions and Program Code Into Pure Specifications, Then Forward-Engineer to New Designs ES —psE Repositor NE SEEN (stores data štid: ote ele) Data fr Models ee Data structure diagrams Captured | data | | definitions | Redesigned data definitions Lowlevel data definitions in the pro- ua engineering. A programmer can interact." to resolve inconsistencies and produce more uniform data defini- /. tions and data-element formats, Howev- /. er, if data definitions from many appl cations are loaded into the tool, the mes revealed may be so great that the / jed from clean: «4 programmer is discourag, — ing it up. Thus, ids generally desirable to "vrernanaii tackle a small area at a time. " of this analysis is the con-16: .-—. Pa EN ERROR Sar va? 7 ramo ze mana Ee Process Procedure structure diagrams ; The reverse-engineering of the data side has been implemented by Bachman . Information Systems Inc. in its š 7. Bachman/Re-Engineering Product Set, - This product set is capable of ca; turing data definitions in IMS, IDMS, DB2 and VSAM systems and then migrating these designs from one database-management ze ' system to another. The product set can also be i create data models fi useda The Bachman tool set is implemented the programmer or analyst what infor- mation is missing to create a data-struc- ture diagram or data model. The pro- grammer fills in the missing pieces of in- formation while interacting with the system. s Reverse-engineering the process side, which reguires converting unstructured program code into high-level design specifications that can be input into the repository of a CASE tool, is proving very difficult. The application may be written with spaghetti code; it needs to be converted to structured pro- gramming. ; Several tools exist for automatically restructuring COBOL programs. The product Recoder from Language Tech- nology Inc., for example, converts CO- BOL programs that are messy, unstruc- tured and badly coded into fully struc- tured COBOL. The resulting program is functionally identical to the original. The restruc- tured code can be tested, perhaps with the original test data, to ensure that it's functionally eguivalent to the original. The restructuring process produces structured source code but; not process- -model specifications. To support, reverse- engineering on the process side, it's nec- essary to convert the structured code into high-level specifications that ex- tract the business functions performed by the code. These specifications form the basis for enhancing and maintaining the application. Action Diagrams After the program has been converted 'to a fully structured form, it should be synthesized into a set. of action diagrams for a CASE tool. Action diagrams, which define the process model for the applica- tion, can be converted into other dia- gram types (such as decomposition dia- grams, structure charts or data-flow dia- grams) and can be linked to data models, screen designs and so on. Although the structuring of source - code can be done automatically, the ex- traction of design specifications from the structured code reguires the assis- tance of an analyst. The analyst inter- acts with the system and fills in missing data, such as logical groupings of busi: ness processes, refinement, of data flow < and consistent naming conventions. No CASE tool currently supports re- verse-engineering of unstructured source code into process models at the specifi: Y. cation level. The introduction of such a tool would be an invaluable addition to the CASE market. . Next week, I will discuss tools that see re-engineering of existing source e. The concepts embodied, tn reverse-engi- neering are described in the CASE vol- ume in The James Martin Report Se- ries. For more information on this vol- ume, call (800) 242-1240. For €. information on seminars, contact (in or new applications, ' ted via direct the United States and. Canada) Tech- nology Transfer Imstitute, 741 10th St. Santa Monica, Galif. 90402 (213) 394- 8305. In Europe, contact Savant, 2 šem se kim expert system << New St, Carnforth, Lancs, LA5 9BX 7 tance by indicating to. United Kingdom (0524) 734 505. ' | č | an aa LEVE Vx ; Vre Sd