Scala Testing, Mocking and Property based testing

Duration
2 days
Online Duration
2 days

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

Your team stands only to gain by making this crucial investment to push your operations to the next level. Book your Scala Technology course with EDC4IT and your department will benefit from a dedicated instructor who will lead the course and guide your team through all the finer points of this sophisticated technology.

As with many of our other courses, you can choose to have your team take advantage of its many benefits as an online course. Or, you can choose to have the course and one of our highly experienced instructors come directly to your offices for an in-depth learning experience.

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).

Please find the course objectives below:

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, usinh shapeless)

N|Solid

For an onsite course please contact us