Introducing the Application

Get introduced to the bookstore application, and the database initialization script.

The application

The application will be a bookstore implementation that uses a PostgreSQL backend, with SQL queries and network connections as part of the code to be tested. Even with all these moving pieces, we’ll still be able to test it all using Erlang.

Because real-world systems contain more moving parts, they’ll have a far larger portfolio of errors and strange behaviors to detect and debug. We’ll keep on using stateful properties, but we may have to adjust our strategy a bit to make our lives easier.

Like many other system tests, we’ll start with a prewritten system, and mainly focus on testing it. The base system will use a few open source libraries, mostly around interacting with a database.

The first big dependency for this chapter is going to be an install of PostgreSQL, at version 9.6 or above.

Setting up the application

We start with a standard OTP application template from rebar3 to start a new project, and then edit the rebar3.config file to look like this:

Get hands-on with 1400+ tech skills courses.