COR[R]ECT: [R]eference
Explore how to effectively test methods by evaluating their external references and dependencies using the CORRECT principle. Understand preconditions and postconditions to design thorough unit tests that verify behavior under varying states and assumptions.
We'll cover the following...
We'll cover the following...
When testing a method, consider:
- What does it reference outside of its scope?
- What external dependencies does it have?
- Does it depend on the object being in a certain state?
- Are there any other conditions that must exist?
A web app that displays a customer’s account history might require the customer to be logged on. The pop() method for ...