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




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Miscellaneous Forums >> Training & Certification

Pages: 1
PPahadia
Newbie


Reged: 11/17/10
Posts: 3
Loc: India
McCabes Cyclomatic Complexity-An ISTQB Question
      #649568 - 11/22/10 01:47 AM

Dear All,

I am confused in the below ISTQB question, please explain me with proper answer:-

Q. Given the Following program
IF X <>= Z
THEN Statement 2;
END
McCabes Cyclomatic Complexity is :
A. 2
B. 3
C. 4
D. 5

I tried to search answer, but some are saying 2 and others 3 I need correct answer with valid reasons. Please help me.

Regards,
PPahadia


Post Extras: Print Post   Remind Me!   Notify Moderator  
Rich W.
Veteran


Reged: 03/05/04
Posts: 5815
Loc: West Coast of the East Coast!
Re: McCabes Cyclomatic Complexity-An ISTQB Question [Re: PPahadia]
      #649618 - 11/22/10 05:16 AM

Sounds like the boogy man is after you and the answer to this question will ward him off!

First of all (IF X <>= Z) is usually written (IF X <> Z) the "=" sign does not make sense to me unless there is an implied "OR" there. But it would appear that there would be a node which examines "X > Y" and a node for "X < Y" and in your statement one for "X = Y". which would indicate the answer might be "3".

Maybe you should read up on McCabe.

--------------------
Personal Comment

Success is the ability to go from one failure to another with no loss of enthusiasm.
~ Winston Churchill ~


...Rich Wagner


Post Extras: Print Post   Remind Me!   Notify Moderator  
CPat
Member


Reged: 12/08/09
Posts: 102
Re: McCabes Cyclomatic Complexity-An ISTQB Question [Re: Rich W.]
      #649622 - 11/22/10 05:28 AM

This is one reason certifications leave such a bad taste in everyone's mouths. Instead of understanding the question and the value, we just memorize answers to questions.

http://en.wikipedia.org/wiki/Cyclomatic_complexity


Post Extras: Print Post   Remind Me!   Notify Moderator  
TestingMentor
Member


Reged: 12/28/06
Posts: 235
Loc: Seattle, Washington
Re: McCabes Cyclomatic Complexity-An ISTQB Question [Re: CPat]
      #649646 - 11/22/10 07:55 AM

Rich is right. The relational operator (<>=) in the conditional expression does not appear to be a valid relational operator. The <> relational operator in BASIC like languages means 'not equal'.

So, assuming this is a BASIC like language and you have 1 boolean conditional expression. Essentially you have 2 nodes (the Boolean condition and the exit point) and 2 edges (the true and the false outcome of the Boolean condition). So, edges - nodes + 2 = 2. An easy way to calculate cyclomatic complexity is to count the number of Boolean conditions and add 1.

Most training I know is not simply about the ability to calculate cyclomatic complexity, but how to interpret what that metric might imply in terms of risk, and also help testers who design white-box structural tests (esp. basis path tests).

--------------------
- Bj -
I.M. Testy blog
Testing Mentor


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


Reged: 11/17/10
Posts: 3
Loc: India
Re: McCabes Cyclomatic Complexity-An ISTQB Question [Re: TestingMentor]
      #649720 - 11/22/10 09:58 PM

Thanks Rich and Bj for suggesting me on this.

Pat - I agree with you.


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



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

Moderator:  AJ, swt88 

Print Topic

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

Rating:
Topic views: 22347

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5