<?xml version="1.0" encoding="UTF-8"?>
<org.eclipse.epf.uma:ContentDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:org.eclipse.epf.uma="http://www.eclipse.org/epf/uma/1.0.6/uma.ecore" xmlns:epf="http://www.eclipse.org/epf" epf:version="1.5.1" xmi:id="-FX8hDYUKOXsrQulFe9lwtw" name="test_ideas_for_booleans_and_boundaries,1.7150344523489172E-305" guid="-FX8hDYUKOXsrQulFe9lwtw" changeDate="2006-11-22T03:25:18.633+0330" version="1.0.0">
  <mainDescription>&lt;a id=&quot;XE_test__developer_testing__test_ideas__for_booleans_and_boundaries&quot; name=&quot;XE_test__developer_testing__test_ideas__for_booleans_and_boundaries&quot;>&lt;/a>&lt;a id=&quot;XE_test-ideas__for_booleans_and_boundaries&quot; name=&quot;XE_test-ideas__for_booleans_and_boundaries&quot;>&lt;/a>&lt;a id=&quot;XE_design__developer_testing__test_ideas__for_booleans_and_boundaries&quot; name=&quot;XE_design__developer_testing__test_ideas__for_booleans_and_boundaries&quot;>&lt;/a> &#xD;
&lt;h3>&#xD;
    &lt;a id=&quot;Introduction&quot; name=&quot;Introduction&quot;>&lt;/a>Introduction&#xD;
&lt;/h3>&#xD;
&lt;p>&#xD;
    Test ideas are based on &lt;a href=&quot;./../../../glossary/glossary.htm#fault_model&quot; target=&quot;_blank&quot;>fault models&lt;/a>,&#xD;
    notions of which faults are plausible in software and how those faults can best be uncovered. This guideline shows how&#xD;
    to create test ideas from boolean and relational expressions. It first motivates the techniques by looking at code,&#xD;
    then describes how to apply them if the code hasn't been written yet or is otherwise unavailable.&#xD;
&lt;/p>&#xD;
&lt;h3>&#xD;
    &lt;a id=&quot;BooleanExpressions&quot; name=&quot;BooleanExpressions&quot;>&lt;/a>&lt;b>Boolean Expressions&lt;/b>&#xD;
&lt;/h3>&#xD;
&lt;p>&#xD;
    Consider the following code snippet, taken from an (imaginary) system for managing bomb detonation. It's part of the&#xD;
    safety system and controls whether the &quot;detonate bomb&quot; button push is obeyed.&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
