Inside the paradigm of Software Testing, there are a variety of techniques that are applied for evaluating all kinds of aspects from a software. Here, I present Unit Testing, which is part of the Functional Testing category, which in a nutshell, is a type of test for evaluating functionality of a code.
Here's as an example:
A separate module called calculation_test.py was defined for testing the example above:
Basically, this module contains a class called Probe which inherits the class TestCase from unittest module and for each method defined in Probe, a specific inherited method (e.g.: assertEqual()) is called, in order to evaluate the functionality of each method from Calc, defining specific inputs and expected outputs for each method.
As you can see, Unit Testing is one of the cornerstones of Software Testing,in order to evaluate the behavior of our code (Business Requirements VS Expected Output) for identifying possible bugs and providing and efficient approach for developing reliable softwares.