SlideShare a Scribd company logo
1 of 39
Download to read offline
Code Coverage 
a stab to the questions of What, When, Why, and How 
Aug 2011 the nugget presentation 
prepared by Ernani Omar Cruz 
Thursday, August 25, 11
Usual Developer’s Coding Cycle 
Code Test Diagnose Fix 
usually a time 
consuming process 
= COST 
Overall Goal is to minimize time spent on “Fixing” 
Thursday, August 25, 11
What? 
Code Coverage 
is a measure used in software testing. It describes the degree 
to which the source code of a program has been tested. 
It is a form of testing that inspects the code directly 
and is therefore a form of white box testing. 
Thursday, August 25, 11
Some Types of Code 
Coverages 
• Statement 
• Function 
• Path 
• Condition 
• Branch 
Statement coverage is a code coverage metric that tells you whether the flow of control reached every 
executable statement of source code at least once. 
Has each function in the program been called? This metric reports whether you invoked each 
function or procedure. 
This metric reports whether each of the possible paths in each function have been followed. A 
path is a unique sequence of branches from the function entry to the exit. 
Condition coverage reports the true or false outcome of each condition. 
A branch is the outcome of a decision, so branch coverage simply measures which decision outcomes 
have been tested. 
and more! 
Thursday, August 25, 11
Which Do We Use? 
It Depends to What We are trying to Code! 
Accomplish 
But the Point to Note is To Have A Tested Code that it 
does what is EXPECTED of It to Do. 
Thursday, August 25, 11
When? 
It Starts with Construction 
Thursday, August 25, 11
Early detection of flaws 
Higher Confidence 
Everyone Happy 
Thursday, August 25, 11
Why? 
Early detection of flaws 
Higher Confidence 
Everyone Happy 
Thursday, August 25, 11
Why? 
Why do we need to do this? 
Early detection of flaws 
Higher Confidence 
Everyone Happy 
Thursday, August 25, 11
Why? 
Why do we need to do this? 
To Ensure Quality 
Early detection of flaws 
Higher Confidence 
Everyone Happy 
Thursday, August 25, 11
Why? 
Why do we need to do this? 
To Ensure Quality 
Minimize Bugs/Defects 
Early detection of flaws 
Higher Confidence 
Everyone Happy 
Thursday, August 25, 11
Why? 
Why do we need to do this? 
To Ensure Quality 
Minimize Bugs/Defects 
Early detection of flaws 
Avoid Cost due to Rework and Delay 
Higher Confidence 
Everyone Happy 
Thursday, August 25, 11
How much? 
How much are we going to need to do this properly? 
It Depends. 
Requires Discretion 
70-80% Coverage 
Code coverage of 70-80% is a reasonable goal for system test of most 
projects with most coverage metrics. Use a higher goal for projects 
specifically organized for high testability or that have high failure costs. 
Minimum code coverage for unit testing can be 10-20% higher than for 
system testing. --- Bullseye “http://www.bullseye.com/minimum.html” 
Thursday, August 25, 11
Why Not 100% 
Coverage? 
Although 100% code coverage may appear like a best 
possible effort, even 100% code coverage is estimated to 
only expose about half the faults in a system. Low code 
coverage indicates inadequate testing, but high code 
coverage guarantees nothing. 
In a large system, achieving 100% code coverage is generally not cost effective. Some reasons are listed below. 
• Some test cases are expensive to reproduce but are highly improbable. The cost to benefit ratio does not justify repeating these tests 
simply to record the code coverage. 
• Checks may exist for unexpected error conditions. Layers of code might obscure whether errors in low-level code propagate up to 
higher level code. An engineer might decide that handling all errors creates a more robust solution than tracing the possible errors. 
• Unreachable code in the current version might become reachable in a future version. An engineer might address uncertainty about 
future development by investing a little more effort to add some capability that is not currently needed. 
• Code shared among several projects is only partially utilized by the project under test. 
Generally, the tester should stop increasing code coverage when the tests become contrived. When you focus more and more on making the 
coverage numbers better, your motivation shifts away from finding bugs. 
Thursday, August 25, 11
“100% code coverage isn't an achievement, it's a minimum 
requirement. If you write a line of code, you'd better test it.” 
- Robert Cecil Martin aka “Uncle Bob” 
In the end it all boils down to ROI and pragmatism. Some apps need more testing than others. 
Some modules need more testing than others. Some bugs need more fixing than others. There 
will always be a judgment call about whether additional time and money spent on automated 
testing and coverage are justified or are just a premature optimization. 
Thursday, August 25, 11
Roles Each Has to Fill 
• Project Manager 
• Team Lead 
• Developer 
• Peer 
• Tester/QAs 
The one who allocates resources, shapes priorities, coordinates interactions with 
project stakeholders and keeps team focused on goals. 
The leader of the Development team on the project. 
The team member who writes the software and performs the unit tests. 
Co-Team member; The one who can help out, review, and check the 
work of a team member (usually developer) 
The one responsible to drive out proper testing and validates 
functionality 
Everyone Has A Responsibility/Stake in Ensuring Quality 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method 
levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on 
these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize 
untested branches in code. 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method 
levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on 
these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize 
untested branches in code. 
JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error 
detection, and code review. 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method 
levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on 
these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize 
untested branches in code. 
JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error 
detection, and code review. 
A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method 
levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on 
these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize 
untested branches in code. 
JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error 
detection, and code review. 
A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. 
Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit 
tests, mock object creation, path & branch coverage and code testability. We keep our costs low because 
we only develop features that have benefit and make sense. 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method 
levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on 
these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize 
untested branches in code. 
JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error 
detection, and code review. 
A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. 
Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit 
tests, mock object creation, path & branch coverage and code testability. We keep our costs low because 
we only develop features that have benefit and make sense. 
BullseyeCoverage is a code coverage analyzer for C++ and C that tells you how much of your source code 
was tested. You can use this information to quickly focus your testing effort and pinpoint areas that need to 
be reviewed. Code coverage analysis is useful during unit testing, integration testing, and final release. 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method 
levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on 
these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize 
untested branches in code. 
JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error 
detection, and code review. 
A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. 
Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit 
tests, mock object creation, path & branch coverage and code testability. We keep our costs low because 
we only develop features that have benefit and make sense. 
BullseyeCoverage is a code coverage analyzer for C++ and C that tells you how much of your source code 
was tested. You can use this information to quickly focus your testing effort and pinpoint areas that need to 
be reviewed. Code coverage analysis is useful during unit testing, integration testing, and final release. 
Sonar is an open platform to manage code quality. As such, it covers the 7 axes of code quality: Architecture and Design, Duplications, 
Thursday, August 25, 11
(some) Tools Available 
that can help us measure/analyze code 
coverage 
• Cobertura 
• Clover 
• DevPartner 
• Emma 
• JTest 
• Kalistick 
• CoView and CoAnt 
• Bullseye for C++ 
• Sonar 
Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of 
code are and are not executed as the test suite runs 
Some features include historical reporting, complete control over the coverage gathering process, command line toolset and 
API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the 
application code that was modified since the previous build. 
DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and 
Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread 
Analysis and dead-lock detection, Code Coverage Analysis. 
EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method 
levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on 
these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize 
untested branches in code. 
JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error 
detection, and code review. 
A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. 
Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit 
tests, mock object creation, path & branch coverage and code testability. We keep our costs low because 
we only develop features that have benefit and make sense. 
BullseyeCoverage is a code coverage analyzer for C++ and C that tells you how much of your source code 
was tested. You can use this information to quickly focus your testing effort and pinpoint areas that need to 
be reviewed. Code coverage analysis is useful during unit testing, integration testing, and final release. 
Sonar is an open platform to manage code quality. As such, it covers the 7 axes of code quality: Architecture and Design, Duplications, 
comments, coding rules, unit tests, potential bugs, and complexity. 
Thursday, August 25, 11
So What do we Use? 
Any. 
Thursday, August 25, 11
Thursday, August 25, 11
Quality is central 
Sonar is a web-based application. Rules, alerts, thresholds, exclusions, settings… can be configured online. By leveraging its database, Sonar not only allows to combine metrics 
altogether but also to mix them with historical measures. 
Sonar has got a very efficient way of navigating, a balance between high-level view, dashboard, TimeMachine and defect hunting 
tools. This enables to quickly uncover projects and / or components that are in Technical Debt to establish action plans. 
Thursday, August 25, 11
Features 
All projects at a glance 
Drill down to source code 
Coding rules 
Unit Tests 
Standard Metrics 
Time Machine 
Maven Ready 
Easiness 
Leverage existing components 
Plugins 
Security 
Thursday, August 25, 11
Thursday, August 25, 11
Software Quality Assessment based on 
Lifecycle Expectations 
The SQALE method is particularly devoted to the 
management of the Technical debt (or design debt) of 
AGILE software developments. It allows: 
1 To define clearly what creates the technical debt 
2 To estimate correctly this debt 
3 To describe this debt into various parts relating to 
the testability, the reliability, the changeability, the 
maintainability… This classification allows to 
analyze the impact of the debt and to define the 
priority of code refactoring/remediation activities. 
Text 
Thursday, August 25, 11
Having Automated Test Suites 
Prepares Us Towards Automated Integration 
Thursday, August 25, 11
It’s Free. 
Thursday, August 25, 11
Thank You. 
Thursday, August 25, 11
References 
• http://en.wikipedia.org/wiki/Code_coverage 
• http://www.bullseye.com/statementCoverage.html 
• http://www.bullseye.com/paper.html 
• http://www.bullseye.com/minimum.html 
• http://www.sonarsource.org/ 
• http://www.atlassian.com/software/clover/ 
• http://www.bullseye.com/coverage.html 
• http://www.codign.com/pathbranchcode.html 
• http://software-development-thoughts.blogspot.com/2011/04/ 
how-much-code-coverage-do-you-really.html 
Thursday, August 25, 11
References 
• http://en.wikipedia.org/wiki/Code_coverage#Software_tools 
• http://www.codecoveragetools.com/index.php/coverage-process/ 
code-coverage-tools-java.html 
• http://emma.sourceforge.net/faq.html#faq-N10042 
• http://en.wikipedia.org/wiki/EMMA_(code_coverage_tool) 
• http://en.wikipedia.org/wiki/DevPartner 
• http://en.wikipedia.org/wiki/Clover_(software) 
• http://cobertura.sourceforge.net/ 
• http://en.wikipedia.org/wiki/Jtest 
Thursday, August 25, 11
References 
• http://www.kalistick.com/software-radiography- 
platform.html 
• http://www.codign.com/ 
• http://www.bullseye.com/productInfo.html 
• http://www.sqale.org/details 
Thursday, August 25, 11

