FidoNet Echomail Archive
c_echo

<<< Previous Index Next >>>

From: Jasen Betts
To: Neil Heller
Date: 2004-07-14 21:57:40
Subject: Testing the Code

Hello Neil.

30 Jun 04 16:08, you wrote to me:

 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 :-)

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

i don't see how that could be.
the above code make no distinction between those two cases

Jasen

--- GoldED+/LNX 1.1.4.7
 * Origin:  (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267


<<< Previous Index Next >>>