Effective Unit and Integration Testing in Scala

Gain insights into effective unit and integration testing in Scala. Learn about ScalaTest, Mockito, ScalaCheck, and Docker/TestContainers to enhance testing quality and maintainability.

Beginner

37 Lessons

12h

Certificate of Completion

Gain insights into effective unit and integration testing in Scala. Learn about ScalaTest, Mockito, ScalaCheck, and Docker/TestContainers to enhance testing quality and maintainability.

AI-POWERED

Explanations

AI-POWERED

Explanations

This course includes

3 Assessments
78 Playgrounds

This course includes

3 Assessments
78 Playgrounds

Course Overview

Testing is a fundamental part of writing software. Tests should be written with as much care as we put into designing and coding our applications. Still, writing clean and well-organized test cases can be difficult. In many cases, their quality is lower than that of the rest of the application. This can seriously impact the overall quality and maintainability of the project in the long run. The focus of this course is on unit and integration tests in Scala. First, you’ll learn about the most famous testing...Show More

TAKEAWAY SKILLS

Unit Testing

Testing Via Docker

What You'll Learn

A working knowledge of ScalaTest and its best practices

An understanding of property-based testing

An understanding of mocking and test doubles

Hands-on experience with mocking infrastructural dependencies via Docker containers

The ability to design and write effective tests in Scala

What You'll Learn

A working knowledge of ScalaTest and its best practices

Show more

Course Content

1.

Introduction

Get familiar with the significance of testing in Scala, focusing on test types and best practices.
2.

Brief Introduction to Scala and sbt

Look at Scala's paradigms, sbt's build capabilities, and effective project layouts for testing.
3.

Writing Tests with ScalaTest

Work your way through writing expressive test cases using ScalaTest’s diverse styles and tools.

Quiz: ScalaTest

Assessment

4.

Mocking with ScalaMock

Grasp the fundamentals of using ScalaMock for effective unit testing in Scala.

Quiz: Mocking

Assessment

5.

Property-Based Testing with ScalaCheck

Take a closer look at property-based testing concepts, table-driven checks, and ScalaCheck integration.

Quiz: Property-Based Testing

Assessment

6.

Mocking External Services with TestContainers-scala

4 Lessons

Tackle mock external services in integration testing using TestContainers-scala and Docker.
7.

Conclusion

1 Lesson

Build on key ScalaTest practices, advanced features, ScalaCheck, Mockito, and Docker-based integration testing.

Course Author

Trusted by 1.4 million developers working at companies

Anthony Walker

@_webarchitect_

Emma Bostian 🐞

@EmmaBostian

Evan Dunbar

ML Engineer

Carlos Matias La Borde

Software Developer

Souvik Kundu

Front-end Developer

Vinay Krishnaiah

Software Developer

Eric Downs

Musician/Entrepeneur

Kenan Eyvazov

DevOps Engineer

Anthony Walker

@_webarchitect_

Emma Bostian 🐞

@EmmaBostian

Hands-on Learning Powered by AI

See how Educative uses AI to make your learning more immersive than ever before.

Instant Code Feedback

Evaluate and debug your code with the click of a button. Get real-time feedback on test cases, including time and space complexity of your solutions.

AI-Powered Mock Interviews

Adaptive Learning

Explain with AI

AI Code Mentor