Search⌘ K

Unit Testing

Explore the principles of unit testing to validate individual functions or code blocks. Understand how to write automated tests that confirm expected behavior and catch exceptions, helping maintain code reliability throughout development.

We'll cover the following...

Unit tests

Previously, we learned how the versioning control tool is used throughout the development process. Now, let’s look at what we do when the code is written, as well as how we can make sure that it’s working before we push it to the central repository. It’s now time for unit testing!

Testing our code is essential so that we can verify that it does what it should. We’ll also use tests to make sure that any changes we make to the code haven’t made things that previously worked stop working or behave in an undesired way.

Several kinds of testing can be done on our code, and the first type of test we’ll ...