skip to main content
10.1145/3471871.3472964acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Makina: a new QuickCheck state machine library

Published: 18 August 2021 Publication History

Abstract

This article presents Makina, a new library and a domain specific language for writing property-based testing models for stateful programs. Models written in the new domain specific language are, using Elixir macros, rewritten into normal QuickCheck state machines. Our main goals with Makina are to facilitate the task of developing correct and maintainable models, and to encourage model reuse. To meet these goals, Makina provides a declarative syntax for defining model states and model commands. In particular, Makina encourages the typing of specifications, and ensures through its rewrite rules that such type information can be used by, e.g., the Dialyzer tool, to effectively typecheck models. Moreover, to promote model reuse, the domain specific language provides constructs to permit models to be defined in terms of collections of previously defined models.

References

[1]
Klaus Alfert. 2015. https://github.com/alfert/propcheck Accessed: 2021-05-06.
[2]
Thomas Arts, John Hughes, Joakim Johansson, and Ulf T. Wiger. 2006. Testing telecoms software with Quviq QuickCheck. In Proceedings of the 2006 ACM SIGPLAN Workshop on Erlang. Portland, Oregon, USA.
[3]
Eirini Arvaniti. 2011. Automated Random Model-Based Testing of Stateful Systems. National Technical University of Athens, School of Electrical and Computer Engineering. http://artemis.cslab.ntua.gr/el_thesis/artemis.ntua.ece/DT2011-0142/DT2011-0142.pdf
[4]
Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP ’00). ACM, New York, NY, USA. 268–279. isbn:1-58113-202-6 https://doi.org/10.1145/351240.351266
[5]
Clara Benac Earle and Lars-Åke Fredlund. 2015. Functional Testing of Java Programs. In Trends in Functional Programming - 16th International Symposium, TFP 2015, Sophia Antipolis, France, June 3-5, 2015. Revised Selected Papers, Manuel Serrano and Jurriaan Hage (Eds.) (Lecture Notes in Computer Science, Vol. 9547). Springer, 40–59. https://doi.org/10.1007/978-3-319-39110-6_3
[6]
David Harel. 1987. Statecharts: A Visual Formalism For Complex Systems.
[7]
John E. Hopcroft and Jeffrey D. Ullman. 1979. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, Reading, MA.
[8]
John Hughes, Benjamin C. Pierce, Thomas Arts, and Ulf Norell. 2016. Mysteries of DropBox: Property-Based Testing of a Distributed Synchronization Service. In 2016 IEEE International Conference on Software Testing, Verification and Validation (ICST). 135–145. https://doi.org/10.1109/ICST.2016.37
[9]
John M. Hughes and Hans Bolinder. 2011. Testing a Database for Race Conditions with QuickCheck: None. In Proceedings of the 10th ACM SIGPLAN Workshop on Erlang (Erlang ’11). Association for Computing Machinery, New York, NY, USA. 72–77. isbn:9781450308595 https://doi.org/10.1145/2034654.2034667
[10]
Edward Ashford Lee and Sanjit Arunkumar Seshia. 2016. Introduction to Embedded Systems: A Cyber-Physical Systems Approach (2nd ed.). The MIT Press. isbn:0262533812
[11]
Barbara H. Liskov and Jeanette M. Wing. 1994. A Behavioral Notion of Subtyping. ACM Transactions on Programming Languages and Systems, 16 (1994), 1811–1841.
[12]
Andreas Löscher, Konstantinos Sagonas, and Thiemo Voigt. 2015. Property-based Testing of Sensor Networks. In Sensing, Communication, and Networking, 12th Annual IEEE International Conference on. IEEE, 100–108.
[13]
David R. MacIver. 2013. https://hypothesis.readthedocs.io Accessed: 2021-05-06.
[14]
Rickard Nilsson. 2014. ScalaCheck: The Definitive Guide. Artima.
[15]
Ulf Norell, Hans Svensson, and Thomas Arts. 2013. Testing Blocking Operations with QuickCheck’s Component Library. In Proceedings of the Twelfth ACM SIGPLAN Workshop on Erlang (Erlang ’13). Association for Computing Machinery, New York, NY, USA. 87–92. isbn:9781450323857 https://doi.org/10.1145/2505305.2505310
[16]
Manolis Papadakis. 2010. Automatic Random Testing of Function Properties from Specifications. National Technical University of Athens, School of Electrical and Computer Engineering. http://artemis.cslab.ntua.gr/el_thesis/artemis.ntua.ece/DT2010-0295/DT2010-0295.pdf
[17]
Quviq. 2014. https://github.com/Quviq/eqc_ex Accessed: 2021-05-06.
[18]
Aamod Sane and Roy H. Campbell. 1995. Object-Oriented State Machines: Subclassing, Composition, Delegation and Genericity. In Proceedings of the 10th Annual Conference on Object-Oriented Programming, Systems, Languages and Applications, Rebecca Wirfs-Brock (Ed.). ACM. isbn:0-89791-703-0
[19]
Jacob Stanley. 2021. https://hedgehog.qa Accessed: 2021-05-06.

Cited By

View all
  • (2024)Property-Based Testing by Elaborating Proof OutlinesTheory and Practice of Logic Programming10.1017/S1471068424000176(1-40)Online publication date: 21-Nov-2024

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Erlang 2021: Proceedings of the 20th ACM SIGPLAN International Workshop on Erlang
August 2021
71 pages
ISBN:9781450386128
DOI:10.1145/3471871
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 August 2021

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Elixir
  2. Property-based Testing
  3. State machines

Qualifiers

  • Research-article

Funding Sources

Conference

ICFP '21
Sponsor:

Acceptance Rates

Overall Acceptance Rate 51 of 68 submissions, 75%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)1
Reflects downloads up to 08 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Property-Based Testing by Elaborating Proof OutlinesTheory and Practice of Logic Programming10.1017/S1471068424000176(1-40)Online publication date: 21-Nov-2024

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media