skip to main content
10.1145/2642937.2642994acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article

Search-based inference of polynomial metamorphic relations

Published: 15 September 2014 Publication History

Abstract

Metamorphic testing (MT) is an effective methodology for testing those so-called ``non-testable'' programs (e.g., scientific programs), where it is sometimes very difficult for testers to know whether the outputs are correct. In metamorphic testing, metamorphic relations (MRs) (which specify how particular changes to the input of the program under test would change the output) play an essential role. However, testers may typically have to obtain MRs manually.
In this paper, we propose a search-based approach to automatic inference of polynomial MRs for a program under test. In particular, we use a set of parameters to represent a particular class of MRs, which we refer to as polynomial MRs, and turn the problem of inferring MRs into a problem of searching for suitable values of the parameters. We then dynamically analyze multiple executions of the program, and use particle swarm optimization to solve the search problem. To improve the quality of inferred MRs, we further use MR filtering to remove some inferred MRs.
We also conducted three empirical studies to evaluate our approach using four scientific libraries (including 189 scientific functions). From our empirical results, our approach is able to infer many high-quality MRs in acceptable time (i.e., from 9.87 seconds to 1231.16 seconds), which are effective in detecting faults with no false detection.

References

[1]
E. Alba and F. Chicano. Management of software projects with gas. In Proc. MIC, pages 13--18, 2005.
[2]
J. H. Andrews, L. C. Briand, and Y. Labiche. Is mutation an appropriate tool for testing experiments? In Proc. ICSE, pages 402--411, 2005.
[3]
J. H. Andrews, T. Menzies, and F. C. Li. Genetic algorithms for randomized unit testing. IEEE Transactions on Software Engineering, 37(1):80--94, 2011.
[4]
A. Baars, M. Harman, Y. Hassoun, K. Lakhotia, P. McMinn, P. Tonella, and T. Vos. Symbolic search-based testing. In Proc. ASE, pages 53--62, 2011.
[5]
E. T. Barr, T. Vo, V. Le, and Z. Su. Automatic detection of floating-point exceptions. In Proc. POPL, pages 549--560, 2013.
[6]
S. Bensalem, M. Bozga, B. Boyer, and A. Legay. Incremental generation of linear invariants for component-based systems. In Proc. ACSD, pages 80--89, 2013.
[7]
F. Benz, A. Hildebrandt, and S. Hack. A dynamic program analysis to find floating-point accuracy problems. In Proc. PLDI, pages 453--462, 2012.
[8]
A. Bertolino. Software testing research: Achievements, challenges, dreams. In Proc. FOSE, pages 85--103, 2007.
[9]
J. Cabot, R. Clarisó, E. Guerra, and J. De Lara. An invariant-based method for the analysis of declarative model-to-model transformations. In Proc. MODELS, pages 37--52, 2008.
[10]
G. Canfora and M. Di Penta. New frontiers of reverse engineering. In Proc. FOSE, pages 326--341, 2007.
[11]
T. Y. Chen, S. C. Cheung, and S. M. Yiu. Metamorphic testing: A new approach for generating next test cases. Technical Report HKUST-CS98-01, Hong Kong University of Science and Technology, 1998.
[12]
T. Y. Chen, J. Feng, and T. H. Tse. Metamorphic testing of programs on partial differential equations: A case study. In Proc. COMPSAC, pages 327--333, 2002.
[13]
T. Y. Chen, D. H. Huang, T. H. Tse, and Z. Q. Zhou. Case studies on the selection of useful relations in metamorphic testing. In Proc. JIISIC, pages 569--583, 2004.
[14]
T. Y. Chen, F.-C. Kuo, T. H. Tse, and Z. Q. Zhou. Metamorphic testing and beyond. In Proc. STEP, pages 94--100, 2003.
[15]
T. Y. Chen, T. H. Tse, and Z. Q. Zhou. Fault-based testing without the need of oracles. Information and Software Technology, 45(1):1--9, 2003.
[16]
C. Csallner, N. Tillmann, and Y. Smaragdakis. Dysy: Dynamic symbolic execution for invariant inference. In Proc. ICSE, pages 281--290, 2008.
[17]
E. Di Nitto, M. Di Penta, A. Gambi, G. Ripa, and M. L. Villani. Negotiation of service level agreements: An architecture and a search-based approach. In Proc. ICSOC, pages 295--306, 2007.
[18]
M. Di Penta, M. Harman, and G. Antoniol. The use of search-based optimization techniques to schedule and staff software projects: An approach and an empirical study. Software: Practice and Experience, 41(5):495--519, 2011.
[19]
J. J. Dolado. A validation of the component-based method for software size estimation. IEEE Transactions on Software Engineering, 26(10):1006--1021, 2000.
[20]
M. D. Ernst. Dynamically discovering likely program invariants. PhD thesis, University of Washington, 2000.
[21]
M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz, and C. Xiao. The Daikon system for dynamic detection of likely invariants. Science of Computer Programming, 69(1):35--45, 2007.
[22]
I. M. Gelfand and M. Saul. Trigonometry. Springer, 2001.
[23]
P. Godefroid and J. Kinder. Proving memory safety of floating-point computations by combining static and dynamic program analysis. In Proc. ISSTA, pages 1--12, 2010.
[24]
F. Gross, G. Fraser, and A. Zeller. Search-based system testing: high coverage, no false alarms. In Proc. ISSTA, pages 67--77, 2012.
[25]
M. Harman. The current state and future of search based software engineering. In Proc. FOSE, pages 342--357, 2007.
[26]
M. Harman and B. F. Jones. Search-based software engineering. Information and Software Technology, 43(14):833--839, 2001.
[27]
M. Harman, J. Krinke, J. Ren, and S. Yoo. Search based data sensitivity analysis applied to requirement engineering. In Proc. GECCO, pages 1681--1688, 2009.
[28]
M. Harman, P. McMinn, M. Shahbaz, and S. Yoo. A comprehensive survey of trends in oracles for software testing. Technical Report CS-13-01, University of Shefield, 2013.
[29]
M. Harman and L. Tratt. Pareto optimal search based refactoring at the design level. In Proc. GECCO, pages 1106--1113, 2007.
[30]
S. Hayashi, Y. Tsuda, and M. Saeki. Search-based refactoring detection from source code revisions. IEICE Transactions on Information and Systems, 93(4):754--762, 2010.
[31]
S. Huang, M. B. Cohen, and A. M. Memon. Repairing GUI test suites using a genetic algorithm. In Proc. ICST, pages 245--254, 2010.
[32]
G. Jiang, H. Chen, and K. Yoshihira. Discovering likely invariants of distributed transaction systems for autonomic system management. In Proc. ICAC, pages 199--208, 2006.
[33]
U. Kanewala and J. M. Bieman. Using machine learning techniques to detect metamorphic relations for program without test oracles. In Proc. ISSRE, pages 1--10, 2013.
[34]
J. Kennedy and R. C. Eberhart. Particle swarm optimization. In Encyclopedia of Machine Learning, pages 1942--1948, 1995.
[35]
I. Krka, Y. Brun, D. Popescu, J. Garcia, and N. Medvidovic. Using dynamic execution traces and program invariants to enhance behavioral model inference. In Proc. ICSE, pages 179--182, 2010.
[36]
J. J. Liang, A. K. Qin, P. N. Suganthan, and S. Baskar. Comprehensive learning particle swarm optimizer for global optimization of multimodal functions. IEEE Transactions on Evolutionary Computation, 10(3):281--295, 2006.
[37]
W. Lin, M. Wu, Z. Yang, and Z. Zeng. Exact safety verification of hybrid systems using sums-of-squares representation. Science China Information Sciences, 57(5):1--13, 2014.
[38]
H. Liu, X. Liu, and T. Y. Chen. A new method for constructing metamorphic relations. In Proc. QSIC, pages 59--68, 2012.
[39]
M. T. Llano, A. Ireland, and A. Pease. Discovery of invariants through automated theory formation. Formal Aspects of Computing, 26(2):203--249, 2014.
[40]
D. Lo and S. Maoz. Mining scenario-based specifications with value-based invariants. In Proc. OOPSLA, pages 755--756, 2009.
[41]
R. E. Lopez-Herrejon and A. Egyed. Sbse4vm: Search based software engineering for variability management. In Proc. CSMR, pages 441--444, 2013.
[42]
M. Z. Malik, A. Pervaiz, and S. Khurshid. Generating representation invariants of structurally complex data. In Proc. TACAS, pages 34--49, 2007.
[43]
N. Mansour, R. Bahsoon, and G. Baradhi. Empirical comparison of regression test selection algorithms. Journal of Systems and Software, 57(1):79--90, 2001.
[44]
J. Mayer and R. Guderlei. An empirical study on the selection of good metamorphic relations. In Proc. COMPSAC, pages 475--484, 2006.
[45]
J. Mayer and R. Guderlei. An empirical study on the selection of good metamorphic relations. In Proc. COMPSAC, pages 475--484, 2006.
[46]
H. Mei, D. Hao, L. Zhang, L. Zhang, J. Zhou, and G. Rothermel. A static approach to prioritizing junit test cases. IEEE Transactions on Software Engineering, 38(6):1258--1275, 2012.
[47]
C. Murphy. Metamorphic testing techniques to detect defects in applications without test oracles. PhD thesis, Columbia University, 2010.
[48]
C. Murphy, K. Shen, and G. Kaiser. Automatic system testing of programs without test oracles. In Proc. ISSTA, pages 189--200, 2009.
[49]
T. Nguyen, D. Kapur, W. Weimer, and S. Forrest. Using dynamic analysis to discover polynomial and array invariants. In Proc. ICSE, pages 683--693, 2012.
[50]
T. Nguyen, D. Kapur, W. Weimer, and S. Forrest. Using dynamic analysis to generate disjunctive invariants. In Proc. ICSE, pages 608--619, 2014.
[51]
N. Pan, F. Zeng, and Y.-H. Huang. Test case reduction based on program invariant and genetic algorithm. In Proc. WiCOM, pages 1--5, 2010.
[52]
C. S. Pasareanu and W. Visser. Verification of java programs using symbolic execution and invariant generation. In Proc. SPIN, pages 164--181, 2004.
[53]
Y. Pavlov and G. Fraser. Semi-automatic search-based test generation. In Proc. ICST, pages 777--784, 2012.
[54]
R. Poli, J. Kennedy, and T. Blackwell. Particle swarm optimization. Swarm Intelligence, 1(1):33--57, 2007.
[55]
F. Qayum and R. Heckel. Search-based refactoring using unfolding of graph transformation systems. Electronic Communications of the EASST, 38, 2011.
[56]
D. Romano, M. Di Penta, and G. Antoniol. An approach for search based testing of null pointer exceptions. In Proc. ICST, pages 160--169, 2011.
[57]
C. Ryan. Automatic re-engineering of software using genetic programming, volume 2. Springer, 2000.
[58]
S. Segura, R. M. Hierons, D. Benavides, and A. Ruiz-Cortés. Automated test data generation on the analyses of feature models: a metamorphic testing approach. In Proc. ICST, pages 35--44, 2010.
[59]
S. Segura, R. M. Hierons, D. Benavides, and A. Ruiz-Cortés. Automated metamorphic testing on the analyses of feature models. Information and Software Technology, 53(3):245--258, 2011.
[60]
Y. Shi and R. C. Eberhart. Empirical study of particle swarm optimization. In Proc. CEC, pages 1945--1950, 1999.
[61]
Y. Shi, H. Liu, L. Gao, and G. Zhang. Cellular particle swarm optimization. Information Sciences, 181(20):4460--4493, 2011.
[62]
B. H. Smith and L. Williams. On guiding the augmentation of an automated test suite via mutation analysis. Empirical Software Engineering, 14(3):341--369, 2009.
[63]
E. Tang, E. Barr, X. Li, and Z. Su. Perturbing numerical calculations for statistical analysis of floating-point program (in)stability. In Proc. ISSTA, pages 131--142, 2010.
[64]
P. Tonella, A. Susi, and F. Palma. Interactive requirements prioritization using a genetic algorithm. Information and Software Technology, 55(1):173--187, 2013.
[65]
S. Wang, D. Lo, L. Jiang, and H. C. Lau. Search-based fault localization. In Proc. ASE, pages 556--559, 2011.
[66]
E. J. Weyuker. On testing non-testable programs. The Computer Journal, 25(4):465--470, 1982.
[67]
A. Windisch, S. Wappler, and J. Wegener. Applying particle swarm optimization to software testing. In Proc. GECCO, pages 1121--1128, 2007.
[68]
W.K.Chan, S.C.Cheung, and K. R.P.H.Leung. Towards a metamorphic testing methodology for service-oriented software applications. In Proc. QSIC, pages 470--476, 2005.
[69]
W. E. Wong, J. R. Horgan, S. London, and H. Agrawal. A study of effective regression testing in practice. In Proc. ISSRE, pages 264--274, 1997.
[70]
P. Wu. Iterative metamorphic testing. In Proc. COMPSAC, pages 19--24, 2005.
[71]
X. Xie, J. Ho, C. Murphy, G. Kaiser, B. Xu, and T. Y. Chen. Application of metamorphic testing to supervised classifiers. In Proc. QSIC, pages 135--144, 2009.
[72]
Z. Xu, M. B. Cohen, and G. Rothermel. Factors affecting the use of genetic algorithms in test suite augmentation. In Proc. GECCO, pages 1365--1372, 2010.
[73]
J. Yang, D. Evans, D. Bhardwaj, T. Bhat, and M. Das. Perracotta: mining temporal API rules from imperfect traces. In Proc. of ICSE, pages 282--291, 2006.
[74]
S. Yoo, M. Harman, and S. Ur. GPGPU test suite minimisation: search based software engineering performance improvement using graphics cards. Empirical Software Engineering, 18(3):550--593, 2013.
[75]
Y. Yuan, Z. Fanping, Z. Guanmiao, D. Chaoqiang, and X. Neng. Test case generation based on program invariant and adaptive random algorithm. In Proc. CSE, pages 274--282, 2011.
[76]
A. Zeller. Search-based program analysis. In Proc. SSBSE, pages 1--4, 2011.
[77]
L. Zhang, D. Hao, L. Zhang, G. Rothermel, and H. Mei. Bridging the gap between the total and additional test-case prioritization strategies. In Proc. ICSE, pages 192--201. IEEE, 2013.
[78]
L. Zhang, D. Marinov, L. Zhang, and S. Khurshid. Regression mutation testing. In Proc. ISSTA, pages 331--341, 2012.
[79]
L. Zhang, G. Yang, N. Rungta, S. Person, and S. Khurshid. Feedback-driven dynamic invariant discovery. In Proc. ISSTA, pages 362--372, 2014.
[80]
J. Zhao, C. Han, and B. Wei. Binary particle swarm optimization with multiple evolutionary strategies. Science China Information Sciences, 55(11):2485--2494, 2012.
[81]
H. Zhong, T. Xie, L. Zhang, J. Pei, and H. Mei. MAPO: Mining and recommending API usage patterns. In Proc. of ECOOP, pages 318--343, 2009.
[82]
H. Zhong, L. Zhang, T. Xie, and H. Mei. Inferring resource specifications from natural language API documentation. In Proc. of ASE, pages 307--318, 2009.
[83]
Z. Q. Zhou, D. H. Huang, T. H. Tse, Z. Yang, H. Huang, and T. Y. Chen. Metamorphic testing and its applications. In Proc. ISFST, pages 346--351, 2004.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ASE '14: Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering
September 2014
934 pages
ISBN:9781450330138
DOI:10.1145/2642937
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 15 September 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. invariant inference
  2. metamorphic testing
  3. particle swarm optimization

Qualifiers

  • Research-article

Funding Sources

Conference

ASE '14
Sponsor:

Acceptance Rates

ASE '14 Paper Acceptance Rate 82 of 337 submissions, 24%;
Overall Acceptance Rate 82 of 337 submissions, 24%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)56
  • Downloads (Last 6 weeks)3
Reflects downloads up to 15 Sep 2024

Other Metrics

Citations

Cited By

View all

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media