Testing Database Applications with QuickCheck

« back to Presentations Download Presentation Download

In this tutorial we concentrate on Erlang applications that use a database in the bottom. The database can be Mnesia, mySQL or any other. When testing such database application on needs to test the business logic. The business logic can be seen as rules that should hold for the data in the database, but these rules cannot easily be guaranteed by the database itself. For example, it is hard in Mnesia to guarantee relations between data and it is hard in mySQL to guarantee on the database level that only specific customers can order more than 10 products. These business logic rules are normally implemented in Erlang on top of the database.

In order to verify that the business logic is not violated by the application one would like to test all possible scenario’s of users storing and retrieving data from the database. Such random behaviour is easily modeled in QuickCheck and in this tutorial we show how one does so. By means of a small web-shop example we show how complex scenario’s are automatically testsed when the model is constructed.


  • Laura M. Castro

    Erlang enthusiast, researcher and constant learner
    University of A Coruna (Spain)

    Laura became fascinated with Erlang when she learned the language as part of a functional programming course she took during the last years of her degree in software engineering. She was determined to make use of this language as part of her master thesis, so when the chance arose, she did not doubt to join the LFCIA Lab (today MADS Group) at the University of A Coruña (Spain), and their project to development an advanced risk management application using Erlang/OTP. Years later, she presented her PhD in Computer Science: a functional software development methodology which takes advantage of using functional technology to introduce quality assurance techniques and improve both the development process and the software result.

    At the moment, she is an assistant teacher at the University of A Coruña, where she teaches software design and researches about model-based testing."

    Laura M. Castro
« back to Presentations

Posted on November 15, 2010