On Sat, Sep 24, 2011 at 04:58:35AM +0300, Sami Liedes wrote: > On Fri, Sep 23, 2011 at 09:17:43PM -0400, Richard Hipp wrote: > > ---------------------- > > 1. Structural coverage guidelines are: > > a) Every statement in the program has been invoked at least once; > > b) Every point of entry and exit in the program has been invoked at least > > once; > > c) Every control statement (i.e., branchpoint) in the program has taken > > all possible outcomes (i.e., branches) at least once; > > d) Every non-constant Boolean expression in the program has evaluated to > > both a True and a False result; > > e) Every non-constant condition in a Boolean expression in the program has > > evaluated to both a True and a False result; > > f) Every non-constant condition in a Boolean expression in the program has > > been shown to independently affect that expression's outcome. > > 2. Based upon these definitions: > > • Statement Coverage requires (a) only > > • DC requires (b, c, d) > > • MC/DC requires (b, c, d, e, f) > > ----------------------
Very well. NASA has an example with short-circuit where they treat unevaluated conditions as "don't cares". It's clear from the example that (e) still does not suffice -- it does *not* imply (f). NASA's A Practical Tutorial on Modified Condition/ Decision Coverage: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.6.1317&rep=rep1&type=pdf The example is a four-input AND gate with short-circuit logic (_ = don't care/not evaluated). This would be a sufficient set of tests: expression = (A && B && C && D) # A B C D Result 1 1 1 1 1 1 2 0 _ _ _ 0 3 1 0 _ _ 0 4 1 1 0 _ 0 5 1 1 1 0 0 Am I correct that your approach would consider these two test cases sufficient? # A B C D Result 1 1 1 1 1 1 2 0 0 0 0 0 Right? But with these test cases, assuming short-circuit, only condition A has been shown to "independently affect the expression's outcome". The NASA document correctly points out that even with short-circuit you need to show that each of the conditions really matters in some case if you want MC/DC coverage. Sami _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users