if (publicIsClear || technicianClear) {&#xD;
    bomb.detonate();&#xD;
}&#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    The code is wrong. The &lt;font size=&quot;+0&quot;>||&lt;/font> should be an &lt;font size=&quot;+0&quot;>&amp;amp;&amp;amp;&lt;/font>. That mistake will have&#xD;
    bad effects. Instead of detonating the bomb when both the bomb technician and public are clear, the system will&#xD;
    detonate when &lt;i>either&lt;/i> is clear.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    What test would find this bug?&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    Consider a test in which the button is pushed when both the technician and public are clear. The code will allow the&#xD;
    bomb to be detonated. But-and this is important-the &lt;i>correct&lt;/i> code (the one that uses an &lt;font     size=&quot;+0&quot;>&amp;amp;&amp;amp;&lt;/font>) would do the same. So the test is useless at finding this fault.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    Similarly, this incorrect code behaves correctly when both the technician and public are next to the bomb: the bomb is&#xD;
    not detonated.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    To find the bug, you have to have a case in which the code as written evaluates differently than the code that should&#xD;
    have been written. For example, the public must be clear, but the bomb technician is still next to the bomb. Here are&#xD;
    all the tests in table form:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;100%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        publicIsClear&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        technicianClear&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        Code as written...&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        Correct code would have...&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th width=&quot;20%&quot;>&#xD;
                    &amp;nbsp;&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#008000&quot;>detonates&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#008000&quot;>detonated&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        test is useless (for this fault)&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>detonates&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>not detonated&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        useful test&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>detonates&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>not detonated&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        useful test&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#008000&quot;>does not detonate&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#008000&quot;>not detonated&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;20%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        test is useless (for this fault)&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    The two middle tests are both useful for finding this particular fault. Note, however, that they're redundant: since&#xD;
    either will find the fault, you needn't run both.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    There are other ways in which the expression might be wrong. Here are two lists of common mistakes in boolean&#xD;
    expressions. The faults on the left are all caught by the technique discussed here. The faults on the right might not&#xD;
    be. So this technique doesn't catch all the faults we might like, but it's still useful.&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;right&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;100%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;b>Faults detected&lt;/b>&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;b>Faults possibly not detected&lt;/b>&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    Using wrong operator: a &lt;font color=&quot;#ff0000&quot;>&lt;b>||&lt;/b>&lt;/font> b should be a&lt;font                     color=&quot;#ff0000&quot;>&lt;b>&amp;amp;&amp;amp;&lt;/b>&lt;/font>b&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    Wrong variable used: a&amp;amp;&amp;amp;&lt;font color=&quot;#ff0000&quot;>&lt;b>b&lt;/b>&lt;/font>&amp;amp;&amp;amp;c should be a&amp;amp;&amp;amp;&#xD;
                    &lt;font color=&quot;#ff0000&quot;>&lt;b>x&lt;/b>&lt;/font>&amp;amp;&amp;amp;d&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    Negation is omitted or incorrect: a||b should be &lt;font color=&quot;#ff0000&quot;>&lt;b>!&lt;/b>&lt;/font>a||b, or &lt;font                     color=&quot;#ff0000&quot;>&lt;b>!&lt;/b>&lt;/font> a||b should be a||b&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    Expression is too simple: a&amp;amp;&amp;amp;b should be a&amp;amp;&amp;amp;b&lt;font                     color=&quot;#ff0000&quot;>&lt;b>&amp;amp;&amp;amp;c&lt;/b>&lt;/font>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    The expression is misparenthesized: a&amp;amp;&amp;amp;b||c should be a&amp;amp;&amp;amp;&lt;font                     color=&quot;#ff0000&quot;>&lt;b>(&lt;/b>&lt;/font>b||c&lt;font color=&quot;#ff0000&quot;>&lt;b>)&lt;/b>&lt;/font>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    Expressions with more than one of the faults in the left column&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    The expression is overly complex: a&amp;amp;&amp;amp;b&lt;b>&amp;amp;&amp;amp;c&lt;/b> should be &lt;font                     size=&quot;+0&quot;>a&amp;amp;&amp;amp;b&lt;br />&#xD;
                    &lt;/font> (This fault is not so likely, but is easy to find with tests useful for other reasons.)&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &amp;nbsp;&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    How are these ideas used? Suppose you're given a boolean expression like &lt;font size=&quot;+0&quot;>a&amp;amp;&amp;amp;!b&lt;/font>. You&#xD;
    could construct a truth table like this one:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;right&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;100%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        a&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        b&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        a&amp;amp;&amp;amp;!b&lt;br />&#xD;
                         (code as written)&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        maybe it should be&lt;br />&#xD;
                         a&lt;font color=&quot;#ff0000&quot;>&lt;b>||&lt;/b>&lt;/font>!b&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        maybe it should be&lt;br />&#xD;
                         &lt;font color=&quot;#ff0000&quot;>&lt;b>!&lt;/b>&lt;/font>a&amp;amp;&amp;amp;!b&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        maybe it should be&lt;br />&#xD;
                         a&amp;amp;&amp;amp;b&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        ...&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>true&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>true&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        ...&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>false&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        ...&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        ...&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>true&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;14%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>true&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;15%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        ...&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    If you crunched through all the possibilities, you'd find that the first, second, and fourth possibilities are all&#xD;
    that's needed. The third expression will find no faults that won't be found by one of the others, so you needn't try&#xD;
    it. (As the expressions grow more complicated, the savings due to unneeded cases grow quickly.)&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    Of course, no one sane would build such a table. Fortunately, you don't have to. It's easy to memorize the required&#xD;
    cases for simple expressions. (See the next section.) For more complex expressions, such as &lt;font     size=&quot;+0&quot;>A&amp;amp;&amp;amp;B||C&lt;/font>, see &lt;a href=&quot;../../examples/extrnlcntrbtns/test/tstatmtch.htm&quot; target=&quot;_blank&quot;>Test&#xD;
    Ideas for Mixtures of ANDs and ORs&lt;/a>, which lists test ideas for expressions with two or three operators. For even&#xD;
    more complex expressions, a &lt;a href=&quot;http://www.testing.com/tools/multi/README.html&quot; target=&quot;_blank&quot;>program&lt;/a> can be&#xD;
    used to generate test ideas.&#xD;
