Truth Tables help writing readable tests that are easy to maintain.
Here is an example:
You can also use a hash if you like hash rockets:
And you can go crazy with multiple inputs and outputs:
In my opinion, Truth Tables are really easy to read and they are also great to maintain. Adding a new test case takes a couple of seconds and does not impact readability. Here are a few more examples:
Alright, what do you think about all this? Are Truth Tables easy to read? Did I convince you to write tests with Truth Tables? Or maybe you already use Truth Tables and I missed something… And yes, I can write another sentence with Truth Tables, and in bold this time! :) Leave a comment below, I’m always happy to discuss it!