This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
A C++ Data Model Supporting Reachability Analysis and Dead Code Detection
September 1998 (vol. 24 no. 9)
pp. 682-694

Abstract—A software repository provides a central information source for understanding and reengineering code in a software project. Complex reverse engineering tools can be built by analyzing information stored in the repository without reparsing the original source code. The most critical design aspect of a repository is its data model, which directly affects how effectively the repository supports various analysis tasks. This paper focuses on the design rationales behind a data model for a C++ software repository that supports reachability analysis and dead code detection at the declaration level. These two tasks are frequently needed in large software projects to help remove excess software baggage, select regression tests, and support software reuse studies. The language complexity introduced by class inheritance, friendship, and template instantiation in C++ requires a carefully designed model to catch all necessary dependencies for correct reachability analysis. We examine the major design decisions and their consequences in our model and illustrate how future software repositories can be evaluated for completeness at a selected abstraction level. Examples are given to illustrate how our model also supports variants of reachability analysis: impact analysis, class visibility analysis, and dead code detection. Finally, we discuss the implementation and experience of our analysis tools on a few C++ software projects.

[1] R.S. Arnold, "Software Reengineering: A Quick History," Comm. ACM, vol. 37, no. 5, pp. 13-14, May 1994.
[2] N.S. Barghouti, J. Mocenigo, and W. Lee, "Grappa: A Graph Package in Java," Proc. Fifth Int'l Symp. Graph Drawing, pp. 336-343. Springer-Verlag, Sept. 1997.
[3] E. Buss, R.D. Mori, W. Gentleman, J. Henshaw, J. Johnson, K. Kontogianis, E. Merlo, H. Müller, J. Mylopoulos, S. Paul, A. Prakash, M. Stanley, S. Tilley, J. Troster, and K. Wong, "Investigating Reverse Engineering Technologies for the CAS Program Understanding Project," IBM Systems J., vol. 33, no, 3, pp. 477-500, 1994.
[4] P.P. Chen, “The Entity‐Relationship Model: Toward a Unified View of Data,” ACM Trans. Database Systems, Vol. 1, No. 1, Jan. 1976, pp. 9–36.
[5] Y.-F. Chen, "Reverse Engineering," B. Krishnamurthy, ed., Practical Reusable UNIX Software, ch. 6, pp. 177-208,New York: John Wiley&Sons, 1995.
[6] Y.-F. Chen, G.S. Fowler, E. Koutsofios, and R.S. Wallach, "CIAO: A Graphical Navigator for Software and Document Repositories," Int'l Conf. Software Maintenance, pp. 66-75, 1995.
[7] Y.-F. Chen, B. Krishnamurthy, and K.-P. Vo, "An Objective Reuse Metric: Model and Methodology," Proc. Fifth European Software Eng. Conf., 1995.
[8] Y. Chen, M. Nishimito, and C. Ramamoorthy, "C Information Abstraction System," IEEE Trans. Software Eng., vol. 16, no. 3, pp. 325-334, Mar. 1990.
[9] Y.F. Chen, D.S. Rosenblum, and K.P. Vo, “TestTube: A System for Selective Regression Testing,” Proc. 16th Int'l Conf. Software Eng., pp. 211-222, May 1994.
[10] P. Devanbu, "GENOA—A Customizable, Language and Front-End Independent Code Analyzer," Proc. 14th Int'l Conf. Software Eng., May 1992.
[11] P. Devanbu, D. Rosenblum, and A. Wolf, "Generating Testing and Analysis Tools with Aria," ACM Trans. Software Eng. and Methodology, vol. 5, no. 1, pp. 42-62, 1996.
[12] Edison Design Group:http:/www.edg.com
[13] G. S. Fowler,“A case for make,”Software—Practice and Experience, vol. 20, no. S1, pp. 35–46, June 1990.
[14] G. Fowler, "cql—A Flat File Database Query Language," Proc. USENIX Winter 1994 Conf., pp. 11-21, Jan. 1994.
[15] E.R. Gansner, E. Koutsojos, S.C. North, and K.-P. Vo, “A Technique for Drawing Directed Graphs,” IEEE Trans. Software Eng., vol. 19, pp. 214–230, 1993.
[16] J. Grass and Y.-F. Chen, "The C++ Information Abstractor," The Second USENIX C++ Conf., Apr. 1990.
[17] S. Horwitz and T. Teitelbaum, "Generating Editing Environments Based on Relations and Attributes," ACM Trans. Programming Languages and Systems, vol. 8, no. 4, pp. 577-608, 1986.
[18] A. Koenig, "An Example of Dynamic Binding in C++," J. Object-Oriented Programming, vol. 1, no. 3, Aug. 1988.
[19] M. Lejter, S. Meyers, and S.P. Reiss, "Support for Maintaining Object-Oriented Programs," IEEE Trans. Software Eng., vol. 18, no. 12, pp. 1,045-1,052, Dec. 1992.
[20] H. Müller, M.A. Orgun, S. Tilley, and J.S. Uhl, "A Reverse Engineering Approach to Subsystem Structure Identification," J. Software Maintenance, vol. 5, no. 4, pp. 181-204, 1993.
[21] G. Murphy, D. Notkin, and E.-C. Lan, "An Empirical Study of Static Call Graph Extractors," The 18th Int'l Conf. Software Eng., pp. 90-99, 1996.
[22] R. Murray, "A Statically Typed Abstract Representation for C++ Programs," Proc. USENIX C++ Conf., pp. 83-97, Aug. 1992.
[23] J.Q. Ning, A. Engberts, and W. Kozaczynski, "Automated Support for Legacy Code Understanding," Comm. ACM, vol. 37, no. 5, pp. 50-57, May 1994.
[24] D. Richardson, T. O'Malley, C. Moore, and S. Aha, "Developing and Integrating PRODAG in the Arcadia Environment," Proc. Fifth ACM SIGSOFT Symp. Software Development Environments, pp. 109-119, Dec. 1992.
[25] D. Rosenblum and A. Wolf, "Representing Semantically Analyzed C++ Code with Reprise," Proc. USENIX C++ Conf., pp. 119-134, Apr. 1991.
[26] D. Sharon and R. Bell, "Tools that Bind: Creating Integrated Environments," IEEE Software, vol. 12, no. 2, pp. 76-85, Mar. 1995.
[27] I. Thomas, "PCTE Interfaces: Supporting Tools in Software-Engineering Environments," IEEE Software, vol. 6, no. 6, pp. 15-23, Nov. 1989.
[28] W. Tichy, "RCS—A System for Version Control," Software-Practice&Experience, July 1985, pp. 637-654.
[29] K.-P. Vo and Y.-F. Chen, "Incl: A Tool to Analyze Include Files," Proc. Summer 1992 USENIX Conf., pp. 199-208, June 1992.

Index Terms:
C++, conceptual modeling, dead code detection, program database, software repository, reachability analysis, reverse engineering, static analysis.
Citation:
Yih-Farn Chen, Emden R. Gansner, Eleftherios Koutsofios, "A C++ Data Model Supporting Reachability Analysis and Dead Code Detection," IEEE Transactions on Software Engineering, vol. 24, no. 9, pp. 682-694, Sept. 1998, doi:10.1109/32.713323
Usage of this product signifies your acceptance of the Terms of Use.