22.04.2013 Views

appendix 1. analyzing the triangle problem - Testing Education

appendix 1. analyzing the triangle problem - Testing Education

appendix 1. analyzing the triangle problem - Testing Education

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ANALYZING THE TRIANGLE PROBLEM<br />

(Continued)<br />

<strong>1.</strong> Verify that invalid inputs are rejected as expected (continued).<br />

(b) j is not valid<br />

The same types of tests are needed as for j as were needed for i.<br />

(c) k is not valid<br />

The same types of tests are needed as for k as were needed for i.<br />

How much testing of <strong>the</strong> second and third input lengths, j and k, is appropriate?<br />

If we can assume that <strong>the</strong> software engineer who developed <strong>the</strong> <strong>triangle</strong> software is<br />

reasonably competent, we can also assume with confidence that <strong>the</strong> software engineer<br />

would have provided one common subroutine to edit all of i, j and k at <strong>the</strong> time <strong>the</strong>y are<br />

input.<br />

In this situation, a comprehensive set of test cases for j and k, following <strong>the</strong><br />

comprehensive set of tests for i, is unnecessary. The first set of test cases for i will<br />

already have extensively exercised <strong>the</strong> common edit routine, so re-testing for several<br />

values of j and k would be redundant. If <strong>the</strong> software works for i, it should also work for j<br />

and for k.<br />

Only one additional test case is needed for j, and also one for k, to double-check that <strong>the</strong><br />

software engineer at least remembered to call or access <strong>the</strong> common edit routine for j<br />

and k as well as for i.<br />

A better approach (instead of many negative test cases for i, followed by only one each<br />

for j and k), is to spread <strong>the</strong> set of negative test cases equally among i, j and k.<br />

However, if we are paranoid, we will be willing to assume nothing. Since this is a black<br />

box test, we do not know for sure how <strong>the</strong> software was constructed internally. Although<br />

it may be an incompetent practice, <strong>the</strong> software engineer may have written three separate<br />

input edit routines, one each for i, j and k. In this circumstance, <strong>the</strong> fact that <strong>the</strong> first set<br />

of tests for i work correctly will predict nothing about <strong>the</strong> behavior of j and k.<br />

Copyright 2004 Collard 13 & Company<br />

Appendix 1<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!