Tests and Testability

06 Feb 2025

[ test  design  interface  development  ]

Unit Tests

What component is tested?

Tests component in isolation, with external dependencies stubbed out

What behaviours are tested?

Happy and unhappy paths

What is the goal?

Verifies that component/class does what is expected

What is mocked out?

Other components and classes

Integration tests

What component is tested?

Component that is running in the expected environment

What behaviours are tested?

Happy paths. Unhappy paths can be difficult to test.

What is the goal?

Verifies that component behaves as expected for its expected use case

What is mocked out?

Other executables or system level dependencies

System tests

What component is tested?

Executable deployed to a test environment

What behaviours are tested?

Happy paths.

What is the goal?

Verifies functionality when integrated to a production-like system

What is mocked out?

Nothing

Design for testability

Additional considerations

Techniques

Generalized mocking and testing

References