In any program which is bigger than arithmetic operations, programmers should make themselves comfortable when it is possible to ensure that new changes are not breaking old functionalities.
The most common technique for this is unit testing, which is where the programmer tests the functionality of the code in parallel with its development by creating a test code which will verify that the code really satisfies their requirements.
The theme of this section will be introducing tools for unit testing in Scala.
Adding a Test to Our Project
Let's add tests
to our small program. We'll import
<for-students/lesson1/2-project> in our IDE.
This is the directory schema of a Scala project. For adding tests, we should do the following:
- Add test ...