IT Community - Software Programming, Web Development and Technical Support

Statement Coverage

This is a discussion on Statement Coverage within the Software Testing forums, part of the Software Quality Assurance category; Hui guys can anyone let me know about the Statement Coverage : - Vignesh...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Quality Assurance > Software Testing

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 02:38 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Thumbs up Statement Coverage

Hui guys can anyone let me know about the Statement Coverage :

- Vignesh
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-17-2008, 03:04 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Thumbs up Re: Statement Coverage

This document lists the requirements for a statement coverage tool for modules, describes some issues in design and implementation, and compares with other statement coverage implementations.

1.You can run many tests and perform coverage analysis based on all the tests.

2.You can get a summary report showing coverage for a set of modules and the total.

3.You can annotate program source code to show which statements are covered.

4.Recording of coverage information doesn't slow down a test case more than necessary.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-24-2008, 03:26 AM
santoshmalvi santoshmalvi is offline
D-Web Trainee
 
Join Date: Mar 2007
Location: Bangalore
Posts: 11
santoshmalvi is on a distinguished road
Default Re: Statement Coverage

Statement Coverage
This measure reports whether each executable statement is encountered.
Also known as: line coverage, segment coverage and basic block coverage. Basic block coverage is the same as statement coverage except the unit of code measured is each sequence of non-branching statements.
The chief advantage of this measure is that it can be applied directly to object code and does not require processing source code. Performance profilers commonly implement this measure.
The chief disadvantage of statement coverage is that it is insensitive to some control structures. For example, consider the following C/C++ code fragment:

int* p = NULL;
if (condition)
p = &variable;
*p = 123;

Without a test case that causes condition to evaluate false, statement coverage rates this code fully covered. In fact, if condition ever evaluates false, this code fails. This is the most serious shortcoming of statement coverage. If-statements are very common.
Statement coverage does not report whether loops reach their termination condition - only whether the loop body was executed. With C, C++, and Java, this limitation affects loops that contain break statements.
Since do-while loops always execute at least once, statement coverage considers them the same rank as non-branching statements.
Statement coverage is completely insensitive to the logical operators (|| and &&).
Statement coverage cannot distinguish consecutive switch labels.
Test cases generally correlate more to decisions than to statements. You probably would not have 10 separate test cases for a sequence of 10 non-branching statements; you would have only one test case. For example, consider an if-else statement containing one statement in the then-clause and 99 statements in the else-clause. After exercising one of the two possible paths, statement coverage gives extreme results: either 1% or 99% coverage. Basic block coverage eliminates this problem.
One argument in favor of statement coverage over other measures is that faults are evenly distributed through code; therefore the percentage of executable statements covered reflects the percentage of faults discovered. However, one of our fundamental assumptions is that faults are related to control flow, not computations. Additionally, we could reasonably expect that programmers strive for a relatively constant ratio of branches to statements.
In summary, this measure is affected more by computational statements than by decisions.

Thanks & Regards,
Santosh Malvi
Module Lead
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop view statement. Pvinothkumar Database Support 5 03-25-2008 09:27 PM
Statement and Branch Coverage vadivelanvaidyanathan Software Testing 0 01-28-2008 10:13 PM
What is Condition Coverage? sundarraja Software Testing 1 11-27-2007 11:53 PM
What is branch coverage testing? sundarraja Software Testing 1 11-05-2007 04:11 AM
Mysql - what is the use of DO statement? write2ashokkumar Database Support 1 08-14-2007 01:34 AM


All times are GMT -7. The time now is 07:02 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0