In a new post to his site Nikola Poša has suggested some testing conventions he's worked up over his time in development across projects.
Testing is an essential aspect of development, and test code should be treated the same way with regard to defining and using coding conventions and standards.This time I would like to share few conventions that I follow when writing unit tests in particular, some of which I adopted only recently.
He breaks it down into three main sections:
- Structure (file locations and namespacing)
- Naming (files and testing methods)
- Arrange-Act-Assert with exceptions and test doubles
Example code is included showing the concepts and implementation of the suggested convention, just to name a few.