What is test coverage?how we come to know how many testcases we have to write?is there any specification?

Showing Answers 1 - 2 of 2 Answers

SatishReddy

  • Aug 2nd, 2006
 

Test coverage is only a one measure of the quality of your testing.And it can only guide you to the areas that need testing, not help you write the tests. But it is an essential minimum in developing a quality product.

To talk about test coverage, you must have two things: a software product under development, and a test suite used to verify that the product is working correctly. Test coverage provides a measure of how well your test suite actually tests the product

Procedure-Level Test Coverage

Probably the most basic form of test coverage is to measure what procedures were and were not executed during the test suite. This simple statistic is typically available from execution profiling tools, whose job is really to measure performance bottlenecks. If the execution time in some procedures is zero, you need to write new tests that hit those procedures. But this measure of test coverage is so coarse-grained it's not very practical.

Line-Level Test Coveage

The basic measure of a dedicated test coverage tool is tracking which lines of code are executed, and which are not. This result is often presented in a summary at the procedure, file, or project level giving a percentage of the code that was executed. A large project that acheived 90% code coverage might be considered a well-tested product.

Typically the line coverage information is also presented at the source code level, allowing you to see exactly which lines of code were executed and which were not. This, of course, is often the key to writing more tests that will increase coverage: By studying the unexecuted code, you can see exactly what functionality has not been tested.

Condition Coverage and Other Measures

It's easy to find cases where line coverage doesn't really tell the whole story. For example, consider a block of code that is skipped under certain conditions (e.g., a statement in an if clause). If that code is shown as executed, you don't know whether you have tested the case when it is skipped. You need condition coverage to know.

sudhakar

  • Aug 9th, 2006
 

test coverage is done to know all modules  are coveredare not. we came to know this by studying client required specification requirement specification.yes by studying SRS documents

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions