Abstract
This paper presents Jartege, a tool which allows random generation of unit tests for Java classes specified in JML. JML (Java Modeling Language) is a specification language for Java which allows one to write invariants for classes, and pre- and postconditions for operations. As in the JML-JUnit tool, we use JML specifications on the one hand to eliminate irrelevant test cases, and on the other hand as a test oracle. Jartege randomly generates test cases, which consist of a sequence of constructor and method calls for the classes under test. The random aspect of the tool can be parameterized by associating weights to classes and operations, and by controlling the number of instances which are created. The practical use of Jartege is illustrated by a small case study.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
The JUnit Home Page, http://www.junit.org
Beck, K., Gamma, E.: Test infected: Programmers love writing tests. Java Reports 3(7), 51–56 (1998)
Gannon, J., McMullin, P., Hamlet, R.: Data-abstraction implementation, specification, and testing. ACM Transactions on Programming Languages and Systems 3(3), 211–233 (1981)
Rosenblum, D.S.: Towards a method of programming with assertions. In: International Conference on Software Engineering — ICSE 1992. IEEE Computer Society Press, Los Alamitos (1992)
Meyer, B.: Object-Oriented Software Construction. Prentice-Hall, Englewood Cliffs (1988)
Meyer, B.: Applying design by contract. IEEE Computer 25(10), 40–51 (1992)
Gaudel, M.C.: Testing can be formal too. In: Mosses, P.D., Schwartzbach, M.I., Nielsen, M. (eds.) CAAP 1995, FASE 1995, and TAPSOFT 1995. LNCS, vol. 915, pp. 82–96. Springer, Heidelberg (1995)
Dick, J., Faivre, A.: Automating the generation and sequencing of test cases from model-based specifications. In: Larsen, P., Woodcock, J.C.P. (eds.) FME 1993. LNCS, vol. 670, pp. 268–284. Springer, Heidelberg (1993)
Van Aertryck, L., Benveniste, M., Le Métayer, D.: Casting: a formally based software test generation method. In: Proceedings of the First IEEE Internatinal Conference on Formal Engineering Methods — ICFEM 1997, Hiroshima, Japan, November 1997, pp. 101–111 (1997)
Legeard, B., Peureux, F., Utting, M.: Automated boundary testing from Z and B. In: Eriksson, L.-H., Lindsay, P.A. (eds.) FME 2002. LNCS, vol. 2391, pp. 21–40. Springer, Heidelberg (2002)
Myers, G.J.: The Art of Software Testing. John Wiley and Sons, New York (1994)
Duran, J.W., Ntafos, S.C.: An evaluation of random testing. IEEE Transactions on Software Engineering 10(4), 438–444 (1984)
Hamlet, D., Taylor, R.: Partition testing does not inspire confidence. IEEE Transactions on Software Engineering 16 (1990)
Ntafos, S.C.: On comparisons of random, partition, and proportional partition testing. IEEE Transactions on Software Engineering 27, 949–960 (2001)
Frankl, P.G., Hamlet, R.G., LittleWood, B., Strigini, L.: Evaluating testing methods by delivered reliability. IEEE Transactions on Software Engineering 24, 586–601 (1998)
Hamlet, R.: Random testing. In: Marciniak, J. (ed.) Encyclopedia of Software Engineering, pp. 970–978. Wiley, Chichester (1994)
Weyuker, E.J., Jeng, B.: Analyzing partition testing strategies. IEEE Transactions on Software Engineering 17, 703–711 (1991)
Beck, K.: Embracing change with extreme programming. IEEE Computer 32, 70–77 (1999)
Beck, K.: Extreme Programming Explained. Addison Wesley, Reading (2000)
The Java Modeling Language (JML) Home Page, http://www.cs.iastate.edu/~leavens/JML
Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary Design of JML: A Behavioral Interface Specification Language for Java. Department of Computer Science, Iowa State University (1998–2003)
Leavens, G.T., Poll, E., Clifton, C., Cheon, Y., Ruby, C.: JML Reference Manual (Draft) (April 2003)
Burdy, L., Cheon, Y., Cok, D.R., Ernst, M., Kiniry, J., Leavens, G.T., Rustan, K., Leino, M., Poll, E.: An overview of JML tools and applications. Technical Report NIII-R0309, Department of Computer Science, University of Nijmegen (March 2003)
Cheon, Y., Leavens, G.T.: A runtime assertion checker for the Java Modeling Language. In: Arabnia, H.R., Mun, Y. (eds.) International Conference on Software Engineering Research and Practice — SERP2002, Las Vegas, Nevada, pp. 322–328 (2002)
Cheon, Y., Leavens, G.T.: A simple and practical approach to unit testing: The JML and jUnit way. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 231–255. Springer, Heidelberg (2002)
Parissis, I.: Test de logiciels synchrones spécifiés en Lustre. PhD thesis, Grenoble, France (1996)
du Bousquet, L., Ouabdesselam, F., Richier, J.L., Zuanon, N.: Lutess: a specification-driven testing environment for synchronous software. In: International Conference on Software Engineering — ICSE 1999. ACM Press, Los Angeles (1999)
du Bousquet, L., Zuanon, N.: An overview of Lutess: a specification-based tool for testing synchronous software. In: 14th IEEE International Conference on Automated Software Engineering — ASE 1999, pp. 208–215 (1999)
Labiche, Y., Thévenod-Fosse, P., Waeselynck, H., Durand, M.H.: Testing levels for object-oriented software. In: Proceedings of the 22nd International Conference on Software Engineering — ICSE 2000, Limerick, Ireland, pp. 136–145. ACM, Los Alamitos (2000)
Boyapati, C., Khurshid, S., Marinov, D.: Korat: Automated testing based on Java predicates. In: Proceedings of the International Symposium on Software Testing and Analysis — ISSTA 2002, Rome, July 2002, pp. 123–133 (2002)
Ledru, Y.: The TOBIAS test generator and its adaptation to some ASE challenges (position paper). In: Workshop on the State of the Art in Automated Software Engineering, ICS Technical Report UCI-ICS-02-17, University of California, Irvine, USA (2002)
Maury, O., Ledru, Y., Bontron, P., du Bousquet, L.: Using TOBIAS for the automatic generation of VDM test cases. In: Eriksson, L.-H., Lindsay, P.A. (eds.) FME 2002. LNCS, vol. 2391, pp. 41–56. Springer, Heidelberg (2002)
Jéron, T., Morel, P.: Test generation derived from model-checking. In: Halbwachs, N., Peled, D.A. (eds.) CAV 1999. LNCS, vol. 1633, pp. 108–121. Springer, Heidelberg (1999)
du Bousquet, L., Lanet, J.L., Ledru, Y., Maury, O., Oriat, C.: A case study in JML-based software validation. In: 19th IEEE International Conference on Automated Software Engineering, Austria — ASE 2004, pp. 294–297 (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Oriat, C. (2005). Jartege: A Tool for Random Generation of Unit Tests for Java Classes. In: Reussner, R., Mayer, J., Stafford, J.A., Overhage, S., Becker, S., Schroeder, P.J. (eds) Quality of Software Architectures and Software Quality. QoSA SOQUA 2005 2005. Lecture Notes in Computer Science, vol 3712. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11558569_18
Download citation
DOI: https://doi.org/10.1007/11558569_18
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-29033-9
Online ISBN: 978-3-540-32056-2
eBook Packages: Computer ScienceComputer Science (R0)