eg. With simulated state/input, call one method. Compare result with expectation.
Ensures the method does what the programmer expects
- Smallest independent unit of code.
- No calls to, non-trivial collaborators (methods, IO, DB).
- Written by developers, for developers, from the developer's perspective.
- Changes frequently within major/minor releases.
eg. Call the delete method; the item is removed from the DB; the view is updated to reflect the change.
Ensures the combined units of code work as the programmer expects.
- Not limited to scope, architectural layers, or dependencies.
- Written by developers, for developers, from the developer's perspective.
- How often can this change?
eg. User clicks [Add to Cart]; the item is added to the cart; the totals update.
Ensures the programmer is building what the stakeholder/customer/user expects.
- Smallest usable feature (action, display, etc.) the system can preform.
- Not limited to scope, architectural layers, or dependencies.
- Written by developers, together with stakeholder/customer, for users, from the user's perspective.
- Should never change within a major release.
- Could be a User Story.