The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Software Testing >> Unit Testing

Pages: 1
kenneth77
Newbie


Reged: 11/20/10
Posts: 3
Simple fault finding using white box testing
      #649508 - 11/20/10 07:54 PM

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

Many many thanks in advance

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>y){
if (x>z){
System.out.println("x is the greatest");
}
else {
System.out.println("z is the greatest");
}
}
else{
if (y>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)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Joe Strazzere
Moderator


Reged: 05/15/00
Posts: 12344
Loc: Massachusetts, USA
Re: Simple fault finding using white box testing [Re: kenneth77]
      #649518 - 11/21/10 08:37 AM

Q0 - is this an exam question?

--------------------
- Joe
Visit AllThingsQuality.com to learn more about quality, testing, and QA!

I speak only for me. I do not speak for my employer, nor for anyone else.


Post Extras: Print Post   Remind Me!   Notify Moderator  
kenneth77
Newbie


Reged: 11/20/10
Posts: 3
Re: Simple fault finding using white box testing [Re: Joe Strazzere]
      #649524 - 11/21/10 05:21 PM

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

Post Extras: Print Post   Remind Me!   Notify Moderator  
JCTreb
Active Member


Reged: 08/16/01
Posts: 789
Loc: Minneapolis, MN
Re: Simple fault finding using white box testing [Re: kenneth77]
      #649526 - 11/21/10 07:23 PM

You might want to offer up your own answers for critique rather than asking the forum to answer the questions for you.

--------------------
Jason Trebilcock

"The single biggest problem in communication is the illusion that it has taken place."

-George Bernard Shaw, Irish playwright and Nobel Prize winner, 1856-1950


Post Extras: Print Post   Remind Me!   Notify Moderator  
kenneth77
Newbie


Reged: 11/20/10
Posts: 3
Re: Simple fault finding using white box testing [Re: JCTreb]
      #649548 - 11/21/10 11:35 PM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Joe Strazzere
Moderator


Reged: 05/15/00
Posts: 12344
Loc: Massachusetts, USA
Re: Simple fault finding using white box testing [Re: kenneth77]
      #649604 - 11/22/10 04:37 AM

Quote:

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




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.

--------------------
- Joe
Visit AllThingsQuality.com to learn more about quality, testing, and QA!

I speak only for me. I do not speak for my employer, nor for anyone else.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 2 anonymous users are browsing this forum.

Moderator:  AJ, Jeanj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2915

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5