A Simple Template for Better Tests

Ever tried to fix a failing unit test that is hard to understand because it has no meaningful name and consists of 20+ lines of code?

Then have a look at the test template explained by Paul Szulc in “Test template you should always use“.

By following a simple naming convention and using a few keywords you are somewhat forced to write clean, focused tests, each one according to a single required behavior of the target system.

At the end, tools like TestDox (or a simple sed script :-)) should even be able to produce a reasonable documentation of the behavior of the system components.

Short URL for this post: https://wp.me/p4nxik-55
This entry was posted in Build, config and deploy, Java and Quality and tagged , . Bookmark the permalink.