More Related Content

What's hot

An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit TestingJoe Tremblay
 
Code Smell, Software Engineering
Code Smell, Software EngineeringCode Smell, Software Engineering
Code Smell, Software EngineeringAnshul Vinayak
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDDDror Helper
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration TestingDavid Berliner
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 
What is Test Plan? Edureka
What is Test Plan? EdurekaWhat is Test Plan? Edureka
What is Test Plan? EdurekaEdureka!
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And MockingJoe Wilson
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesDerek Smith
 
Static Code Analysis
Static Code AnalysisStatic Code Analysis
Static Code AnalysisAnnyce Davis
 
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)[기본과정] 코드 테스트와 커버리지 기본 교육(개념)
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)SangIn Choung
 
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code QualitySonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code QualityLarry Nung
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing ProcessIntetics
 

What's hot (20)

An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Code Smell, Software Engineering
Code Smell, Software EngineeringCode Smell, Software Engineering
Code Smell, Software Engineering
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
TDD refresher
TDD refresherTDD refresher
TDD refresher
 
What is Test Plan? Edureka
What is Test Plan? EdurekaWhat is Test Plan? Edureka
What is Test Plan? Edureka
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Sanity testing and smoke testing
Sanity testing and smoke testingSanity testing and smoke testing
Sanity testing and smoke testing
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Manual testing ppt
Manual testing pptManual testing ppt
Manual testing ppt
 
