Improving the Acceptance Tests
Can we improve our acceptance tests? Even in small tests there are some issues, which will be much more evident when we work on more complicated use-cases.
Ideally:
-
Our acceptance tests should only use domain terms, and they should avoid mentioning technical details, like the UI elements (“click on X button”) or the transmission protocol (“assert that header Y is present”).
-
Each test should represent a use-case scenario; all tests in a file will form a user-story.
-
Tests should focus on the use-case actors and their interactions.
-
Assertions should be represented by methods with clear domain names, leaving the actual implementation out of the test itself, since they can be quite complicated to read.
Let’s see how, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access