HomeCoursesEffective Unit and Integration Testing in Scala
5.0

Beginner

12h

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.
Join 2.7 million developers at
Overview
Content
Reviews
Related
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 framework for Scala—ScalaTest. Then, you’ll move to mocking and property-based testing with Mockito and ScalaCheck. Finally, the course will focus on integration testing, showing how to mock the dependencies on external services with Docker and TestContainers. After taking this course, you’ll have a more comprehensive view of the possibilities to run different tests in Scala, including practical knowledge of some widespread testing libraries.
Testing is a fundamental part of writing software. Tests should be written with as much care as we put into designing and coding...Show More

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
A working knowledge of ScalaTest and its best practices

Show more

TAKEAWAY SKILLS

Unit Testing

Testing via Docker

Content

1.

Introduction

2 Lessons

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

2.

Brief Introduction to Scala and sbt

3 Lessons

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

4.

Mocking with ScalaMock

5 Lessons

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

5.

Property-Based Testing with ScalaCheck

5 Lessons

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

6.

Mocking External Services with TestContainers-scala

4 Lessons

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

7.

Conclusion

1 Lessons

Build on key ScalaTest practices, advanced features, ScalaCheck, Mockito, and Docker-based integration testing.
Certificate of Completion
Showcase your accomplishment by sharing your certificate of completion.

Course Author:

Developed by MAANG Engineers
Every Educative lesson is designed by a team of ex-MAANG software engineers and PhD computer science educators, and developed in consultation with developers and data scientists working at Meta, Google, and more. Our mission is to get you hands-on with the necessary skills to stay ahead in a constantly changing industry. No video, no fluff. Just interactive, project-based learning with personalized feedback that adapts to your goals and experience.

Trusted by 2.7 million developers working at companies

Hands-on Learning Powered by AI

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

AI Prompt

Build prompt engineering skills. Practice implementing AI-informed solutions.

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.

Explain with AI

Select any text within any Educative course, and get an instant explanation — without ever leaving your browser.

AI Code Mentor

AI Code Mentor helps you quickly identify errors in your code, learn from your mistakes, and nudge you in the right direction — just like a 1:1 tutor!

Free Resources

FOR TEAMS

Interested in this course for your business or team?

Unlock this course (and 1,000+ more) for your entire org with DevPath