&lt;/p>&#xD;
&lt;h3>&#xD;
    &lt;a id=&quot;SimpleExpressionTables&quot; name=&quot;SimpleExpressionTables&quot;>&lt;/a>&lt;b>Tables for Simple Boolean Expressions&lt;/b>&#xD;
&lt;/h3>&#xD;
&lt;p>&#xD;
    If the expression is &lt;font size=&quot;+0&quot;>A&amp;amp;&amp;amp;B&lt;/font>, test with:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        B&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    If the expression is &lt;font size=&quot;+0&quot;>A||B&lt;/font>, test with:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        B&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;50%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    If the expression is &lt;font size=&quot;+0&quot;>A&lt;sub>1&lt;/sub> &amp;amp;&amp;amp; A&lt;sub>2&lt;/sub> &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&#xD;
    A&lt;sub>n&lt;/sub>&lt;/font>, test with:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>1,&lt;/sub> A&lt;sub>2&lt;/sub>, ..., and A&lt;sub>n&lt;/sub> are all true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>1&lt;/sub> is false, all the rest are true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>2&lt;/sub> is false, all the rest are true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        ...&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>n&lt;/sub> is false, all the rest are true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p align=&quot;left&quot;>&#xD;
    If the expression is &lt;font size=&quot;+0&quot;>A&lt;sub>1&lt;/sub> || A&lt;sub>2&lt;/sub> || ... || A&lt;sub>n&lt;/sub>&lt;/font>, test with:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>1,&lt;/sub> A&lt;sub>2&lt;/sub>, ..., and A&lt;sub>n&lt;/sub> are all false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>1&lt;/sub> is true, all the rest are false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>2&lt;/sub> is true, all the rest are false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        ...&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&lt;sub>n&lt;/sub> is true, all the rest are false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    If the expression is &lt;font size=&quot;+0&quot;>A&lt;/font>, test with:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    So, when you need to test &lt;font size=&quot;+0&quot;>a&amp;amp;&amp;amp;!b&lt;/font>, you can apply the first table above, invert the sense&#xD;
    of b (because it's negated), and get this list of &lt;a class=&quot;elementLinkWithUserText&quot; href=&quot;./../../../xp/guidances/concepts/test-ideas_list.html&quot; guid=&quot;8.834380241450745E-306&quot;>Test&#xD;
    Ideas&lt;/a>:&#xD;
&lt;/p>&#xD;
&lt;ul>&#xD;
    &lt;li>&#xD;
        A true, B false&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        A true, B true&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        A false, B false&#xD;
    &lt;/li>&#xD;
&lt;/ul>&#xD;
&lt;h3>&#xD;
    &lt;a id=&quot;RelationalExpressions&quot; name=&quot;RelationalExpressions&quot;>&lt;/a>&lt;b>Relational Expressions&lt;/b>&#xD;
&lt;/h3>&#xD;
&lt;p align=&quot;left&quot;>&#xD;
    Here's another example of code with a fault:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
if (finished &amp;lt; required) {&#xD;
    siren.sound();&#xD;
}&#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p align=&quot;left&quot;>&#xD;
    The &lt;font size=&quot;+0&quot;>&amp;lt;&lt;/font> should be a &lt;font size=&quot;+0&quot;>&amp;lt;=&lt;/font>. Such mistakes are fairly common. As with&#xD;
    boolean expressions, you can construct a table of test values and see which ones detect the fault:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        finished&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        required&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        code as written...&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        the correct code would have...&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        1&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        5&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        sounds the siren&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        sounded the siren&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        5&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        5&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>does not sound the siren&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        &lt;font color=&quot;#ff0000&quot;>sounded the siren&lt;/font>&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        5&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        1&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        does not sound the siren&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        not sounded the siren&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    More generally, the fault can be detected whenever &lt;font size=&quot;+0&quot;>finished=required&lt;/font>. From analyses of plausible&#xD;
    faults, we can get these rules for test ideas:&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    If the expression is A&amp;lt;B or A&amp;gt;=B, test with&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A=B&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A slightly less than B&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    If the expression is A&amp;gt;B or A&amp;lt;=B, test with&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A=B&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;100%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        A slightly larger than B&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    What does &quot;slightly&quot; mean? If A and B are integers, A should be one less than or larger than B. If they are floating&#xD;
    point numbers, A should be a number quite close to B. (It's probably not necessary that it be the the closest floating&#xD;
    point number to B.)&#xD;
&lt;/p>&#xD;
&lt;h3>&#xD;
    &lt;a id=&quot;CombinedExpressions&quot; name=&quot;CombinedExpressions&quot;>&lt;/a>&lt;b>Rules for Combined Boolean and Relational Expressions&lt;/b>&#xD;
&lt;/h3>&#xD;
&lt;p>&#xD;
    Most relational operators occur within boolean expressions, as in this example:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
if (finished &amp;lt; required) {&#xD;
    siren.sound();&#xD;
}&#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    The rules for relational expressions would lead to these test ideas:&#xD;
&lt;/p>&#xD;
&lt;ol>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>finished&lt;/font> is equal to required&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>finished&lt;/font> is slightly less than &lt;font size=&quot;+0&quot;>required&lt;/font>&#xD;
    &lt;/li>&#xD;
&lt;/ol>&#xD;
&lt;p>&#xD;
    The rules for boolean expressions would lead to these:&#xD;
&lt;/p>&#xD;
&lt;ol>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>finished &amp;lt; required&lt;/font> should be true&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>finished &amp;lt; required&lt;/font> should be false&#xD;
    &lt;/li>&#xD;
&lt;/ol>&#xD;
&lt;p>&#xD;
    But if &lt;font size=&quot;+0&quot;>finished&lt;/font> is slightly less than &lt;font size=&quot;+0&quot;>required&lt;/font>, &lt;font size=&quot;+0&quot;>finished&#xD;
    &amp;lt; required&lt;/font> is true, so there's no point in writing down the latter.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    And if &lt;font size=&quot;+0&quot;>finished&lt;/font> equals &lt;font size=&quot;+0&quot;>required&lt;/font>, &lt;font size=&quot;+0&quot;>finished &amp;lt;&#xD;
    required&lt;/font> is false, so there's no point in writing down that latter one either.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    So, &lt;b>if a relational expression contains no boolean operators (&lt;font size=&quot;+0&quot;>&amp;amp;&amp;amp;&lt;/font> and &lt;font     size=&quot;+0&quot;>||&lt;/font>), ignore the fact that it's also a boolean expression.&lt;/b>&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    Things are a bit more complicated with combinations of boolean and relational operators, like this one:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
if (count&amp;lt;5 || always) {&#xD;
   siren.sound();&#xD;
}&#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    From the relational expression, you get:&#xD;
&lt;/p>&#xD;
&lt;ul>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count&lt;/font> slightly less than 5&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count&lt;/font> equal to 5&#xD;
    &lt;/li>&#xD;
&lt;/ul>&#xD;
&lt;p>&#xD;
    From the boolean expression, you get:&#xD;
&lt;/p>&#xD;
&lt;ul>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count&amp;lt;5&lt;/font> true, always false&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count&amp;lt;5&lt;/font> false, always true&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count&amp;lt;5&lt;/font> false, always false&#xD;
    &lt;/li>&#xD;
&lt;/ul>&#xD;
&lt;p>&#xD;
    These can be combined into three more specific test ideas. (Here, note that &lt;font size=&quot;+0&quot;>count&lt;/font> is an&#xD;
    integer.)&#xD;
&lt;/p>&#xD;
&lt;ol>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count=4&lt;/font>, always false&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count=5&lt;/font>, always true&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count=5&lt;/font>, always false&#xD;
    &lt;/li>&#xD;
&lt;/ol>&#xD;
&lt;p>&#xD;
    Notice that &lt;font size=&quot;+0&quot;>count=5&lt;/font> is used twice. It might seem better to use it only once, to allow the use of&#xD;
    some other value-after all, why test &lt;font size=&quot;+0&quot;>count&lt;/font> with 5 twice? Wouldn't it be better to try it once&#xD;
    with 5 and another time with some other value such that &lt;font size=&quot;+0&quot;>count&amp;lt;5&lt;/font> is false? It would be, but&#xD;
    it's dangerous to try. That's because it's easy to make a mistake. Suppose you tried the following:&#xD;
&lt;/p>&#xD;
&lt;ol>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count=4&lt;/font>, always false&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>count=5&lt;/font>, always true&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        &lt;font size=&quot;+0&quot;>&lt;b>count&amp;lt;5&lt;/b>&lt;/font> &lt;b>false&lt;/b>, &lt;font size=&quot;+0&quot;>always&lt;/font> false&#xD;
    &lt;/li>&#xD;
&lt;/ol>&#xD;
&lt;p>&#xD;
    Suppose that there's a fault that can &lt;i>only&lt;/i> be caught with &lt;font size=&quot;+0&quot;>count=5&lt;/font>. What that means is&#xD;
    that the value 5 will cause &lt;font size=&quot;+0&quot;>count&amp;lt;5&lt;/font> to produce false in the second test, when the correct&#xD;
    code would have produced true. However, that false value is immediately or'd with the value of always, which is true.&#xD;
    That means the value of the whole expression is correct, even though the value of the relational subexpression was&#xD;
    wrong. The fault will go undiscovered.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    The fault doesn't go undiscovered if it's the &lt;i>other&lt;/i> count=5 that is left less specific.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    Similar problems happen when the relational expression is on the right-hand side of the boolean operator.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    Because it's hard to know which subexpressions have to be exact and which can be general, it's best to make them all&#xD;
    exact. The alternative is to use the &lt;a href=&quot;http://www.testing.com/tools/multi/README.html&quot; target=&quot;_blank&quot;>boolean&#xD;
    expression program&lt;/a> mentioned above. It produces correct test ideas for arbitrary mixed boolean-and-relational&#xD;
    expressions.&#xD;
&lt;/p>&#xD;
&lt;h3>&#xD;
    &lt;a id=&quot;TestIdeasWithoutCode&quot; name=&quot;TestIdeasWithoutCode&quot;>&lt;/a>&lt;b>Test ideas without Code&lt;/b>&#xD;
&lt;/h3>&#xD;
&lt;p>&#xD;
    As explained in &lt;a class=&quot;elementLinkWithType&quot; href=&quot;./../../../xp/guidances/concepts/test-first_design.html&quot; guid=&quot;6.556259235358794E-306&quot;>Concept: Test-first Design&lt;/a>, it's usually preferable to design tests before&#xD;
    implementing code. So, although the techniques are motivated by code examples, they'll usually be applied without code.&#xD;
    How?&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    Certain design artifacts, such as statecharts and sequence diagrams, use boolean expressions as guards. Those cases are&#xD;
    straightforward-simply add the test ideas from the boolean expressions to the artifact's test idea checklist. See &lt;a class=&quot;elementLinkWithUserText&quot; href=&quot;./../../../xp/guidances/guidelines/test_ideas_for_statechart_and_flow_diagrams.html&quot; guid=&quot;1.0347051690476123E-305&quot;>Guideline: Test Ideas for Statechart and Activity Diagrams&lt;/a>.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    The trickier case is when boolean expressions are implicit rather than explicit. That's often the case in descriptions&#xD;
    of APIs. Here's an example. Consider this method:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
List matchList(Directory d1, Directory d1,&#xD;
       FilenameFilter excluder);&#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    The description of this method's behavior might read like this:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
    &lt;p>&#xD;
        Returns a List of the absolute pathnames of all files that appear in both Directories. Subdirectories are&#xD;
        descended. [...] Filenames that match the &lt;font size=&quot;+0&quot;>excluder&lt;/font> are excluded from the returned list. The&#xD;
        excluder only applies to the top-level directories, not to filenames in subdirectories.&#xD;
    &lt;/p>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    The words &quot;and&quot; and &quot;or&quot; do not appear. But when is a filename included in the return list? When it appears in the&#xD;
    first directory &lt;b>and&lt;/b> it appears in the second directory &lt;b>and&lt;/b> it's either in a lower level directory&#xD;
    &lt;b>or&lt;/b> it's not specifically excluded. In code:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
if (appearsInFirst &amp;amp;&amp;amp; appearsInSecond &amp;amp;&amp;amp;&#xD;
    (inLowerLevel || !excluded)) {&#xD;
  add to list&#xD;
}&#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    Here are the test ideas for that expression, given in tabular form:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        appearsInFirst&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        appearsInSecond&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        inLower&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        excluded&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    &lt;br />&#xD;
     The general approach for discovering implicit boolean expressions from text is to first list the actions described&#xD;
    (such as &quot;returns a matching name&quot;). Then write a boolean expression that describes the cases in which an action is&#xD;
    taken. Derive test ideas from all the expressions.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    There's room for disagreement in that process. For example, one person might write down the boolean expression used&#xD;
    above. Another might say that there are really two distinct actions: first, the program discovers matching names, then&#xD;
    it filters them out. So, instead of one expression, there are two:&#xD;
&lt;/p>&#xD;
&lt;dl>&#xD;
    &lt;dt>&#xD;
        discover a match:&#xD;
    &lt;/dt>&#xD;
    &lt;dd>&#xD;
        happens when a file is in the first directory &lt;b>and&lt;/b> a file with the same name is in the second directory&#xD;
    &lt;/dd>&#xD;
    &lt;dt>&#xD;
        filter a match:&#xD;
    &lt;/dt>&#xD;
    &lt;dd>&#xD;
        happens when the matching files are in the top level &lt;b>and&lt;/b> the name matches the &lt;font         size=&quot;+0&quot;>excluder&lt;/font>&#xD;
    &lt;/dd>&#xD;
&lt;/dl>&#xD;
&lt;p>&#xD;
    These different approaches can lead to different test ideas and thus different tests. But the differences are most&#xD;
    likely not particularly important. That is, the time spent worrying about which expression is right, and trying&#xD;
    alternatives, would be better spent on other techniques and producing more tests. If you're curious about what the&#xD;
    sorts of differences might be, read on.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    The second person would get two sets of test ideas.&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
    &lt;p>&#xD;
        test ideas about discovering a match:&#xD;
    &lt;/p>&#xD;
    &lt;ul>&#xD;
        &lt;li>&#xD;
            file in first directory, file in second directory (true, true)&#xD;
        &lt;/li>&#xD;
        &lt;li>&#xD;
            file in first directory, file not in second directory (true, false)&#xD;
        &lt;/li>&#xD;
        &lt;li>&#xD;
            file not in first directory, file in second directory (false, true)&#xD;
        &lt;/li>&#xD;
    &lt;/ul>&#xD;
    &lt;p>&#xD;
        test ideas about filtering a match (once one has been discovered):&#xD;
    &lt;/p>&#xD;
    &lt;ul>&#xD;
        &lt;li>&#xD;
            matching files are in the top level, the name matches the &lt;font size=&quot;+0&quot;>excluder&lt;/font> (true, true)&#xD;
        &lt;/li>&#xD;
        &lt;li>&#xD;
            matching files are in the top level, the name doesn't match the &lt;font size=&quot;+0&quot;>excluder&lt;/font> (true, false)&#xD;
        &lt;/li>&#xD;
        &lt;li>&#xD;
            matching files are in some lower level, the name matches the &lt;font size=&quot;+0&quot;>excluder&lt;/font> (false, true)&#xD;
        &lt;/li>&#xD;
    &lt;/ul>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    Suppose those two sets of test ideas are combined. The ones in the second set only matter when the file is in both&#xD;
    directories, so they can only be combined with the first idea in the first set. That gives us the following:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        file in first directory&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        file in second directory&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        in top level&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        matches excluder&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    Two of the test ideas about discovering a match do not appear in that table. We can add them like this:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        file in first directory&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        file in second directory&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        in top level&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th scope=&quot;col&quot; width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        matches excluder&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    The blank cells indicate that the columns are irrelevant.&#xD;
&lt;/p>&#xD;
&lt;p>&#xD;
    This table now looks rather similar to the first person's table. The similarity can be emphasized by using the same&#xD;
    terminology. The first person's table has a column called &quot;inLower&quot;, and the second person's has one called &quot;in top&#xD;
    level&quot;. They can be converted by flipping the sense of the values. Doing that, we get this version of the second table:&#xD;
&lt;/p>&#xD;
&lt;div align=&quot;center&quot;>&#xD;
    &lt;table     style=&quot;BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid&quot;      cellspacing=&quot;0&quot; bordercolordark=&quot;#808080&quot; cellpadding=&quot;4&quot; width=&quot;85%&quot; bordercolorlight=&quot;#808080&quot; border=&quot;1&quot;>&#xD;
        &lt;tbody>&#xD;
            &lt;tr>&#xD;
                &lt;th width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        appearsInFirst&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        appearsInSecond&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        inLower&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
                &lt;th width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        excluded&#xD;
                    &lt;/p>&#xD;
                &lt;/th>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td width=&quot;25%&quot;>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
            &lt;tr>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        false&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        true&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
                &lt;td>&#xD;
                    &lt;p align=&quot;center&quot;>&#xD;
                        -&#xD;
                    &lt;/p>&#xD;
                &lt;/td>&#xD;
            &lt;/tr>&#xD;
        &lt;/tbody>&#xD;
    &lt;/table>&lt;br />&#xD;
&lt;/div>&#xD;
&lt;p>&#xD;
    The first three rows are identical to the first person's table. The last two differ only in that this version doesn't&#xD;
    specify values that the first does. This amounts to an assumption about the way the code was written. The first assumed&#xD;
    a complicated boolean expression:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
if (appearsInFirst &amp;amp;&amp;amp; appearsInSecond &amp;amp;&amp;amp;&#xD;
    (inLowerLevel || !excluded)) {&#xD;
  add to list&#xD;
}&#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    The second assumes nested boolean expressions:&#xD;
&lt;/p>&#xD;
&lt;blockquote>&#xD;
&lt;pre>&#xD;
if (appearsInFirst &amp;amp;&amp;amp; appearsInSecond) {&#xD;
    // found match.&#xD;
    if (inTopLevel &amp;amp;&amp;amp; excluded) {&#xD;
// filter it&#xD;
    }&#xD;
}     &#xD;
&lt;/pre>&#xD;
&lt;/blockquote>&#xD;
&lt;p>&#xD;
    The difference between the two is that the test ideas for the first detect two faults that the ideas for the second do&#xD;
    not, because those faults don't apply.&#xD;
&lt;/p>&#xD;
&lt;ol>&#xD;
    &lt;li>&#xD;
        In the first implementation, there can be a misparenthesization fault. Are the parentheses around the &lt;font         size=&quot;+0&quot;>||&lt;/font> correct or incorrect? Since the second implementation has no &lt;font size=&quot;+0&quot;>||&lt;/font> and no&#xD;
        parentheses, the fault cannot exist.&#xD;
    &lt;/li>&#xD;
    &lt;li>&#xD;
        The test requirements for the first implementation check whether the second &lt;font size=&quot;+0&quot;>&amp;amp;&amp;amp;&lt;/font>&#xD;
        should be an &lt;font size=&quot;+0&quot;>||&lt;/font>. In the second implementation, that explicit &lt;font         size=&quot;+0&quot;>&amp;amp;&amp;amp;&lt;/font> is replaced by the implicit &lt;font size=&quot;+0&quot;>&amp;amp;&amp;amp;&lt;/font> of the nested &lt;font         size=&quot;+0&quot;>if&lt;/font> statements. There's no &lt;font size=&quot;+0&quot;>||&lt;/font>-for-&lt;font size=&quot;+0&quot;>&amp;amp;&amp;amp;&lt;/font> fault,&#xD;
        per se. (It might be the case that the nesting is incorrect, but this technique does not address that.)&lt;br />&#xD;
    &lt;/li>&#xD;
&lt;/ol></mainDescription>
</org.eclipse.epf.uma:ContentDescription>
