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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
See http://maude.cs.illinois.edu/ for a comprehensive list of Maude projects.
- 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.
Most of the tools also include specific strategies for corner cases, such as empty lists.
References
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
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)
Beizer, B.: Software Testing Techniques. Dreamtech, India (2002)
Bouhoula, A., Jouannaud, J.-P., Meseguer, J.: Specification and proof in membership equational logic. Theor. Comput. Sci. 236, 35–132 (2000)
Britton, T., Jeng, L., Carver, G., Cheak, P., Katzenellenbogen, T.: Reversible debugging software. University of Cambridge-Judge Business School, Technical report (2013)
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)
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
Claessen, K., Hughes, J.: Quickcheck: a lightweight tool for random testing of Haskell programs. In: ACM SIGPLAN Notices, pp. 268–279. ACM Press (2000)
Clavel, M., et al.: Maude Manual (Version 2.7), March 2015. http://maude.cs.illinois.edu/w/images/1/1a/Maude-manual.pdf
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
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
CurryTest. https://www-ps.informatik.uni-kiel.de/currywiki/tools/currytest
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)
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
Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theor. Comput. Sci. 96(1), 73–155 (1992)
Nilsson, R.: Scalacheck: The Definitive Guide. IT Pro, Artima Incorporated (2014)
Ölveczky, P.C., Meseguer, J.: Semantics and pragmatics of Real-Time Maude. Higher-Order Symb. Comput. 20, 161–196 (2007)
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)
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
Riesco, A., Ogata, K., Futatsugi, K.: A Maude environment for CafeOBJ. Formal Aspects Comput. 29(2), 309–334 (2016)
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)
Runeson, P.: A survey of unit testing practices. IEEE Softw. 23(4), 22–29 (2006)
Tretmans, J.: Conformance testing with labelled transition systems: implementation relations and test generation. Computer Netw. ISDN Syst. 29(1), 49–79 (1996)
Venners, B.: Scalatest 3.0.5 (2018). http://www.scalatest.org/
Wadler, P.: Why no one uses functional languages. SIGPLAN Not. 33(8), 23–27 (1998)
Wielemaker, J.: Prolog unit tests. http://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/plunit.html%27)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
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)