Abstract
The JUnit testing tool is widely used to support the central XP concept of “test first” software development. While JUnit provides Java classes for expressing test cases and test suites, it does not provide or proscribe per se any guidelines for deciding what test cases are good ones for any particular class. We have developed a method for systematically creating complete and consistent test classes for JUnit. Called JAX (for Junit Axioms), the method is based on Guttag’s algebraic specification of abstract data types. We demonstrate an informal use of ADT semantics for guiding JUnit test method generation; the programmer uses no formal notation other than Java, and the procedure meshes with XP test-as-design principles. Preliminary experiments show that informal JAX-based testing finds more errors than an ad hoc form of JUnit testing.
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
Beck, K., and Gamma, E., “ JUnit Test Infected: Programmers Love Writing Tests,” Java Report, July 1998, Volume 3, Number 7. Available on-line at: http://JUnit.sourceforge.net/doc/testinfected/testing.htm
Beck, K., and Gamma, E., “JUnit A Cook’s Tour,” Java Report, 4(5), May 1999. Available on-line at: http://JUnit.sourceforge.net/doc/cookstour/cookstour.htm
Beck, K., and Gamma, E., “JUnit Cookbook” Available on-line at http://JUnit.sourceforge.net/doc/cookbook/cookbook.htm
Beck, K., “Extreme Programming Explained,” Addison-Wesley, 2000.
Guttag, J.V., and Horning, J.J., “The Algebraic Specification of Abstract Data Types,” Acta Informatica 10 (1978), pp. 27–52.
J. Guttag, E. Horowitz, D. Musser, “Abstract Data Types and Software Validation”, Communications of the ACM, 21, Dec. 1978, pp. 1048–1063.
J. Guttag, “Notes on Type Abstraction”, IEEE Trans. on Software Engineering, TR-SE 6(1), Jan. 1980, pp. 13–23.
Gannon, J., McMullin, P., and Hamlet, R., “Data Abstraction Implementation, Specification, and Testing,” IEEE Trans. on Programming Languages and Systems 3(3). July 1981, pp. 211–223.
Hughes, M., and Stotts, D., “Daistish: Sytematic Algebraic Testing for OO Programs in the Presence of Side Effects,” Proceedings of the 1996 International Syposium Software Testing and Analysis (ISSTA) January 8-10, 1996, 53–61.
R.-K. Doong, P. Frankl, “The ASTOOT Approach to Testing Object-Oriented Programs”, ACM Trans. on Software Engineering and Methodology, April 1994, pp. 101–130.
D. Hoffman, R. Snodgrass, “Trace Specifications: Methodology and Models”, IEEE Trans. on Software Engineering, 14(9), Sept. 1988, pp. 1243–1252.
D. Parnas, Y. Wang, “The Trace Assertion Method of Module Interface Specification”, Tech. Rep. 89–261, Queen’s University, Ontario, Oct. 1989.
J. Guttag, J. Horning, J. Wing, “The Larch Family of Specification Languages”, IEEE Software, 2(5), Sept. 1985, pp. 24–36.
J. Wing, “Writing Larch Interface Language Specifications”, ACM Trans. on Programming Languages and Systems, 9(1), Jan. 1987, pp. 1–24.
J. Wing, “Using Larch to Specify Avalon/C++ Objects”, IEEE Trans. on Software Engineering, 16(9), Sept. 1990, pp. 1076–1088.
Proceedings of the Software Design and Management Conference 2001: Software Pioneers, Bonn, Germany, June 2001; audio/video streams of the talks at can be viewed at http://www.sdm.de/conf2001/index_e.htm
R. Martin and R. Koss, “Engineer Notebook: An Extreme Programming Episode”, http://www.objectmentor.com/resources/articles/xpepisode.htm
B. Marick, “Faults of Omission,” Software Testing and Quality Engineering, Jan. 2000, http://www.testing.com/writings/omissions.html
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Stotts, D., Lindsey, M., Antley, A. (2002). An Informal Formal Method for Systematic JUnit Test Case Generation. In: Wells, D., Williams, L. (eds) Extreme Programming and Agile Methods — XP/Agile Universe 2002. XP/Agile Universe 2002. Lecture Notes in Computer Science, vol 2418. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45672-4_13
Download citation
DOI: https://doi.org/10.1007/3-540-45672-4_13
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-44024-6
Online ISBN: 978-3-540-45672-8
eBook Packages: Springer Book Archive