Restructuring functions with low cohesion

We present a technique for restructuring functions with low cohesion into functions with high cohesion. Such restructuring is desirable when re-architecting a legacy system into an object-oriented architecture. The restructured system has functions with higher cohesion and hence lower coupling. This enables finer-grained grouping of functions into objects. Automatically decomposing a function is difficult when its computations are interleaved. The challenge lies in programmatically identifying and separating the various activities performed by a complex code segment. The technique presented partitions the set of output variables of a function on the basis of their pairwise cohesion. Program slicing is then used to identify the statements that perform computations for each variable group in the partition. New functions corresponding to the slices are created to replace the original function. Experiences with restructuring real-world code using a tool that implements the technique are presented.

[1]  Keith Brian Gallagher,et al.  Using Program Slicing in Software Maintenance , 1991, IEEE Trans. Software Eng..

[2]  James M. Bieman,et al.  Program slices as an abstraction for cohesion measurement , 1998, Inf. Softw. Technol..

[3]  Keith Gallagher,et al.  Evaluating the Surgeon's Assistant: results of a pilot study , 1992, Proceedings Conference on Software Maintenance 1992.

[4]  Zohar Manna,et al.  The Translation of 'Go To' Programs to 'While' Programs , 1971, IFIP Congress.

[5]  Richard C. Waters Program Translation via Abstraction and Reimplementation , 1988, IEEE Trans. Software Eng..

[6]  James M. Bieman,et al.  Using Design Cohesion to Visualize, Quantify, and Restructure Software , 1996, SEKE.

[7]  James H. Cross,et al.  Reverse engineering and design recovery: a taxonomy , 1990, IEEE Software.

[8]  Arun Lakhotia DIME: a direct manipulation environment for evolutionary development of software , 1998, Proceedings. 6th International Workshop on Program Comprehension. IWPC'98 (Cat. No.98TB100242).

[9]  Alan R. Hevner,et al.  Using function abstraction to understand program behavior , 1990, IEEE Software.

[10]  J. Nandigam A measure for module cohesion , 1995 .

[11]  Stephen R. Schach,et al.  Application of automatic decomposition schemes in proof maintenance for evolving programs , 1992, J. Softw. Maintenance Res. Pract..

[12]  Arun Lakhotia,et al.  Restructuring programs by tucking statements into functions , 1998, Inf. Softw. Technol..

[13]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[14]  R. E. Kurt Stirewalt,et al.  Detecting interleaving , 1995, Proceedings of International Conference on Software Maintenance.

[15]  Edward Yourdon Decline and Fall of the American Programmer , 1992 .

[16]  Arun Lakhotia Rule-based approach to computing module cohesion , 1993, Proceedings of 1993 15th International Conference on Software Engineering.

[17]  R. S. Arnold,et al.  Software restructuring , 1989, Proc. IEEE.

[18]  Giuseppe Visaggio,et al.  Extracting Reusable Funtions by Flow Graph-Based Program Slicing , 1997, IEEE Trans. Software Eng..

[19]  Glenford J. Myers,et al.  Structured Design , 1974, IBM Syst. J..

[20]  Thomas W. Reps,et al.  Integrating non-intering versions of programs , 1988, POPL '88.

[21]  Frank W. Calliss Problems with automatic restructurers , 1988, SIGP.

[22]  Brenda S. Baker,et al.  An Algorithm for Structuring Flowgraphs , 1977, J. ACM.

[23]  Glenford J. Myers,et al.  Structured Design , 1999, IBM Syst. J..

[24]  Glenford J. Myers,et al.  Composite/structured design , 1978 .

[25]  S. R. Schach,et al.  Using automatic program decomposition techniques in software maintenance tools , 1989, Proceedings. Conference on Software Maintenance - 1989.

[26]  Roger S. Pressman,et al.  Software Engineering: A Practitioner's Approach , 1982 .

[27]  Thomas W. Reps,et al.  Integrating noninterfering versions of programs , 1989, TOPL.

[28]  Leon Sterling,et al.  Composition based on skeletons and techniques , 1993 .

[29]  R. E. Kurt Stirewalt,et al.  The interleaving problem in program understanding , 1995, Proceedings of 2nd Working Conference on Reverse Engineering.

[30]  Hyeon Soo Kim,et al.  Restructuring Programs through Program Slicing , 1994, Int. J. Softw. Eng. Knowl. Eng..

[31]  Peter T. Breuer,et al.  Creating specifications from code: Reverse-engineering techniques , 1991, J. Softw. Maintenance Res. Pract..

[32]  Martin P. Ward Abstracting a specification from code , 1993, J. Softw. Maintenance Res. Pract..

[33]  John A. Stankovic Good System Structure Features: Their Complexity and Execution Time Cost , 1982, IEEE Transactions on Software Engineering.

[34]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[35]  Keith Brian Gallagher,et al.  Visual impact analysis , 1996, 1996 Proceedings of International Conference on Software Maintenance.

[36]  Takumi Kasai,et al.  Translatability of Flowcharts into While Programs , 1974, J. Comput. Syst. Sci..

[37]  James M. Bieman,et al.  Measuring Functional Cohesion , 1994, IEEE Trans. Software Eng..

[38]  Carma McClure,et al.  The three Rs of software automation: re-engineering, repository, reusability , 1992 .