Abstract
In this paper, we discuss how a search-based branch coverage approach can be used to design an effective test data generation approach, specifically targeting divide-by-zero exceptions. We first propose a novel testability transformation combining approach level and branch distance. We then use different search strategies, i.e. hill climbing, simulated annealing, and genetic algorithm, to evaluate the performance of the novel testability transformation on a small synthetic example as well as on methods known to throw divide-by-zero exceptions, extracted from real world systems, namely Eclipse and Android. Finally, we also describe how the test data generation for divide-by-zero exceptions can be formulated as a constraint programming problem and compare the resolution of this problem with a genetic algorithm in terms of execution time. We thus report evidence that genetic algorithm using our novel testability transformation out-performs hill climbing and simulated annealing and a previous approach (in terms of numbers of fitness evaluation) but is out-performed by constraint programming (in terms of execution time).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Baresel, A.: Automatisierung von strukturtests mit evolutionren algorithmen. Diploma Thesis, Humboldt University, Berlin, Germany (2000)
Baresel, A., Sthamer, H., Schmidt, M.: Fitness function design to improve evolutionary structural testing. In: Proceedings of the Genetic and Evolutionary Computation Conference, pp. 1329–1336 (July 2002)
Chatterjee, R., Ryder, B.G.: Data-flow-based testing of object-oriented libraries. Tech. Rep. DCS-TR-382, Department of Computer Science, Rutgers University (1999)
Cohen, J.: Statistical power analysis for the behavioral sciences, 2nd edn. Lawrence Earlbaum Associates, Hillsdale (1988)
Romano, D., Massimiliano Di Penta, G.A.: An approach for search based testing of null pointer exceptions. In: Proceedings of the Fourth International Conference on Software Testing, Verification and Validation, pp. 160–169 (March 2011)
Harman, M., Baresel, A., Binkley, D., Hierons, R.M., Hu, L., Korel, B., McMinn, P., Roper, M.: Testability transformation – program transformation to improve testability. In: Hierons, R.M., Bowen, J.P., Harman, M. (eds.) FORTEST. LNCS, vol. 4949, pp. 320–344. Springer, Heidelberg (2008)
Jo, J.W., Chang, B.M., Yi, K., Choe, K.M.: An uncaught exception analysis for java. Journal of System Software 72, 59–69 (2004), http://portal.acm.org/citation.cfm?id=1005486.1005491
Joachim Wegener, A.B., Sthamer, H.: Evolutionary test environment for automatic structural testing. Information and Software Technology 43(14), 841–854 (2001)
Jones, B., Sthamer, H., Eyres, D.: Automatic structural testing using genetic algorithms. Software Engineering Journal 11(5), 299–306 (1996)
Korel, B.: Dynamic method of software test data generation. Softw. Test, Verif. Reliab. 2(4), 203–213 (1992)
McMinn, P.: Search-based software test data generation: a survey. Software Testing Verification and Reliability 14(2), 105–156 (2004)
Miller, W., Spooner, D.L.: Automatic generation of floating-point test data. IEEE Transactions on Software Engineering 2(3), 223–226 (1976)
Mresa, E.S., Bottaci, L.: Efficiency of mutation operators and selective mutation strategies: An empirical study. Software Testing Verification and Reliability 9(4), 205–232 (1999)
Pressman, R.S.: Software Engineering: A Practitioner’s Approach, 3rd edn. McGraw-Hill, New York (1992)
Ryder, B.G., Smith, D.E., Kremer, U., Gordon, M.D., Shah, N.: A static study of java exceptions using JESP. In: Watt, D.A. (ed.) CC 2000. LNCS, vol. 1781, pp. 67–81. Springer, Heidelberg (2000), http://portal.acm.org/citation.cfm?id=647476.727763
Sakti, A., Guéhéneuc, Y.G., Pesant, G.: Cp-sst: approche basée sur la programmation par contraintes pour le test structurel du logiciel. Septitièmes Journées Francophones de Programmation par Contraintes (JFPC), 289–298 (June 2011)
Saurabh Sinha, R.O., Harrold, M.J.: Automated support for development, maintenance, and testing in the presence of implicit control flow. In: ICSE 2004, pp. 336–345. IEEE Computer Society Press, Washington, DC, USA (2004)
Tracey, N., Clark, J.A., Mander, K., McDermid, J.A.: Automated test-data generation for exception conditions. Software Practice and Experience 30(1), 61–79 (2000)
Tracey, N., Clark, J.A., Mander, K.: Automated program flaw finding using simulated annealing. In: ISSTA, pp. 73–81 (1998)
Wegener, J., Baresel, A., Sthamer, H.: Evolutionary test environment for automatic structural testing. Information & Software Technology 43(14), 841–854 (2001)
Wright, M.: Automating parameter choice for simulated annealing. Tech. Rep. 32, Lancaster University Management School, UK (2010)
Xanthakis, S., Ellis, C., Skourlas, C., Gall, A.L., Katsikas, S., Karapoulios, K.: Application des algorithmes genetiques au test des logiciels. In: 5th Int. Conference on Software Engineering and its Applications, pp. 625–636 (1992)
Zhang, B.T., Kim, J.J.: Comparison of selection methods for evolutionary optimization. Evolutionary Optimization 2(1), 55–70 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bhattacharya, N., Sakti, A., Antoniol, G., Guéhéneuc, YG., Pesant, G. (2011). Divide-by-Zero Exception Raising via Branch Coverage. In: Cohen, M.B., Ó Cinnéide, M. (eds) Search Based Software Engineering. SSBSE 2011. Lecture Notes in Computer Science, vol 6956. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-23716-4_19
Download citation
DOI: https://doi.org/10.1007/978-3-642-23716-4_19
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-23715-7
Online ISBN: 978-3-642-23716-4
eBook Packages: Computer ScienceComputer Science (R0)