TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Jasen Betts
from: Neil Heller
date: 2004-06-30 16:08:00
subject: Testing the Code

NH> 3.  How many tests are required to give the full statement
NH> coverage testing the following code:

NH>     if (x > 4) {
NH>         // do something
NH>     } else {
NH>        // do something else
NH>     }

JB> Two, (one with x > 4 one with x <= 4)

JB> or possibly fewer if your compiler optimises out the comments :-)

It seems to me that "<= 4" calls for two tests:  one test for
< 4 and 
one test for = 4.  This all done in the context of the larger program.

þ CMPQwk 1.42 999

--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.