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

Lost Password?


Software Testing >> Unit Testing

Pages: 1

Reged: 03/13/11
Posts: 1
Unit Testing: Block Testing Help !
      #664076 - 03/13/11 03:34 PM

Hello Everyone,

I am trying to understand Block Testing using the book: "How we test software at Microsoft" by Alen Page, Ken Johnston, Bj Rollison. On page 118 and 119 of the book I am given two block function examples. I have provided pictures of these functions:

Block Example 1

Block Example 2

The Book says block coverage measures the number of contiguous groups of statements unbound by branches. I believe I am not understanding this. Can someone explain why

int x = 0, y =0, z=0 ; if (condition) is considered 1 block in BlockExample1 Function


int x=0, y=0, ze=0; if (condition 1 && condition2) is considered 4 Blocks in BlockExample2 ?

Post Extras: Print Post   Remind Me!   Notify Moderator  

Reged: 11/18/11
Posts: 28
Loc: Florida
Re: Unit Testing: Block Testing Help ! [Re: rigziu]
      #691554 - 11/18/11 12:52 PM

I never heard of block testing and I have been testing a loooooooong time!! But it figures its a microsoft thing.


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

Reged: 05/02/06
Posts: 1041
Loc: CA, USA
Re: Unit Testing: Block Testing Help ! [Re: QAMgrMjk]
      #691555 - 11/18/11 01:09 PM

I just had to google it.. and ran into the same question.

That's actually pretty interesting. It's like taking data flow coverage to the next degree.

Their explaination was if condition1 is false, condition2 is never evaluated. So even though you can achieve dataflow coverage by using condition1=false & condition2=any; and condition1=true & condition2=true. (as you have covered all possible datapaths) It's not really full test coverage if say just the evaluation of contidtion2 can cause an error because condition2 is never evaluated if condition 1 is false.

But I still don't get how they count the blocks. I guess i'll have to read the book.

David Lai
Sr. QA / Test Lead
LinkedIn profile

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

Extra information
0 registered and 3 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

Topic views: 4111

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5