Skip to content

Instantly share code, notes, and snippets.

@blzaugg
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blzaugg/6d60cbecd7f0f347eb7a to your computer and use it in GitHub Desktop.
Save blzaugg/6d60cbecd7f0f347eb7a to your computer and use it in GitHub Desktop.

Types of Tests

Unit

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.

Integration

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?

Functional

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment