Do you use subcutaneous tests?
Updated by Tiago Araújo [SSW] 2 years ago. See history
Martin Fowler was one of the first people to introduce the concept of subcutaneous tests into the mainstream, though it has failed to gather much momentum. Subcutaneous tests are great for solving problems where automated UI tests have difficulty interacting with the UI or struggle to manipulate the UI in the ways required for the tests we want to write.
Some of the key qualities of these tests are:
- They are written by developers (typically using the same framework as the unit tests)
- They can test the full underlying behaviour of your app, but bypass the UI
- They require business logic to be implemented in an API / middle layer and not in the UI
- They can be much easier to write than using technologies that drive a UI, e.g. Playwright or Selenium
The Introduction To Subcutaneous Testing by Melissa Eaden provides a good overview of this approach.
Integrate with DevOps
The gold standard ⭐ is to automatically run subcutaneous tests inside your DevOps processes such as when you perform a Pull Request or a build. You can do this using GitHub Actions or Azure DevOps.
Every test should reset the database so you always know your resources are in a consistent state.

✅ Figure: Good example - Define your workflows in yml files and containerize your testing

✅ Figure: Good example - Your tests can then run in your DevOps pipelines
Jason Taylor has a fantastic example of Subcutaneous testing in his Clean Architecture template.
Categories
Need help?
SSW Consulting has over 30 years of experience developing awesome software solutions.