Professional Documents
Culture Documents
Practical No. 7: Design Test Case for Control and decision making
Statements.
1. Practical Significance
he tundamental assumption of code coverage testing is that to expose bugs, you
should exercise as many paths through your code as possible. The more paths you
exercise, the more likely your testing is to expose bugs. A path is a sequence or
branches (decisions), or conditions (logical predicates). A path corresponds to a test
set of inputs. Code or
coverage is a measure which describes the degree
a
case, or
which the source code of the program has been tested. It is one form of white box
testing which finds the areas of the program not exercised by a set of test cases. I his
practical help the student to provides a capability to dictate the logical flow of
execution and design Test Cases to check tie control and decision making statements.
Education
Maharashtra State Board of Technical 31
Software Testing (22518)
*****.
*********
****** **
onion .
.32.Detn.low h. .
********
***
M).Áep. ting
s2UIheneue..h. .AE...w o .....J......... 0r****
.heKe.
pessihle.is hom SAaItrA. Aks.
atemen .e..bs.le. tenenf
****************. s ....
.ecasionA. eLAAMAS. in
******** l l...
.. . ..
eAher..MME
6 alse..
***** **********
*****
*********.
* 1 * * * * * * * * * * * * * * * * * * * * * * ° ' ' * * * ° * * * * * *
***
* * * * * * * * * * * * * * * * * * * * * * .
******
******
*** ****°°
XIII. Exercise
Attempt Q1. and teacher shall allot Q. 2/Q.3 from the following:
(Note: Use Point VII to X and XIII to XV for all relevant programming exercise us
blank pages provided or attach more pages if needed.)
1. Generate the test case to check the program written for Even and Odd numbers.
2. Execute above test case in Question 1 by entering following inputs and verif
results.
Input- 4,7,2.5,8. 1.
3. Generate test case to check the program written for printing the day of week.
4. Create the test cases for following algorithm and write the Expected Outcom
and Actual Outcome' in following table by executing the code
IF (Length>=100) THEN
Length Length 2;
ELSE
Length = Count Length;
END IF
Count Count + 1;
END:
PRINT Length;
Test Cases
Input Values
Case Expected Outcomes Actual Outcomes
Count Length
5101
5 99
423
7 99
4 0 0
6 ****
.
*****
...Z..o.
ea 2
*** .o . ***
.....A . .6 2.MAP...
.z..
*** . 2.. * * * * * * * * *
**********.
**********
.
. . . . 2be 5 62..L. ****
.2.l00).ken. ****
n.. .
.. t
*****
**
...La.e.L6.K.k.
**************°***.
Z..22S. .C.Ö..hLer
**** ******.**.
... MA7...
. .. Aessep.k.h.I1..
A2....dzs6l... * . . . . .
.12.e.)... hen
Lesek. ******* . . . .
Co
Co eaeqkk..
Maharashtra State Board of Technical Education 35
Software Testing (22518)
... inue
(owr.d..a.il.kA.CaA.
we****°*****
*******..
** *ds.*** ***********
***...
Y********* s*** *'*****
AIV,
References / Suggestions for further Reading
https://sqa.stackexchange.com/questions/10253/condition-decision-testing-
with-loops
2. http://users.csc.calpoly.edu/-jdalbey/206/Assign/ControlTest.html
3.