Scala Testing, Mocking and Property based testing

Part of our "Scala" courses

2 days (onsite)
3 days (online)

Scala Testing
Outline Last updated:

Course Overview

Rest assured that this course will cover all relevant bases to make sure you have all the necessary skills to work with key Scala Test frameworks:

  • ScalaTest
  • ScalaMock
  • ScalaCheck

Course Prerequisites

In order to get the best from this course it is highly recommended that students should be at least familiar with the basics of the Scala Programming language. (Ideally their knowledge of Scala should reach the level established by our Core Scala Course).

Outline

Introduction

  • Recap of automatic software testing
  • Testing styles
  • Discuss popular Testing Frameworks for Scala

ScalaTest

  • Overview of ScalaTest
  • Testing styles (FunSuite, WordSpec, FlatSpec, FunSpec, …)
  • Using Given-when-then
  • Running tests (using sbt, maven, junit, …)
  • Writing assertions
  • Using the Matcher DSL
  • Writing fixtures

Scala Mock

  • Introduction to Scalamock
  • Discuss different mocking techniques (function, proxy and macro)
  • Integrate with ScalaTest and Specs2
  • Discuss and use expectation-first (mocking)
  • Discuss and use record-then-verify (stubbing)
  • using argument matchers
  • expect method/function calls
  • mocking behaviour by returning values

ScalaCheck

  • Introduce property-based testing
  • Introduce scalacheck
  • Introduce the architecture (key types)
  • Running and integrating with other test frameworks
  • Defining generators
  • Configuration (thresholds, number of workers etc.)
  • Add reporting
  • Discuss various property-based patterns
  • Discuss extensions (e.g, using shapeless)

Frequently asked questions

How long is the Scala Testing, Mocking and Property based testing course?

2 days on-site or 3 days online. Sessions can run on consecutive days or be spread out to fit your team's schedule.

What are the prerequisites?

In order to get the best from this course it is highly recommended that students should be at least familiar with the basics of the Scala Programming language. (Ideally their knowledge of Scala should reach the level established by our Core Scala Course).

How large are the groups?

Deliberately small so the trainer can adapt to every participant: at most 10 on-site and 7 online.

In which languages can the course be delivered?

English, French or Dutch.

This Scala Testing, Mocking and Property based testing course looks very interesting, I do however have a question

Related courses