COR[R]ECT: [R]eference
Learn about the importance of using references in writing unit tests.
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 a stack requires a non-empty stack. Shifting a car’s transmission from Drive to Park requires that its first stop.
Get hands-on with 1400+ tech skills courses.