Skip to content

Typology

GradedJestRisk edited this page Mar 4, 2020 · 6 revisions

Table of Contents

Overview

Aka "Test pyramid"

Types

  • Unit
  • Integration
  • Acceptance
  • End to end (E2)

Unit

Definition

Fowler on unit tests

List:

  • low-level, focusing on a small part of the software system
  • usually written these days by the programmers themselves
  • expected to be significantly faster than other kinds of tests
Unit:
  • OO design tends to treat a class
  • procedural or FP might consider a single function
  • a bunch of closely related classes
  • it's a situational thing - the team decides what makes sense

Styles

List:

  • mockist: solitary test (do NOT talk to real code when in test);
  • classic: social test (do NOT talk to real code when in test).
"We write the tests assuming everything other than that unit is working correctly, unless communicating with the collaborators was awkward (such as a remote credit card verification system)." => Classic

Fowler on unit test style

Integration

Definition

Fowler on integration tests

Involve test double. If external services are involved, consider adding Contract tests to ensure the test double has the same behaviour as the external service.

Clone this wiki locally