Optimizing Setup with TrueStory
In our testing experience, we believe when testing commercial applications, the bulk of the work you’ll do is building setup code, but that’s precisely the code that gets the least amount of attention in a typical test.
Around October of last year, we began working on a testing library called TrueStory.[25] By restructuring our tests using macros into clear areas of responsibility, we can do a better job of writing single-purposed tests.
For this philosophy, we find that a story metaphor works well. We chose to use the noun story to define the setup and run our experiment. In short, we tell a story. Then, in another block called verify, we measure the impact on the real world with straight ExUnit assertions. ...
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