At Amplified Development, we are strong proponents of using examples liberally in your specifications. Examples just make requirements better.
The main objection to examples is that they make test implementation more difficult. This is true; but, the level of difficulty may depend on your strategy for test data. (Test data strategies deserve a discussion of their own.) But, regardless, you should work to overcome or mitigate the difficulties, because examples are just so important to good requirements.
So, why are examples so wonderful?
- Examples ensure you are on the same page. Have you ever had a discussion about requirements where, after investing quite a bit of time, you discover you aren't talking about precisely the same thing? No? Then, I'm guessing you haven't worked on many requirements. As soon as you introduce an example, such misunderstandings get revealed.
- Examples promote exploration. When a requirement is expressed with an example, there is a strong tendency for stakeholders to raise other examples with interesting variations. True, even without examples, it is possible to have a discussion of variations and exception conditions. But, without examples, focus is given to the phrasing of the rule and the exploration of variations often suffers. Its just human nature: give an example and someone will offer another.
- Examples can clarify boundary conditions. Without examples, you can try to express a rule with precision. But, there is nothing like stating which date is in range and which is not, which number is under the limit and which is over.
As we explore specific ideas for delightful requirements, you will see this theme over and over: Examples are your friend!