Erlang and Test Driven Development

Target Audience: Project Managers/Team Leaders, Support and Test Engineers, Software Developers,

Prerequisites: Knowledge of basic Erlang (equivalent to Erlang by Example or Erlang Express courses. OTP courses not necessary, but useful).


  • Understand the principles behind Test Driven Development,
  • Be able to use Erlang's principal testing tools (EUnit, Common Test, QuickCheck),
  • Learn about tools to maintain and debug existing Erlang programs
  • Learn how to use existing tools of the ecosystem to help develop, debug and maintain Erlang software


Duration: Three days

Delegates will learn test frameworks for unit tests, property-based tests and large-scale tests. The tutor will cover EUnit, Common Test, QuickCheck for testing, then Wrangler, Dialyzer and tracing (among others) for maintenance. Participants will also learn principles of Test-Driven Development which will promote the creation of more reliable and maintainable software.

Course Contents

The topics covered are:

What is TDD         
A brief overview of test-driven development: what are the principles behind it, possible advantages and disadvantages of the  practice, terminology and a quick look at case studies of TDD

TDD With Eunit
Exploring EUnit, and the architecture behind it (assertions, test generators, test representations and fixtures); how to use EUnit to test functional code and code with state.

Common Test
A guide on how to use Common Test, from unit tests to large scale testing. This covers unit test, testing with state, test groups and suites, how to configure tests, write specifications and do distributed testing.

Property-Based Testing
Covers the principles behind property-based testing. We use QuickCheck Mini to see how to write property-based tests: generators, properties, symbolic representation of tests, etc. This also briefly covers shrinking strategies to find errors.

Maintenance and Debugging
A review of useful tools when maintaining and debugging Erlang software. This section covers test coverage with the cover tool, Type checking with Dialyzer and TypEr, refactoring with Wrangler and also the the Trace Tool builder for ErlIDE and Exago.