Skip to content

Simple project to apply Test Pyramid methodology together with Clean Architecture

Notifications You must be signed in to change notification settings

ricardo-comar/test-pyramid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test-pyramid

Simple project to apply Test Pyramid methodology together with Clean Architecture Test Pyramid There are some code samples showing how to test on each layer of the pyramid, from bottom to top, and how each layer exercises a real component or use an emulated one:


5th layer - Unit Tests

Test Pyramid The Business Class (or Utility Class) to be tested has all its internal objects emulated with a Mock instance (expected input and output defined on Test Class), and widely tested to cover all input variations and expected results. Examples:


4th layer - Integration

Integration The Business Class to be tested has all its Integration Resorces (Data Provider, or even a External Resource Client) executed with the real instances, and the final resource emulated with an on-memory database (like H2) initialized right before the Test, and discarded at end, or emulated with a WireMock instance with expected requests and payloads. In this layer the tests have less scenarios, only covering the external resource's variations. Examples:


3rd layer - Component

Component The role application is tested calling all it's entrypoints, but still emulating external resources (like example above). In this layer the tests have fewer scenarios, only covering the entrypoints input and output variations. Examples:


2nd layer - End-to-End

Test Pyramid The role application is tested in a dedicated environment, where all external resources are real, most similar to production environment as it's possible. In this layer the tests are still made with an automated tool, but only cover the scenarios where the data has a state.


1st layer - Exploratory

Test Pyramid The role application is tested in a dedicated environment, where all external resources are real, most similar to production environment as it's possible. In this layer the tests are usualy made by a human, on pre-defined scenarios based on final user experience.


References

About

Simple project to apply Test Pyramid methodology together with Clean Architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published