-
Notifications
You must be signed in to change notification settings - Fork 0
Typology
Aka "Test pyramid"
Types
- Unit
- Integration
- Acceptance
- End to end (E2E)
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
- 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
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).
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.
Source here:
Overview:
- unit
- component
- contract
- integration
- end to end
- functional / acceptance
Schema here
Test component, mocking collaborators - exclude component with annotation / glue / conf => don't assert external calls, test BR
- Mockito (no Spring ?)
Schema here
Test component boundary, still with no real collaborators (crossroad on unit & integration) - validate glue and config:
- in-memory DB for repo
- HTTP (not using network)
- out: Wiremock for client
- in: WebMvcTest for controller
- Spring: use SpringBootTest with classes names
Schema here Check consumer/producer contact (eg. openAPi contract) in semi-isolation (use stub)
- Spring Cloud Contract verifier
- PACT
Schema here
Check component communicate with REAL collaborators (do not check parameter or results, check that collaborator has ben called)
- Spring runner, @SpringBootTest with no class
Schema here
Integration between ALL components: assert wiring, not BR
- GUI: selenium
- API: rest-assure
Schema here
Smoke test on happy path => build confidence so business know BR regression testing is done in unit tests
- cucumber