Cecelia Martinez
Refactr.Tech 2021
@ceceliacreates
✅ Unit tests cover individual units of your code.
✅ API tests cover endpoint functionality.
Typically easy and fast to write
Can address edge cases that are hard to replicate in production
A lot of tests required for full application coverage
No guarantee the individual units will work together
✅ Integration tests cover the relationship between parts of your code.
✅ Contract testing covers your application’s connection to external APIs or microservices.
Confirm important implementations function as expected
Ensures changes in one part of the application don’t break another area
Useful for critical functionality of the application
✅ Component tests cover the components of your application, ensuring they handle different props appropriately and render as expected.
Particularly critical for multi-use components leveraged across your application
Relevant for modern component-based frameworks like React, Angular, and Vue
Don't address user flows across components
Confirm the application looks as expected
Ensure the application works for your user
Prevent bugs/regressions in production
Reduce developer time spent on debugging
Have confidence in deployments
✅ Visual and functional end-to-end tests cover your application like a user would.
“While E2E tests may be slower and more expensive than unit tests, they bring you much more confidence that your application is working as intended.”
- Kent C. Dodds (https://kentcdodds.com/blog/write-tests)
Can achieve high application coverage with fewer tests
Check application functionality and appearance at the same time with visual testing tools
Keep your user happy and critical application paths working
Modern tooling makes writing end-to-end tests faster and easier
✅ Visual and functional end-to-end tests cover your application like a user would.
Cecelia Martinez
Refactr.Tech 2021
@ceceliacreates