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 33 articles , 1 standard article )

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

1 2 next

  1. Xavier Devroey, Alessio Gambi, Juan Pablo Galeotti, René Just, Fitsum Kifetew, Annibale Panichella, Sebastiano Panichella: JUGE: An Infrastructure for Benchmarking Java Unit Test Generators (2021) arXiv
  2. Andrea Arcuri; Juan Pablo Galeotti; Bogdan Marculescu; Man Zhang: EvoMaster: A Search-Based System Test Generation Tool (2020) not zbMATH
  3. Rodríguez, Ismael; Rosa-Velardo, Fernando; Rubio, Fernando: Introducing complexity to formal testing (2020)
  4. Fernanda Madeiral, Simon Urli, Marcelo Maia, Martin Monperrus: Bears: An Extensible Java Bug Benchmark for Automatic Program Repair Studies (2019) arXiv
  5. Lum, Oliver; Golden, Bruce; Wasil, Edward: OAR lib: an open source arc routing library (2019)
  6. 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
  7. 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)
  8. 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
  9. Pérez, Juan F.; Silva, Daniel F.; Góez, Julio C.; Sarmiento, Andrés; Sarmiento-Romero, Andrés; Akhavan-Tabatabaei, Raha; Riaño, Germán: Algorithm 972: jMarkov: an integrated framework for Markov chain modeling (2017)
  10. Westergaard, Michael; Fahland, Dirk; Stahl, Christian: Grade/CPN: a tool and temporal logic for testing colored Petri net models in teaching (2013)
  11. Kiniry, Joseph R.; Zimmerman, Daniel M.; Hyland, Ralph: Testing library specifications by verifying conformance tests (2012) ioport
  12. Hill, James H.; Varshneya, Pooja: Evaluating distributed real-time and embedded system test correctness using system execution traces (2011) ioport
  13. Zimmerman, Daniel M.; Nagmoti, Rinkesh: JMLUnit: the next generation (2011)
  14. 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
  15. Frydrych, Dalibor: Usage of modular scissors in the implementation of FEM. (2010)
  16. Chetali, Boutheina; Nguyen, Quang-Huy: An automated testing experiment for layered embedded C code (2009) ioport
  17. 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
  18. Carlier, Matthieu; Dubois, Catherine: Functional testing in the focal environment (2008)
  19. White, Jules; Schmidt, Douglas C.; Gokhale, Aniruddha: Simplifying autonomic enterprise Java Bean applications via model-driven engineering and simulation (2008) ioport
  20. Engel, Christian; Hähnle, Reiner: Generating unit tests from formal proofs (2007)

1 2 next