Static Code Analysis
Static Code AnalysisStatic Code Analysis
Static Code Analysis
 
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)[기본과정] 코드 테스트와 커버리지 기본 교육(개념)
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)
 
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code QualitySonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code Quality
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing Process
 
Test Automation
Test AutomationTest Automation
Test Automation
 

Similar to Code Coverage

Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham.NET Conf UY
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5hemasubbu08
 
Topic production code
Topic production codeTopic production code
Topic production codeKavi Kumar
 
Cross functional peer review preso 10-01-2013
Cross functional peer review preso 10-01-2013Cross functional peer review preso 10-01-2013
Cross functional peer review preso 10-01-2013SmartBear
 
SW Verification presentation
SW Verification presentationSW Verification presentation
SW Verification presentationKiril Delovski
 
Unit testing - what is its importance
Unit testing - what is its importanceUnit testing - what is its importance
Unit testing - what is its importanceTestingXperts
 
Automating The Process For Building Reliable Software
Automating The Process For Building Reliable SoftwareAutomating The Process For Building Reliable Software
Automating The Process For Building Reliable Softwareguest8861ff
 
Automated Testing Using Selenium
Automated Testing Using SeleniumAutomated Testing Using Selenium
Automated Testing Using SeleniumTechWell
 
Google, quality and you
Google, quality and youGoogle, quality and you
Google, quality and younelinger
 
Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Deepak Singhvi
 
