Path: utzoo!utgpu!jarvis.csri.toronto.edu!qucis!tsitinis From: tsitinis@qucis.queensu.CA (Vaggelis Tsitinis) Newsgroups: comp.software-eng Subject: Software Restructuring Message-ID: <172@qusunb.queensu.CA> Date: 26 Feb 89 05:02:07 GMT Organization: Queen's University, Kingston, Ontario, Canada Lines: 46 Structured programming emphasizes programming language constructs such as while loops, until loops, and if then else statements. Properly used, these constructs make occurences of loops and branching of control obvious. Many algorithms have been proposed for restructuring a program into a simplest one, eliminating the nested loops and avoiding the use of gotos. However, these techniques do not necessarily produce clear flow of control. Misuse of control constructs may mislead the reader into expecting patterns of control flow which do not exist in the initial program. For example, these techniques may use a repeat statement when the contained code cannot be executed more than once or add numerous control variables to avoid goto statements. They also may avoid goto statements by copying segments of code or creating subrou- tines. The former method results in longer programs and bugs may be introduced when all the identical segments must be modified. The latter method may result in subroutines which appear unnatural. Therefore, we must concentrate on the principles for the use of basic control structures. These principles fall into two categories:those which concern the nesting of statements and those which concern the use of branching statements, such as goto, next, break and stop. A properly structured program is a program which obeys the aforementioned structuring principles. A rather straightforward algorithm is one which transforms a flowgraph into a properly structured program. In general, the properly structured program may contain goto statements. However, the goto statements occur only where no other available control contrust describes the flow of control. Many tools exist dealing with the concept of software restructuring and one of them is "struct" for structuring fortran programs. The tool has been built by Brenda S. Baker, Bell Labs, Murray Hill, NJ. 07974 If you know anything for that tool or you have used it, I would appreciate a comment or to let me know more about it. Thanks in advance. e-mail address : tsitinis@qucis.queensu.ca mail address : Tsitinis Vaggelis Department of Computing & Information Science Queen's University Kingston, Ontario K7L 3N6 C A N A D A