• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Knowledge share on code coverage
 

Knowledge share on code coverage

on

  • 4,874 views

Knowledge share on code coverage

Knowledge share on code coverage

Statistics

Views

Total Views
4,874
Views on SlideShare
2,638
Embed Views
2,236

Actions

Likes
1
Downloads
77
Comments
0

9 Embeds 2,236

http://magustest.com 2186
http://cache.baidu.com 27
http://cache.baiducontent.com 14
http://translate.googleusercontent.com 2
http://webcache.googleusercontent.com 2
http://cache.baid 2
http://static.slidesharecdn.com 1
http://reader.youdao.com 1
http://xianguo.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Knowledge share on code coverage Knowledge share on code coverage Presentation Transcript

    • Knowledge Share on Code Coverage
      Magus Chen
      maguschen@hotmail.com
      http://magustest.com/blog/
    • Agenda
      What is Code Coverage
      How it Works
      Common Mistakes
      Some Thoughts
      References
      2
    • What is Code Coverage
      Code coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested.
      3
    • What is Code Coverage
      Statement coverage
      Decision(Branch) coverage
      Condition coverage
      Condition/decision coverage
      Function coverage
      http://en.wikipedia.org/wiki/Code_coverage
      http://www.javaranch.com/journal/2004/01/IntroToCodeCoverage.html
      http://www.exampler.com/testing-com/writings/coverage-terminology.html
      4
    • How does Code Coverage Works
      Essentially all code coverage tools instrument the code in order to check which parts of the code were executed.
      When test executed, code coverage tool will collect
      Usually there are some tools can parse the coverage result data file and generate a report
      http://www.bullseye.com/paper.html
      5
    • Common Mistakes
      Try to reach 100% coverage
      Some part of the code is hard to reach
      Non-critical code should be set low priority
      Follow the idea of the code
      The existence code looks good and we get 100% coverage, the problem is that feature cannot be found in the code(never written)
      Confuse high coverage with high quality
      The most useful information of code coverage report can tell us is which lines in the application were not being test.
      6
    • Some Thoughts
      Run the test against AUT
      Check code coverage report and retest
      Phase I
      Target on simple feature test
      Filter current feature related code and indentify the untest code (Line coverage)
      Add more test case to cover those untest code
      Phase II
      Target on most critical feature test
      Filter current feature related code and indentify the untest code (Branch coverage)
      Add more test case to fulfill the branch coverage
      7
    • References on Tools
      http://ltp.sourceforge.net/coverage/lcov.php
      http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
      http://www.bobah.net/d4d/tools/code-coverage-with-gcov
      http://www.network-theory.co.uk/docs/gccintro/gccintro_81.html
      http://open-tube.com/10-code-coverage-tools-c-c
      8
    • Other Tool Candidates
      http://www.testcocoon.org/ (OPRE SOURCE)
      http://covtool.sourceforge.net/ (OPRE SOURCE)
      http://www.testwell.fi/ctcdesc.html (commercial)
      http://www.bullseye.com/productInfo.html (commercial)
      9
    • Q & A
      10
    • Thank you