O'Reilly logo

Microservice Patterns and Best Practices by Vinicius Feitosa Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit tests

Unit tests are well-known and are already normative in the software development industry. There are a number of standards and practices for unit tests. However, the best practice for unit tests is to make sure that they are running every software built.

The unit tests are used to prove the smallest testable part of a computer program. In this sense, the great challenge is to write code that is testable; otherwise, it will be impossible to apply the unit tests.

An important feature is that unit tests only prove the code unit segment. Imagine that we are going to test a function that communicates with the database. When we create the unit test, we have to use a mechanism so that the function test does not touch the database. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required