ABSTRACT
An objective of unit testing is to achieve high structural coverage of the code under test. Achieving high structural overage of object-oriented code requires desirable method-call sequences that create and mutate objects. These sequences help generate target object states such as argument or receiver object states (in short as target states) of a method under test. Automatic generation of sequences for achieving target states is often challenging due to a large search space of possible sequences. On the other hand, code bases using object types (such as receiver or argument object types) include sequences that can be used to assist automatic test-generation approaches in achieving target states. In this paper, we propose a novel approach, called MSeqGen, that mines code bases and extracts sequences related to receiver or argument object types of a method under test. Our approach uses these extracted sequences to enhance two state-of-the-art test-generation approaches: random testing and dynamic symbolic execution. We conduct two evaluations to show the effectiveness of our approach. Using sequences extracted by our approach, we show that a random testing approach achieves 8.7% (with a maximum of 20.0% for one namespace) higher branch coverage and a dynamic-symbolic-execution-based approach achieves 17.4% (with a maximum of 22.5% for one namespace) higher branch coverage than without using our approach. Such an improvement is significant as the branches that are not covered by these state-of-the-art approaches are generally quite difficult to cover.
- M. Acharya, T. Xie, and J. Xu. Mining Interface Specifications for Generating Checkable Robustness Properties. In Proc. ISSRE, pages 311--320, 2006. Google ScholarDigital Library
- R. Agrawal and R. Srikant. Fast algorithms for mining association rules in large databases. In Proc. VLDB, pages 487--499, 1994. Google ScholarDigital Library
- L. Clarke. A System to Generate Test Data and Symbolically Execute Programs. IEEE Trans. Softw. Eng., 2(3):215--222, 1976. Google ScholarDigital Library
- T. H. Cormen, C. Stein, R. L. Rivest, and C. E. Leiserson. Introduction to Algorithms. McGraw-Hill Higher Education, 2001. Google ScholarDigital Library
- C. Csallner and Y. Smaragdakis. JCrasher: an automatic robustness tester for Java. Softw. Pract. Exper., 34(11):1025--1050, 2004. Google ScholarDigital Library
- J. Duran and M. Ntafos. An evaluation of random testing. IEEE Trans. Softw. Eng., 10(4):438--444, 1984.Google ScholarDigital Library
- S. Elbaum, H. N. Chin, M. B. Dwyer, and J. Dokulil. Carving differential unit test cases from system test cases. In Proc. FSE, pages 253--264, 2006. Google ScholarDigital Library
- D. Engler, D. Y. Chen, S. Hallem, A. Chou, and B. Chelf. Bugs as deviant behavior: a general approach to inferring errors in systems code. In Proc. SOSP, pages 57--72, 2001. Google ScholarDigital Library
- Facebook developer toolkit, 2008. http://www.codeplex.com/FacebookToolkit.Google Scholar
- P. Godefroid, N. Klarlund, and K. Sen. DART: Directed automated random testing. In Proc. PLDI, pages 213--223, 2005. Google ScholarDigital Library
- K. Inkumsah and T. Xie. Improving structural testing of object-oriented programs via integrating evolutionary testing and symbolic execution. In Proc. ASE, pages 297--306, 2008. Google ScholarDigital Library
- Parasoft. Jtest manuals version 5.1. Online manual, 2006. http://www.parasoft.com.Google Scholar
- S. Khurshid, C. S. Pasareanu, and W. Visser. Generalized symbolic execution for model checking and testing. In Proc. TACAS, pages 553--568, 2003. Google ScholarDigital Library
- J. C. King. Symbolic Execution and Program Testing. Communications of the ACM, 19(7):385--394, 1976. Google ScholarDigital Library
- S. Koushik, M. Darko, and A. Gul. CUTE: a concolic unit testing engine for C. In Proc. ESEC/FSE, pages 263--272, 2005. Google ScholarDigital Library
- X. Liu, H. Liu, B. Wang, P. Chen, and X. Cai. A unified fitness function calculation rule for flag conditions to improve evolutionary testing. In Proc. ASE, pages 337--341, 2005. Google ScholarDigital Library
- A. Orso and B. Kennedy. Selective capture and replay of program executions. SIGSOFT Softw. Eng. Notes, 30(4):1--7, 2005. Google ScholarDigital Library
- C. Pacheco and M. D. Ernst. Eclat: Automatic generation and classification of test inputs. In Proc. ECOOP, pages 504--527, 2005. Google ScholarDigital Library
- C. Pacheco, S. K. Lahiri, M. D. Ernst, and T. Ball. Feedback-directed random test generation. In Proc. ICSE, pages 75--84, 2007. Google ScholarDigital Library
- QuickGraph: A 100% C# graph library with Graphviz Support, Version 2.0, 2008. http://www.codeproject.com/KB/miscctrl/quickgraph.aspx.Google Scholar
- D. Saff, S. Artzi, J. H. Perkins, and M. D. Ernst. Automatic test factoring for Java. In Proc. ASE, pages 114--123, 2005. Google ScholarDigital Library
- Y. Song, S. Thummalapenta, and T. Xie. UnitPlus: Assisting developer testing in eclipse. In Proc. ETX, pages 26--30, 2007. Google ScholarDigital Library
- S. Thummalapenta and T. Xie. PARSEWeb: A programmer assistant for reusing open source code on the web. In Proc. ASE, pages 204--213, 2007. Google ScholarDigital Library
- S. Thummalapenta and T. Xie. Mining exception-handling rules as sequence association rules. In Proc. ICSE, pages 496--506, 2009. Google ScholarDigital Library
- N. Tillmann and J. de Halleux. Pex white box test generation for .NET. In Proc. TAP, pages 134--153, 2008. Google ScholarDigital Library
- N. Tillmann and W. Schulte. Parameterized Unit Tests. In Proc. ESEC/FSE, pages 253--262, 2005. Google ScholarDigital Library
- P. Tonella. Evolutionary testing of classes. In Proc. ISSTA, pages 119--128, 2004. Google ScholarDigital Library
- J. Wang and J. Han. BIDE: Efficient mining of frequent closed sequences. In Proc. ICDE, pages 79--88, 2004. Google ScholarDigital Library
- A. Wasylkowski, A. Zeller, and C. Lindig. Detecting object usage anomalies. In Proc. ESEC/FSE, pages 35--44, 2007. Google ScholarDigital Library
- T. Xie, D. Marinov, and D. Notkin. Rostra: A framework for detecting redundant object-oriented unit tests. In Proc. ASE, pages 196--205, 2004. Google ScholarDigital Library
Index Terms
- MSeqGen: object-oriented unit-test generation via mining source code
Recommendations
Systematic Extraction of Tests from Object-Oriented Programs
Fundamentals of Software EngineeringAbstractExisting program-based automated test techniques from object-oriented programs generate only test data or test cases, which are not equipped with effective oracle to reveal the logical errors in the program. In addition, these techniques often ...
From genetic to bacteriological algorithms for mutation-based testing: Research Articles
The level of confidence in a software component is often linked to the quality of its test cases. This quality can in turn be evaluated with mutation analysis: faults are injected into the software component (making mutants of it) to check the ...
Using evolutionary algorithms for the unit testing of object-oriented software
GECCO '05: Proceedings of the 7th annual conference on Genetic and evolutionary computationAs the paradigm of object orientation becomes more and more important for modern IT development projects, the demand for an automated test case generation to dynamically test object-oriented software increases. While search-based test case generation ...
Comments