Skip to main content

An Informal Formal Method for Systematic JUnit Test Case Generation

  • Conference paper
  • First Online:
Extreme Programming and Agile Methods — XP/Agile Universe 2002 (XP/Agile Universe 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2418))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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

  2. 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

  3. Beck, K., and Gamma, E., “JUnit Cookbook” Available on-line at http://JUnit.sourceforge.net/doc/cookbook/cookbook.htm

  4. Beck, K., “Extreme Programming Explained,” Addison-Wesley, 2000.

    Google Scholar 

  5. Guttag, J.V., and Horning, J.J., “The Algebraic Specification of Abstract Data Types,” Acta Informatica 10 (1978), pp. 27–52.

    Article  MATH  MathSciNet  Google Scholar 

  6. J. Guttag, E. Horowitz, D. Musser, “Abstract Data Types and Software Validation”, Communications of the ACM, 21, Dec. 1978, pp. 1048–1063.

    Google Scholar 

  7. J. Guttag, “Notes on Type Abstraction”, IEEE Trans. on Software Engineering, TR-SE 6(1), Jan. 1980, pp. 13–23.

    Google Scholar 

  8. 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.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. 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.

    Google Scholar 

  11. D. Hoffman, R. Snodgrass, “Trace Specifications: Methodology and Models”, IEEE Trans. on Software Engineering, 14(9), Sept. 1988, pp. 1243–1252.

    Google Scholar 

  12. D. Parnas, Y. Wang, “The Trace Assertion Method of Module Interface Specification”, Tech. Rep. 89–261, Queen’s University, Ontario, Oct. 1989.

    Google Scholar 

  13. J. Guttag, J. Horning, J. Wing, “The Larch Family of Specification Languages”, IEEE Software, 2(5), Sept. 1985, pp. 24–36.

    Google Scholar 

  14. J. Wing, “Writing Larch Interface Language Specifications”, ACM Trans. on Programming Languages and Systems, 9(1), Jan. 1987, pp. 1–24.

    Google Scholar 

  15. J. Wing, “Using Larch to Specify Avalon/C++ Objects”, IEEE Trans. on Software Engineering, 16(9), Sept. 1990, pp. 1076–1088.

    Google Scholar 

  16. 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

  17. R. Martin and R. Koss, “Engineer Notebook: An Extreme Programming Episode”, http://www.objectmentor.com/resources/articles/xpepisode.htm

  18. B. Marick, “Faults of Omission,” Software Testing and Quality Engineering, Jan. 2000, http://www.testing.com/writings/omissions.html

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics