Before we start writing any test, it is important that we understand the concepts related to testing and more particularly to each of the available methodologies.
The idea behind unit testing is writing tests for certain areas (units) of our code, so we can verify that the code works as expected and that function is returning expected values.
Unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use.
Another advantage of writing unit tests is that by performing the test, so we are more likely to write code that is easier to test.
This means our code tends to be broken down into smaller but more specialized functions as we continue to write more and more tests. We start building a test suite that can be run against our codebase every time we introduce changes or functionalities; this...