How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingTechWell
 
Top 5 Pitfalls of Test Automation and How To Avoid Them
Top 5 Pitfalls of Test Automation and How To Avoid ThemTop 5 Pitfalls of Test Automation and How To Avoid Them
Top 5 Pitfalls of Test Automation and How To Avoid ThemSundar Sritharan
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test AutomationSauce Labs
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 

Similar to Code Coverage (20)

Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
Why test with flex unit
Why test with flex unitWhy test with flex unit
Why test with flex unit
 
Software testing
Software testingSoftware testing
Software testing
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Topic production code
Topic production codeTopic production code
Topic production code
 
Cross functional peer review preso 10-01-2013
Cross functional peer review preso 10-01-2013Cross functional peer review preso 10-01-2013
Cross functional peer review preso 10-01-2013
 
SW Verification presentation
SW Verification presentationSW Verification presentation
SW Verification presentation
 
Unit testing - what is its importance
Unit testing - what is its importanceUnit testing - what is its importance
Unit testing - what is its importance
 
Automating The Process For Building Reliable Software
Automating The Process For Building Reliable SoftwareAutomating The Process For Building Reliable Software
Automating The Process For Building Reliable Software
 
Automated Testing Using Selenium
Automated Testing Using SeleniumAutomated Testing Using Selenium
Automated Testing Using Selenium
 
Software testing (2)
Software testing (2)Software testing (2)
Software testing (2)
 
Google, quality and you
Google, quality and youGoogle, quality and you
Google, quality and you
 
Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.
 
testing
testingtesting
testing
 
How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated Testing
 
Top 5 Pitfalls of Test Automation and How To Avoid Them
Top 5 Pitfalls of Test Automation and How To Avoid ThemTop 5 Pitfalls of Test Automation and How To Avoid Them
Top 5 Pitfalls of Test Automation and How To Avoid Them
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Software testing
Software testingSoftware testing
Software testing
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 

