Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Free access

Slicing class hierarchies in C++

Published: 01 October 1996 Publication History

Abstract

This paper describes an algorithm for slicing class hierarchies in C++ programs. Given a C++ class hierarchy (a collection of C++ classes and inheritance relations among them) and a program P that uses the hierarchy, the algorithm eliminates from the hierarchy those data members, member functions, classes, and inheritance relations that are unnecessary for ensuring that the semantics of P is maintained.Class slicing is especially useful when the program P is generated from a larger program P' by a statement slicing algorithm. Such an algorithm eliminates statements that are irrelevant to a set of slicing criteria---program points of particular interest. There has been considerable previous work on statement slicing, and it will not be the concern of this paper. However, the combination of statement slicing and class slicing for C++ has two principal applications: First, class slicing can enhance statement slicing's utility in program debugging and understanding applications, by eliminating both executable and declarative program components irrelevant to the slicing criteria. Second, the combination of the two slicing algorithms can be used to decrease the space requirements of programs that do not use all the components of a class hierarchy. Such a situation is particularly common in programs that use class libraries.

References

[1]
ACCREDITED STANDARDS COMMITTEE X3, I. P. S. Working paper for draft proposed international standard for information systems---programming language C++. Draft of 26 september 1995.
[2]
AGESEN, O. Constraint-based type inference and parametric polymorphism. Proceedings of the First International Static Analysis Symposium (SAS'94) (September 1994), 78--I00. Springer-Verlag LNCS vol. 864.
[3]
AGESEN, O. Concrete Type Inference: Delivering Object-Oriented Applications. PhD thesis, Stanford University, December 1995. Appeared as Sun Microsystems Laboratories Technical Report SMLI TR- 96-52.
[4]
AGESEN, O., AND UNGAR, D. Sifting out the gold: Delivering compact applications from an exploratory object-oriented programming environment. In Proceedings of the Ninth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '94) (Portland, OR, 1994), pp. 355-370. SIGPLAN Notices 29(10).
[5]
AGr~WAL, H. On slicing programs with jump statements. In Proceedings of the ACM SIGPLAN'94 Conference on Programming Language Design and Implementation (Orlando, Florida, 1994), pp. 302-312. SIGPLAN Notices 29(6).
[6]
AGRAWAL, H., DEMILLO, R., AND SPAFVORD, E. Dynamic slicing in the presence of unconstrained pointers. In Proceedings of the A CM Fourth Symposium on Testing, Analysis, and Verification (TA V4) (1991), pp. 60-73. Also Purdue University technical report SERC-TR-93-P.
[7]
BACON, D. F., AND SWEENE~, P. F. Fast static analysis of C++ virtual function calls. In this proceedings.
[8]
BACON, D. F., WEGMAN, M., AND ZADECK, F. K. Rapid type inference for C++. Tech. Rep. RC 1234, IBM Thomas J. Watson Research Center, 1995.
[9]
BALL, T., AND HORWITZ, S. Slicing programs with arbitrary control-flow, in Proceedings of the First International Workshop on Automated and Algorithmic Debugging (1993), P. Fritzson, Ed., vol. 749 of Lecture Notes in Computer Science, Springer-Verlag, pp. 206- 222.
[10]
CALDER, B., AND GRUNWALD, D. Reducing indirect function call overhead in C++ programs. Conference Record of the Twenty-First A CM Symposium on Principles of Programming Languages (January 1994), 397- 408.
[11]
CARINI, P. R., HIND, M., AND SRINIVASAN, H. Flowsensitive type analysis for C++. Tech. Rep. RC 20267, IBM T.J. Watson Research Center, 1995.
[12]
Cnol, J.-D., AND FERRANTE, J. Static slicing in the presence ofgoto statements. A CM Transactions on Programming Languages and Systems 16, 4 (July 1994), 1097-1113.
[13]
DEAN, j., AND CHAMBERS, C. Optimization of objectoriented programs using static class hierarchy analysis. Tech. Rep. 94-12-01, Department of Computer Science, University of Washington at Seattle, December 1994.
[14]
ELLIS, M. A., AND STROUSTRUP, B. The Annotated C+ + Reference Manual. Addison-Wesley, 1990.
[15]
ERNST, M. Practical fine-grained static slicing of optimized code. Tech. Rep. MSR-TR-94-14, Microsoft Research, Redmond, WA, 1994.
[16]
FERNANDEZ, M. F. Simple and effective link-time optimization of modula-3 programs. Proceedings of the A CM SIGPLAN '95 Conference on Programming Language Design and Implementation (June 1995), 103- 115.
[17]
FIELD, J., RAMALINGAM, G., AND TIP, F. Parametric program slicing. In Conference Record of the Twenty- Second ACM Symposium on Principles of Programming Languages (San Francisco, CA, 1995), pp. 379- 392.
[18]
HORWITZ, S., REPS, T., AND BINKLEY, D. Interprocedural slicing using dependence graphs. ACM Transactions on Programming Languages and Systems 12, 1 (1990), 26-61.
[19]
KRISHNASWAM~, A. Program slicing: An application of object-oriented program dependency graphs. Technical report TR94-108, Dept. of Computer Science, Clemson University, 1994.
[20]
LARSEN, L., AND HARROLD, M.J. Slicing objectoriented software. In Proceedings of the 1996 International Conference on Software Engineering (ICSE-18) (Berlin, March 1996).
[21]
LIVADAS, P. E., AND CROLL, S. Program slicing. Report serc-tr-6 l-f, Computer Sciences Department, University of Florida, 1992.
[22]
PALSBERG, J., AND SCHWARTZBACH, M. I. Objectoriented type inference. Proceedings of the ACM 1991 Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA "91) (October 1991), 146-161. ACM SIGPLAN Notices 26(11).
[23]
PANDE, H. D., AND RYOER, B. G. Static type determination and aliasing for C++. Report LCSR-TR-250-A, Rutgers University, October 1995.
[24]
PLEVYAK, J., AND CHIEN, A.A. Precise concrete type inference for object-oriented languages. Proceedings of the A CA{ 1994 Conference on Object-Oriented Programming Systems, Languages, and Applications (00PSLA '94) (October 1994), 324-340. ACM SIG- PLAN Notices 29(10).
[25]
REPS, T., HORWITZ, S., SAGIV, M., AND ROSAY, G. Speeding up slicing. In Proceedings of the Second A CM SIGSOFT Conference on Foundations of Software Engineering (New Orleans, LA, December 1994), pp. 11-20.
[26]
ROSSIE, J. G., AND FRIEDMAN, D. P. An algebraic semantics of subobjects. In Proceedings of the Tenth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'95) (Austin, TX, 1995), pp. 187-199. SIGPLAN Notices 30(10).
[27]
SAKKINEN, M. A critique of the inheritance principles of C++. Computing Systems 5, I (1992), 69--I I0.
[28]
SRIVASTAVA, A. Unreachable procedures in object oriented programming. A CM Letters on Programming Languages and Systems 1, 4 (December 1992), 355- 364.
[29]
TIP, F. A survey of program slicing techniques. Journal of Programming Languages 3, 3 (1995), 121-189.
[30]
WEISER, M. Program slices: formal, psychological, and practical investigations of an automatic program abstraction method. Phi) thesis, University of Michigan, Ann Arbor, 1979.

Cited By

View all
  • (2018)Schema Slicing Methods to Reduce Development Costs of WSDL-Based Web Services2018 IEEE International Conference on Web Services (ICWS)10.1109/ICWS.2018.00049(310-314)Online publication date: Jul-2018
  • (2015)Measuring the Superfluous Functionality in Software ComponentsProceedings of the 18th International ACM SIGSOFT Symposium on Component-Based Software Engineering10.1145/2737166.2737180(11-20)Online publication date: 4-May-2015
  • (2009)A Novel Algorithm for Construction Control Dependence SubgraphProceedings of the 2009 International Conference on Multimedia Information Networking and Security - Volume 0110.1109/MINES.2009.156(158-162)Online publication date: 18-Nov-2009
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 1996
Published in SIGPLAN Volume 31, Issue 10

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)95
  • Downloads (Last 6 weeks)9
Reflects downloads up to 03 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2018)Schema Slicing Methods to Reduce Development Costs of WSDL-Based Web Services2018 IEEE International Conference on Web Services (ICWS)10.1109/ICWS.2018.00049(310-314)Online publication date: Jul-2018
  • (2015)Measuring the Superfluous Functionality in Software ComponentsProceedings of the 18th International ACM SIGSOFT Symposium on Component-Based Software Engineering10.1145/2737166.2737180(11-20)Online publication date: 4-May-2015
  • (2009)A Novel Algorithm for Construction Control Dependence SubgraphProceedings of the 2009 International Conference on Multimedia Information Networking and Security - Volume 0110.1109/MINES.2009.156(158-162)Online publication date: 18-Nov-2009
  • (2007)Forward slicing of functional logic programs by partial evaluationTheory and Practice of Logic Programming10.5555/1230960.12309687:1-2(215-247)Online publication date: 1-Jan-2007
  • (2007)Forward slicing of functional logic programs by partial evaluationTheory and Practice of Logic Programming10.1017/S14710684060028707:1-2(215-247)Online publication date: 1-Jan-2007
  • (2006)A model for structuring user documentation of object-oriented frameworks using patterns and hypertextECOOP'97 — Object-Oriented Programming10.1007/BFb0053392(496-510)Online publication date: 23-May-2006
  • (2002)An overview of program slicingSoftware Focus10.1002/swf.412:3(85-92)Online publication date: 25-Jan-2002
  • (1999)Practical experience with an application extractor for JavaACM SIGPLAN Notices10.1145/320385.32041434:10(292-305)Online publication date: 1-Oct-1999
  • (1999)Practical experience with an application extractor for JavaProceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications10.1145/320384.320414(292-305)Online publication date: 1-Oct-1999
  • (1999)Using program slicing to assist in the detection of equivalent mutantsSoftware Testing, Verification and Reliability10.1002/(SICI)1099-1689(199912)9:4<233::AID-STVR191>3.0.CO;2-39:4(233-262)Online publication date: Dec-1999
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media