4.2. Hyperassertions
A hyperassertion is one that’s so scrupulous in nailing down every detail about the behavior it’s checking that it becomes brittle and hides its intent under its overwhelming breadth and depth. When you encounter a hyperassertion, it’s hard to say what exactly it’s supposed to check, and when you step back to observe, that test is probably breaking far more frequently than the average. It’s so picky that any change whatsoever will cause a difference in the expected output.
Let’s make this discussion more concrete by looking at an example test that suffers from this condition.
4.2.1. Example
The following example is my own doing. I wrote it some years back as part of a sales-presentation tracking system for a medical corporation. ...
Get Effective Unit Testing now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.