Unit testing introduction

What are unit tests?

Unit tests are the smallest part of the application that can be tested and are tested in parts.

Why should I care?

Unit tests are important to show if parts of an application are working in the way they are expected to work. For example, if you had a method called int return4() and you expected 4 to be returned, a unit test is written to validate the method returns 4. If it doesn’t, the test fails and is shown up to the tester if written well.

Where can I start unit testing?

For Spring Boot applications, I would recommend the following tutorial. This integrates a unit test with Spring Boot. I would advise you experiment with the tests and see what you can make.

Advertisements