Skip to main content

MUnit: A Unit Framework for Maude

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 11152))

Abstract

Unit testing is a widely-used methodology for checking whether the units of a given program work as expected. Maude is a high performance rewriting engine based on rewriting logic. Although Maude has been used to implement complex specifications and tools, it lacks the testing tools usually supported by other languages. In this work we present MUnit, a unit testing framework for Maude that takes into account its main features to define meaningful unit tests. MUnit extends Full Maude and supports functional and system modules, as well as specifications using the Loop Mode and, in particular, Full Maude.

Research partially supported by MINECO Spanish project TRACES (TIN2015-67522-C3-3-R) and Comunidad de Madrid project N-Greens Software-CM (S2013/ICE-2731).

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

Buying options

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 EPUB and 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

Learn about institutional subscriptions

Notes

  1. 1.

    See http://maude.cs.illinois.edu/ for a comprehensive list of Maude projects.

  2. 2.

    Likewise, if f is not a function but a constructor and we are interested in testing how the terms t1, ..., tn behave the test would compute the normal form and compare it with the normal form of t. However, this test would not follow completely the philosophy of Maude unit tests as we have defined it.

  3. 3.

    Most of the tools also include specific strategies for corner cases, such as empty lists.

References

  1. Amaral, C., Florido, M., Santos Costa, V.: PrologCheck – property-based testing in prolog. In: Codish, M., Sumii, E. (eds.) FLOPS 2014. LNCS, vol. 8475, pp. 1–17. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-07151-0_1

    Chapter  Google Scholar 

  2. Arts, T., Castro, L.M., Hughes, J.: Testing Erlang data types with QuviQ QuickCheck. In: Teoh, S.T., Horváth, Z. (eds.) Proceedings of the 7th ACM SIGPLAN Workshop on ERLANG, pp. 1–8. ACM (2008)

    Google Scholar 

  3. Beizer, B.: Software Testing Techniques. Dreamtech, India (2002)

    MATH  Google Scholar 

  4. Bouhoula, A., Jouannaud, J.-P., Meseguer, J.: Specification and proof in membership equational logic. Theor. Comput. Sci. 236, 35–132 (2000)

    Article  MathSciNet  Google Scholar 

  5. Britton, T., Jeng, L., Carver, G., Cheak, P., Katzenellenbogen, T.: Reversible debugging software. University of Cambridge-Judge Business School, Technical report (2013)

    Google Scholar 

  6. Carlsson, R., Rémond, M.: EUnit: a lightweight unit testing framework for Erlang. In: Proceedings of the 2006 ACM SIGPLAN Workshop on Erlang, p. 1. ACM (2006)

    Google Scholar 

  7. Christiansen, J., Fischer, S.: EasyCheck — test data for free. In: Garrigue, J., Hermenegildo, M.V. (eds.) FLOPS 2008. LNCS, vol. 4989, pp. 322–336. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78969-7_23

    Chapter  Google Scholar 

  8. Claessen, K., Hughes, J.: Quickcheck: a lightweight tool for random testing of Haskell programs. In: ACM SIGPLAN Notices, pp. 268–279. ACM Press (2000)

    Google Scholar 

  9. Clavel, M., et al.: Maude Manual (Version 2.7), March 2015. http://maude.cs.illinois.edu/w/images/1/1a/Maude-manual.pdf

  10. Clavel, M., et al.: All About Maude - A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71999-1

    Book  MATH  Google Scholar 

  11. Clavel, M., Durán, F., Hendrix, J., Lucas, S., Meseguer, J., Ölveczky, P.: The maude formal tool environment. In: Mossakowski, T., Montanari, U., Haveraaen, M. (eds.) CALCO 2007. LNCS, vol. 4624, pp. 173–178. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73859-6_12

    Chapter  Google Scholar 

  12. CurryTest. https://www-ps.informatik.uni-kiel.de/currywiki/tools/currytest

  13. Durán, F., Ölveczky, P.C.: A guide to extending Full Maude illustrated with the implementation of Real-Time Maude. In: Roşu, G. (ed.) Proceedings of the 7th International Workshop on Rewriting Logic and its Applications, WRLA 2008, Electronic Notes in Theoretical Computer Science, vol. 238(3), pp. 83–102. Elsevier (2009)

    Google Scholar 

  14. Hughes, J.: Software testing with QuickCheck. In: Horváth, Z., Plasmeijer, R., Zsók, V. (eds.) CEFP 2009. LNCS, vol. 6299, pp. 183–223. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-17685-2_6

    Chapter  Google Scholar 

  15. Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theor. Comput. Sci. 96(1), 73–155 (1992)

    Article  MathSciNet  Google Scholar 

  16. Nilsson, R.: Scalacheck: The Definitive Guide. IT Pro, Artima Incorporated (2014)

    Google Scholar 

  17. Ölveczky, P.C., Meseguer, J.: Semantics and pragmatics of Real-Time Maude. Higher-Order Symb. Comput. 20, 161–196 (2007)

    Article  Google Scholar 

  18. Papadakis, M., Sagonas, K.: A PropEr integration of types and function specifications with property-based testing. In: Proceedings of the 2011 ACM SIGPLAN Erlang Workshop, pp. 39–50. ACM Press (2011)

    Google Scholar 

  19. Riesco, A.: Using narrowing to test maude specifications. In: Durán, F. (ed.) WRLA 2012. LNCS, vol. 7571, pp. 201–220. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-34005-5_11

    Chapter  Google Scholar 

  20. Riesco, A., Ogata, K., Futatsugi, K.: A Maude environment for CafeOBJ. Formal Aspects Comput. 29(2), 309–334 (2016)

    Article  Google Scholar 

  21. Riesco, A., Verdejo, A., Martí-Oliet, N., Caballero, R.: Declarative debugging of rewriting logic specifications. J. Logic Algebraic Program. 81(7–8), 851–897 (2012)

    Article  MathSciNet  Google Scholar 

  22. Runeson, P.: A survey of unit testing practices. IEEE Softw. 23(4), 22–29 (2006)

    Article  Google Scholar 

  23. Tretmans, J.: Conformance testing with labelled transition systems: implementation relations and test generation. Computer Netw. ISDN Syst. 29(1), 49–79 (1996)

    Article  Google Scholar 

  24. Venners, B.: Scalatest 3.0.5 (2018). http://www.scalatest.org/

  25. Wadler, P.: Why no one uses functional languages. SIGPLAN Not. 33(8), 23–27 (1998)

    Article  Google Scholar 

  26. Wielemaker, J.: Prolog unit tests. http://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/plunit.html%27)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Adrián Riesco .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Riesco, A. (2018). MUnit: A Unit Framework for Maude. In: Rusu, V. (eds) Rewriting Logic and Its Applications. WRLA 2018. Lecture Notes in Computer Science(), vol 11152. Springer, Cham. https://doi.org/10.1007/978-3-319-99840-4_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-99840-4_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-99839-8

  • Online ISBN: 978-3-319-99840-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics