appendix 1. analyzing the triangle problem - Testing Education
appendix 1. analyzing the triangle problem - Testing Education
appendix 1. analyzing the triangle problem - Testing Education
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
ANALYZING THE TRIANGLE PROBLEM<br />
(Continued)<br />
6. Verify that scalene <strong>triangle</strong>s are processed correctly.<br />
Verify that if a <strong>triangle</strong> has three unequal sides, <strong>the</strong> displayed result is "Scalene".<br />
In addition to <strong>the</strong> above set of test cases for equilateral, isosceles and scalene <strong>triangle</strong>s,<br />
do we need to test for any special types or shapes of <strong>triangle</strong>s?<br />
For example, do we need to test specifically for a right-angled <strong>triangle</strong>, or can we just<br />
assume that this is already covered by <strong>the</strong> earlier, more general test cases? Similarly, do<br />
we need to test for any special shape (for example a <strong>triangle</strong> with angles of 30 o , 60 o and<br />
90 o )?<br />
The answer to this question lies in an analysis of commonality versus differences. Is<br />
<strong>the</strong>re anything distinct or unusual about a right-angled <strong>triangle</strong>, for example, that means<br />
<strong>the</strong> results of any test of a isosceles or scalene <strong>triangle</strong> would not also apply to <strong>the</strong> rightangled<br />
<strong>triangle</strong>? There is nothing apparently different -- if <strong>the</strong> software works for any<br />
samples of scalene and isosceles <strong>triangle</strong>s, logically it should also work for <strong>the</strong> rightangled<br />
one.<br />
If we have a hunch, though, that something strange may occur with <strong>the</strong> right-angled<br />
<strong>triangle</strong>, it is a good idea still to test it, no matter what rational logic tells us.<br />
III. BOUNDARY VALUES<br />
7. Verify that extreme lengths are processed correctly.<br />
Verify that both very large and very small <strong>triangle</strong>s are processed correctly. For example,<br />
if <strong>the</strong> smallest and longest allowable lengths of <strong>the</strong> sides are 0.0001 and 99999.9999<br />
respectively, <strong>the</strong>n try <strong>the</strong> following boundary values:<br />
(a) i = j = k = 0.0001 (should be accepted as equilateral).<br />
(b) i = j = k = 99999.9999 (should be accepted as equilateral).<br />
(c) i = 0.0001; j = k = 99999.9999 (should be accepted as isosceles).<br />
Copyright 2004 Collard 18 & Company<br />
Appendix 1<br />
18