Right-B[I]CEP: Checking Inverse Relationships
Learn about writing the unit tests with the inverse relationship technique.
We'll cover the following...
Logical inverse relationships
Sometimes, we’ll be able to check behavior by applying its logical inverse. For mathematical computations, this is often the case. We can:
- Verify division with multiplication
- Verify addition with subtraction
Implementation of the square-root function
Let’s take a look at the square-root function using Newton’s algorithm.
Remember that ...