Recently uploaded

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Recently uploaded (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Code Coverage

  • 1. Code Coverage a stab to the questions of What, When, Why, and How Aug 2011 the nugget presentation prepared by Ernani Omar Cruz Thursday, August 25, 11
  • 2. Usual Developer’s Coding Cycle Code Test Diagnose Fix usually a time consuming process = COST Overall Goal is to minimize time spent on “Fixing” Thursday, August 25, 11
  • 3. What? Code Coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested. It is a form of testing that inspects the code directly and is therefore a form of white box testing. Thursday, August 25, 11
  • 4. Some Types of Code Coverages • Statement • Function • Path • Condition • Branch Statement coverage is a code coverage metric that tells you whether the flow of control reached every executable statement of source code at least once. Has each function in the program been called? This metric reports whether you invoked each function or procedure. This metric reports whether each of the possible paths in each function have been followed. A path is a unique sequence of branches from the function entry to the exit. Condition coverage reports the true or false outcome of each condition. A branch is the outcome of a decision, so branch coverage simply measures which decision outcomes have been tested. and more! Thursday, August 25, 11
  • 5. Which Do We Use? It Depends to What We are trying to Code! Accomplish But the Point to Note is To Have A Tested Code that it does what is EXPECTED of It to Do. Thursday, August 25, 11
  • 6. When? It Starts with Construction Thursday, August 25, 11
  • 7. Early detection of flaws Higher Confidence Everyone Happy Thursday, August 25, 11
  • 8. Why? Early detection of flaws Higher Confidence Everyone Happy Thursday, August 25, 11
  • 9. Why? Why do we need to do this? Early detection of flaws Higher Confidence Everyone Happy Thursday, August 25, 11
  • 10. Why? Why do we need to do this? To Ensure Quality Early detection of flaws Higher Confidence Everyone Happy Thursday, August 25, 11
  • 11. Why? Why do we need to do this? To Ensure Quality Minimize Bugs/Defects Early detection of flaws Higher Confidence Everyone Happy Thursday, August 25, 11
  • 12. Why? Why do we need to do this? To Ensure Quality Minimize Bugs/Defects Early detection of flaws Avoid Cost due to Rework and Delay Higher Confidence Everyone Happy Thursday, August 25, 11
  • 13. How much? How much are we going to need to do this properly? It Depends. Requires Discretion 70-80% Coverage Code coverage of 70-80% is a reasonable goal for system test of most projects with most coverage metrics. Use a higher goal for projects specifically organized for high testability or that have high failure costs. Minimum code coverage for unit testing can be 10-20% higher than for system testing. --- Bullseye “http://www.bullseye.com/minimum.html” Thursday, August 25, 11
  • 14. Why Not 100% Coverage? Although 100% code coverage may appear like a best possible effort, even 100% code coverage is estimated to only expose about half the faults in a system. Low code coverage indicates inadequate testing, but high code coverage guarantees nothing. In a large system, achieving 100% code coverage is generally not cost effective. Some reasons are listed below. • Some test cases are expensive to reproduce but are highly improbable. The cost to benefit ratio does not justify repeating these tests simply to record the code coverage. • Checks may exist for unexpected error conditions. Layers of code might obscure whether errors in low-level code propagate up to higher level code. An engineer might decide that handling all errors creates a more robust solution than tracing the possible errors. • Unreachable code in the current version might become reachable in a future version. An engineer might address uncertainty about future development by investing a little more effort to add some capability that is not currently needed. • Code shared among several projects is only partially utilized by the project under test. Generally, the tester should stop increasing code coverage when the tests become contrived. When you focus more and more on making the coverage numbers better, your motivation shifts away from finding bugs. Thursday, August 25, 11
  • 15. “100% code coverage isn't an achievement, it's a minimum requirement. If you write a line of code, you'd better test it.” - Robert Cecil Martin aka “Uncle Bob” In the end it all boils down to ROI and pragmatism. Some apps need more testing than others. Some modules need more testing than others. Some bugs need more fixing than others. There will always be a judgment call about whether additional time and money spent on automated testing and coverage are justified or are just a premature optimization. Thursday, August 25, 11
  • 16. Roles Each Has to Fill • Project Manager • Team Lead • Developer • Peer • Tester/QAs The one who allocates resources, shapes priorities, coordinates interactions with project stakeholders and keeps team focused on goals. The leader of the Development team on the project. The team member who writes the software and performs the unit tests. Co-Team member; The one who can help out, review, and check the work of a team member (usually developer) The one responsible to drive out proper testing and validates functionality Everyone Has A Responsibility/Stake in Ensuring Quality Thursday, August 25, 11
  • 17. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Thursday, August 25, 11
  • 18. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Thursday, August 25, 11
  • 19. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. Thursday, August 25, 11
  • 20. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. Thursday, August 25, 11
  • 21. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize untested branches in code. Thursday, August 25, 11
  • 22. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize untested branches in code. JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error detection, and code review. Thursday, August 25, 11
  • 23. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize untested branches in code. JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error detection, and code review. A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. Thursday, August 25, 11
  • 24. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize untested branches in code. JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error detection, and code review. A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit tests, mock object creation, path & branch coverage and code testability. We keep our costs low because we only develop features that have benefit and make sense. Thursday, August 25, 11
  • 25. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize untested branches in code. JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error detection, and code review. A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit tests, mock object creation, path & branch coverage and code testability. We keep our costs low because we only develop features that have benefit and make sense. BullseyeCoverage is a code coverage analyzer for C++ and C that tells you how much of your source code was tested. You can use this information to quickly focus your testing effort and pinpoint areas that need to be reviewed. Code coverage analysis is useful during unit testing, integration testing, and final release. Thursday, August 25, 11
  • 26. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize untested branches in code. JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error detection, and code review. A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit tests, mock object creation, path & branch coverage and code testability. We keep our costs low because we only develop features that have benefit and make sense. BullseyeCoverage is a code coverage analyzer for C++ and C that tells you how much of your source code was tested. You can use this information to quickly focus your testing effort and pinpoint areas that need to be reviewed. Code coverage analysis is useful during unit testing, integration testing, and final release. Sonar is an open platform to manage code quality. As such, it covers the 7 axes of code quality: Architecture and Design, Duplications, Thursday, August 25, 11
  • 27. (some) Tools Available that can help us measure/analyze code coverage • Cobertura • Clover • DevPartner • Emma • JTest • Kalistick • CoView and CoAnt • Bullseye for C++ • Sonar Cobertura is an open source tool that measures test coverage by instrumenting a code base and watching which lines of code are and are not executed as the test suite runs Some features include historical reporting, complete control over the coverage gathering process, command line toolset and API for legacy integration and more.Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. DevPartner Java Edition (DPJ) integrates a set of functionality enabling developers to analyze Java code for Code Quality and Complexity, Memory Leak Detection, Memory Profiling and Optimization, Performance Profiling and Optimization, Thread Analysis and dead-lock detection, Code Coverage Analysis. EMMA supports class, method, line, and basic block coverage, aggregated at "all", package, source file, class, and method levels. Line and block metrics are offered in "normal" and "weighted" varieties. Other entries in this FAQ provide details on these. EMMA does not do branch or path coverage. However, EMMA reports fractional line coverage to help you visualize untested branches in code. JTest’s basic functionality includes Unit test-case generation, static analysis, regression testing, runtime error detection, and code review. A third party application that analyzes the codes with different perspectives that aids users in strategizing release plans. Codign Software is committed to providing a valuable, affordable solution for metrics, automating JUnit tests, mock object creation, path & branch coverage and code testability. We keep our costs low because we only develop features that have benefit and make sense. BullseyeCoverage is a code coverage analyzer for C++ and C that tells you how much of your source code was tested. You can use this information to quickly focus your testing effort and pinpoint areas that need to be reviewed. Code coverage analysis is useful during unit testing, integration testing, and final release. Sonar is an open platform to manage code quality. As such, it covers the 7 axes of code quality: Architecture and Design, Duplications, comments, coding rules, unit tests, potential bugs, and complexity. Thursday, August 25, 11
  • 28. So What do we Use? Any. Thursday, August 25, 11
  • 30. Quality is central Sonar is a web-based application. Rules, alerts, thresholds, exclusions, settings… can be configured online. By leveraging its database, Sonar not only allows to combine metrics altogether but also to mix them with historical measures. Sonar has got a very efficient way of navigating, a balance between high-level view, dashboard, TimeMachine and defect hunting tools. This enables to quickly uncover projects and / or components that are in Technical Debt to establish action plans. Thursday, August 25, 11
  • 31. Features All projects at a glance Drill down to source code Coding rules Unit Tests Standard Metrics Time Machine Maven Ready Easiness Leverage existing components Plugins Security Thursday, August 25, 11
  • 33. Software Quality Assessment based on Lifecycle Expectations The SQALE method is particularly devoted to the management of the Technical debt (or design debt) of AGILE software developments. It allows: 1 To define clearly what creates the technical debt 2 To estimate correctly this debt 3 To describe this debt into various parts relating to the testability, the reliability, the changeability, the maintainability… This classification allows to analyze the impact of the debt and to define the priority of code refactoring/remediation activities. Text Thursday, August 25, 11
  • 34. Having Automated Test Suites Prepares Us Towards Automated Integration Thursday, August 25, 11
  • 35. It’s Free. Thursday, August 25, 11
  • 36. Thank You. Thursday, August 25, 11
  • 37. References • http://en.wikipedia.org/wiki/Code_coverage • http://www.bullseye.com/statementCoverage.html • http://www.bullseye.com/paper.html • http://www.bullseye.com/minimum.html • http://www.sonarsource.org/ • http://www.atlassian.com/software/clover/ • http://www.bullseye.com/coverage.html • http://www.codign.com/pathbranchcode.html • http://software-development-thoughts.blogspot.com/2011/04/ how-much-code-coverage-do-you-really.html Thursday, August 25, 11
  • 38. References • http://en.wikipedia.org/wiki/Code_coverage#Software_tools • http://www.codecoveragetools.com/index.php/coverage-process/ code-coverage-tools-java.html • http://emma.sourceforge.net/faq.html#faq-N10042 • http://en.wikipedia.org/wiki/EMMA_(code_coverage_tool) • http://en.wikipedia.org/wiki/DevPartner • http://en.wikipedia.org/wiki/Clover_(software) • http://cobertura.sourceforge.net/ • http://en.wikipedia.org/wiki/Jtest Thursday, August 25, 11
  • 39. References • http://www.kalistick.com/software-radiography- platform.html • http://www.codign.com/ • http://www.bullseye.com/productInfo.html • http://www.sqale.org/details Thursday, August 25, 11