In the previous three posts (#1, #2, #3), we’ve considered misconceptions about what it means when you get 100% MC/DC. In this post, we’ll take a slightly different tack, namely considering how to get to 100%.
If you are getting less than 100% MC/DC despite having tested 100% of your requirements, what should you do?
Certainly, you need to have sufficient tests to achieve MC/DC. One way to do that is to try to achieve 100% requirements coverage, and then see what MC/DC was not tested.
Once you have this information in hand, what you should not do is to simply come up with some extra tests and add them to the test suite. Instead, you need to determine why the MC/DC test vectors that were needed are not actually present. For example, things that you might consider include:
- Is there some mode change or error condition that isn't yet implemented?
- Is there some part of the code that isn't represented properly in the requirements?
- Are there some constants that have incorrect definitions that mean some parts of the condition aren't coverable for MC/DC?
From this review, you can justifiably update requirements and provide traceability to the additional test cases.
Doing this type of review illustrates some of the real benefit that comes from using MC/DC – it is not merely a mechanical check, but it also guides your thinking on how to improve the completeness of your requirements.