A simple and practical approach to unit testing: The JML and JUnit way. Writing unit test code is labor-intensive, hence it is often not done as an integral part of programming. However, unit testing is a practical approach to increasing the correctness and quality of software; for example, the Extreme Programming approach relies on frequent unit testing. par In this paper we present a new approach that makes writing unit tests easier. It uses a formal specification language’s runtime assertion checker to decide whether methods are working correctly, thus automating the writing of unit test oracles. These oracles can be easily combined with hand-written test data. Instead of writing testing code, the programmer writes formal specifications (e.g., pre- and postconditions). This makes the programmer’s task easier, because specifications are more concise and abstract than the equivalent test code, and hence more readable and maintainable. Furthermore, by using specifications in testing, specification errors are quickly discovered, so the specifications are more likely to provide useful documentation and inputs to other tools. We have implemented this idea using the Java Modeling Language (JML) and the JUnit testing framework, but the approach could be easily implemented with other combinations of formal specification languages and unit test tools.

References in zbMATH (referenced in 29 articles , 1 standard article )

Showing results 1 to 20 of 29.
Sorted by year (citations)

1 2 next

  1. Rodríguez, Ismael; Rosa-Velardo, Fernando; Rubio, Fernando: Introducing complexity to formal testing (2020)
  2. Fernanda Madeiral, Simon Urli, Marcelo Maia, Martin Monperrus: Bears: An Extensible Java Bug Benchmark for Automatic Program Repair Studies (2019) arXiv
  3. Naji Dmeiri, David A. Tomassi, Yichen Wang, Antara Bhowmick, Yen-Chuan Liu, Premkumar Devanbu, Bogdan Vasilescu, Cindy Rubio-González: BugSwarm: Mining and Continuously Growing a Dataset of Reproducible Failures and Fixes (2019) arXiv
  4. Ahrendt, Wolfgang; Chimento, Jesús Mauricio; Pace, Gordon J.; Schneider, Gerardo: Verifying data- and control-oriented properties combining static and runtime verification: theory and tools (2017)
  5. Juan F. Pérez; Daniel F. Silva; Julio C. Góez; Andrés Sarmiento; Andrés Sarmiento-Romero; Raha Akhavan-Tabatabaei; Germán Riaño: Algorithm 972: jMarkov: An Integrated Framework for Markov Chain Modeling (2017) not zbMATH
  6. Westergaard, Michael; Fahland, Dirk; Stahl, Christian: Grade/CPN: a tool and temporal logic for testing colored Petri net models in teaching (2013)
  7. Kiniry, Joseph R.; Zimmerman, Daniel M.; Hyland, Ralph: Testing library specifications by verifying conformance tests (2012) ioport
  8. Hill, James H.; Varshneya, Pooja: Evaluating distributed real-time and embedded system test correctness using system execution traces (2011) ioport
  9. Zimmerman, Daniel M.; Nagmoti, Rinkesh: JMLUnit: the next generation (2011)
  10. du Bousquet, Lydie; Ledru, Yves; Maury, Olivier; Oriat, Catherine; Lanet, Jean-Louis: Reusing a JML specification dedicated to verification for testing, and vice-versa: Case studies (2010) ioport
  11. Frydrych, Dalibor: Usage of modular scissors in the implementation of FEM. (2010)
  12. Chetali, Boutheina; Nguyen, Quang-Huy: An automated testing experiment for layered embedded C code (2009) ioport
  13. du Bousquet, Lydie; Nakamura, Masahide; Yan, Ben; Igaki, Hiroshi: Using formal methods to increase confidence in a home network system implementation: a case study (2009) ioport
  14. Carlier, Matthieu; Dubois, Catherine: Functional testing in the focal environment (2008)
  15. White, Jules; Schmidt, Douglas C.; Gokhale, Aniruddha: Simplifying autonomic enterprise Java Bean applications via model-driven engineering and simulation (2008) ioport
  16. Engel, Christian; Hähnle, Reiner: Generating unit tests from formal proofs (2007)
  17. Heckel, Reiko; Lohmann, Marc: Model-driven development of reactive information systems: from graph transformation rules to JML contracts (2007) ioport
  18. Logozzo, Francesco: Cibai: An abstract interpretation-based static analyzer for modular analysis and verification of Java classes (2007)
  19. Simons, Anthony J. H.: Jwalk: a tool for lazy, systematic testing of Java classes by design introspection and user interaction. (2007) ioport
  20. Simons, Anthony J. H.: Jwalk: a tool for lazy, systematic testing of java classes by design introspection and user interaction (2007) ioport

1 2 next