This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Fragment Class Analysis for Testing of Polymorphism in Java Software
June 2004 (vol. 30 no. 6)
pp. 372-387
Atanas Rountev, IEEE Computer Society
Ana Milanova, IEEE Computer Society
Barbara G. Ryder, IEEE Computer Society

Abstract—Testing of polymorphism in object-oriented software may require coverage of all possible bindings of receiver classes and target methods at call sites. Tools that measure this coverage need to use class analysis to compute the coverage requirements. However, traditional whole-program class analysis cannot be used when testing incomplete programs. To solve this problem, we present a general approach for adapting whole-program class analyses to operate on program fragments. Furthermore, since analysis precision is critical for coverage tools, we provide precision measurements for several analyses by determining which of the computed coverage requirements are actually feasible for a set of subject components. Our work enables the use of whole-program class analyses for testing of polymorphism in partial programs, and identifies analyses that potentially are good candidates for use in coverage tools.

[1] R. Binder, Testing Object-Oriented Software: A Survey J. Software Testing, Verification and Reliability, vol. 6, pp. 125-252, Dec. 1996.
[2] M. Fowler, Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
[3] R. Binder, Testing Object-Oriented Systems: Models, Patterns, and Tools. Addison-Wesley, 1999.
[4] D. Perry and G. Kaiser, Adequate Testing and Object-Oriented Programming J. Object-Oriented Programming, vol. 2, no. 5, pp. 13-19, Jan. 1990.
[5] B. Cox, The Need for Specification and Testing Languages J. Object-Oriented Programming vol. 1, no. 2, pp. 44-47, June 1988.
[6] N.N. Thuy, Testability and Unit Tests in Large Object-Oriented Software Proc. Fifth Int'l Software Quality Week, 1992.
[7] R. McDaniel and J. McGregor, Testing the Polymorphic Interactions between Classes Technical Report 94-103, Clemson Univ., Mar. 1994.
[8] T. McCabe, L. Dreyer, A. Dunn, and A. Watson, Testing an Object-Oriented Application J. Quality Assurance Inst., vol. 8, no. 4, pp. 21-27, Oct. 1994.
[9] J. Overbeck, Integration Testing for Object-Oriented Software PhD dissertation, Vienna Univ. of Tech nology, 1994.
[10] M.H. Chen and M.H. Kao, Testing Object-Oriented Programs An Integrated Approach Proc. Int'l Symp. Software Reliability Eng., pp. 73-83, 1999.
[11] R. Alexander and J. Offutt, Criteria for Testing Polymorphic Relationships Proc. Int'l Symp. Software Reliability Eng., pp. 15-23, 2000.
[12] R. Alexander, Testing the Polymorphic Relationships of Object-Oriented Programs PhD dissertation, George Mason Univ., 2001.
[13] H. Zhu, P. Hall, and J. May, Software Unit Testing Coverage and Adequacy ACM Computing Surveys, vol. 29, no. 4, pp. 366-427, Dec. 1997.
[14] D. Bacon and P. Sweeney, Fast Static Analysis of C++ Virtual Function Calls Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 324-341, 1996.
[15] D. Grove, G. DeFouw, J. Dean, and C. Chambers, Call Graph Construction In Object-Oriented Languages Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 108-124, 1997.
[16] V. Sundaresan, L. Hendren, C. Razafimahefa, R. Vallee-Rai, P. Lam, E. Gagnon, and C. Godin, Practical Virtual Method Call Resolution for Java Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 264-280, 2000.
[17] A. Rountev, A. Milanova, and B.G. Ryder, Points-To Analysis for Java Using Annotated Constraints Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 43-55, Oct. 2001.
[18] A. Milanova, A. Rountev, and B.G. Ryder, Parameterized Object Sensitivity for Points-To and Side-Effect Analyses for Java Proc. Int'l Symp. Software Testing and Analysis, pp. 1-11, 2002.
[19] J. Palsberg and M. Schwartzbach, Object-Oriented Type Inference Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 146-161, 1991.
[20] O. Agesen, The Cartesian Product Algorithm Proc. European Conf. Object-Oriented Programming, pp. 2-26, 1995.
[21] J. Plevyak and A. Chien, Precise Concrete Type Inference for Object-Oriented Languages Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 324-340, 1994.
[22] G. DeFouw, D. Grove, and C. Chambers, Fast Interprocedural Class Analysis Proc. Symp. Principles of Programming Languages, pp. 222-236, 1998.
[23] R. Chatterjee, B.G. Ryder, and W. Landi, Relevant Context Inference Proc. Symp. Principles of Programming Languages, pp. 133-146, 1999.
[24] C. Razafimahefa, A Study of Side-Effect Analyses for Java master's thesis, McGill Univ., Dec. 1999.
[25] E. Ruf, Effective Synchronization Removal for Java Proc. Conf. Programming Language Design and Implementation, pp. 208-218, 2000.
[26] M. Streckenbach and G. Snelting, Points-To for Java: A General Framework and an Empirical Comparison technical report, Univ. Passau, Sept. 2000.
[27] F. Tip and J. Palsberg, Scalable Propagation-Based Call Graph Construction Algorithms Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 281-293, 2000.
[28] D. Liang, M. Pennings, and M.J. Harrold, Extending and Evaluating Flow-Insensitive and Context-Insensitive Points-To Analyses for Java Proc. Workshop Program Analysis for Software Tools and Eng., pp. 73-79, 2001.
[29] D. Grove and C. Chambers, A Framework for Call Graph Construction Algorithms ACM Trans. Programming Languages and Systems, vol. 23, no. 6, pp. 685-746, Nov. 2001.
[30] J. Whaley and M. Lam, An Efficient Inclusion-Based Points-To Analysis for Strictly-Typed Languages Proc. Static Analysis Symp., 2002.
[31] O. Lhoták and L. Hendren, Scaling Java Points-To Analysis Using Spark Proc. Int'l Conf. Compiler Construction, pp. 153-169, 2003.
[32] J. Dean, D. Grove, and C. Chambers, Optimizations of Object-Oriented Programs Using Static Class Hierarchy Analysis Proc. European Conf. Object-Oriented Programming, pp. 77-101, 1995.
[33] O. Shivers, Control-Flow Analysis of Higher-Order Languages PhD dissertation, Carnegie Mellon Univ. 1991.
[34] L. Andersen, Program Analysis and Specialization for the C Programming Language PhD dissertation, DIKU, Univ. of Copenhagen 1994.
[35] J. Gosling, B. Joy, G. Steele, and G. Bracha, The Java Language Specification, second ed. Addison-Wesley, 2000.
[36] A. Rountev, Dataflow Analysis of Software Fragments PhD dissertation, Rutgers Univ., Aug. 2002, available as Techical Report DCS-TR-501.
[37] A. Rountev, A. Milanova, and B.G. Ryder, Fragment Class Analysis for Testing of Polymorphism in Java Software Technical Report OSU-CISRC-1/04-TR04, Dept. of Computer Science and Eng., Ohio State Univ., Jan. 2004.
[38] N.E. Fenton, S. Lawrence Pfleeger, and R. Glass, “Science and Substance: A Challenge to Software Engineers,” IEEE Software, vol. 11, no. 4, pp. 86–95, July 1994.
[39] S. Siegel and N.J. Castellan, Nonparametric Statistics for the Behavioral Sciences, second ed. McGraw-Hill 1988.
[40] C. Wohlin, P. Runeson, M. Höst, M. Ohlsson, B. Regnell, and A. Wesslén, Experimentation in Software Engineering: An Introduction. Kluwer Academic, 2000.
[41] R. Chatterjee and B.G. Ryder, Data-Flow-Based Testing of Object-Oriented Libraries Technical Report DCS-TR-433, Rutgers Univ., Apr. 2001.
[42] F. Tip, P. Sweeney, C. Laffra, A. Eisma, and D. Streeter, Practical Extraction Techniques for Java ACM Trans. Programming Languages and Systems, vol. 24, no. 6, pp. 625-666, 2002.
[43] P. Sweeney and F. Tip, Extracting Library-Based Object-Oriented Applications Proc. Symp. Foundations of Software Eng., pp. 98-107, 2000.
[44] M.J. Harrold and G. Rothermel, Performing Data Flow Testing on Classes Proc. Symp. Foundations of Software Eng., pp. 154-163, 1994.
[45] M. Mock, M. Das, C. Chambers, and S. Eggers, Dynamic Points-To Sets Proc. Workshop Program Analysis for Software Tools and Eng., pp. 66-72, 2001.
[46] D. Liang, M. Pennings, and M.J. Harrold, Evaluating the Precision of Static Reference Analysis Using Profiling Proc. Int'l Symp. Software Testing and Analysis, pp. 22-32, 2002.

Index Terms:
Program analysis, class analysis, test coverage, object-oriented software.
Citation:
Atanas Rountev, Ana Milanova, Barbara G. Ryder, "Fragment Class Analysis for Testing of Polymorphism in Java Software," IEEE Transactions on Software Engineering, vol. 30, no. 6, pp. 372-387, June 2004, doi:10.1109/TSE.2004.20
Usage of this product signifies your acceptance of the Terms of Use.