# Thread: Simple fault finding using white box testing

1. ## Simple fault finding using white box testing

Hey all,

i am not a programmer!! but the course i do involves abit of programming (java). any help on below questions (highlighted in red) will be appearcaited...

For Q1 - is the answer "Y" is the biggest???

For Q2 - apart from missing the "else statment" i can't spot any other faults - Please help!!!

For Q3 - Is MCDC (Multiple condition and decision coverage) most adequate?? it requires to illurstate the anware with some coding explanation

Q1 - Consider the following code (in Java) which accepts 3 integers x, y and z as input and output whether x, y, or z is the biggest.

if (x&gt;y){
if (x&gt;z){
System.out.println("x is the greatest");
}
else {
System.out.println("z is the greatest");
}
}
else{
if (y&gt;z){
System.out.println("y is the greatest");
}
}

Q2- What is the fault?
Q3 - Which white box coverage criterion will you adopt to reveal this type of fault? You should define the criterion and explain your choice. (note: you should choose a coverage criterion which can always generate a test set to detect the fault but requires the fewest number of test cases)

2. ## Re: Simple fault finding using white box testing

Q0 - is this an exam question?

3. ## Re: Simple fault finding using white box testing

Yes - it is a past exam paper question!! can you help!!

5. ## Re: Simple fault finding using white box testing

Yes - i did, the top part

For Q1 - is the answer "Y" is the biggest???

For Q2 - apart from missing the "else statement" i can't spot any other faults - Please help!!!

For Q3 - Is MCDC (Multiple condition and decision coverage) most adequate?? it requires to illustrate the anware with some coding explanation

6. ## Re: Simple fault finding using white box testing

[ QUOTE ]
For Q2 - apart from missing the "else statement" i can't spot any other faults - Please help!!!

[/ QUOTE ]

Consider building yourself a table of possible values for x, y, and z, then seeing if the code deals with each combination correctly.

Some suggested values for each variable are 1, 2 and 3.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.