SlideShare une entreprise Scribd logo
1  sur  19
www.scmGalaxy.com
sG


              Author: Rajesh Kumar
              rajesh@scmGalaxy.com



                                     scmGalaxy
     scmGalaxy.com
What is Code Coverage

    Code Coverage is an important
  measurement in Software Quality
  Engineering. While Software testing
  ensures correctness of the
  applications, a metric is required to
  track the completeness and
  effectiveness of the testing
  undertaken.
    Code Coverage helps achieve
  reliable quality through identifying
  untested areas of the application.

                                   scmGalaxy.com
Why Code Coverage


 Software testing is a challenging function. The testers
 need to ensure complete functional and non-functional
 correctness of the product. Considering the complex
 workflows and use cases of modern day applications, the
 number of unique cases that the software can be used
 often run into millions, which is not feasible to be covered
 under testing exercise. The testers thus need to

 - While Planning Tests
 o Ensure covering all workflows in terms of decision trees
 in the code
 o Ensure covering all data values – by identifying patterns
 rather covering millions of values

 - While testing
 o Ensuring the testing is completely exercising the whole
 application with planned and exploratory tests.
                                                     scmGalaxy.com
Why Code Coverage cont…


 At the end of testing, the decision to stop testing and release the
 product still remains subjective, based on the presence or absence
 of bugs, inflow of new bugs, success rate of each test cycle,
 confidence rating of the testers or users, etc. Whereas the
 definitive metric of quantifying how much of the application was
 really tested, is missed.

 Code Coverage is measured as quantification of application code
 exercised by the testing activities. Code Coverage can be
 measured at various levels – in terms of programming language
 constructs – Packages, Classes, Methods, Branches or in terms of
 physical artifacts - Folders, Files and Lines. For Eg. A Line
 Coverage metric of 67% means the testing exercised 67% of all
 executable statements of the application. A Code Coverage metric
 usually is accompanied by Code Coverage Analysis Report – which
 helps identify the un-tested part of the application code, thereby
 giving the testers early inputs for complete testing.




                                                          scmGalaxy.com
Benefits of Code Coverage


 Objective Indicator of Test Coverage of application
  code
 Pointers to uncovered Packages / Classes / Methods
  / Branches
 Pointers to uncovered Folders / Files / Lines
 Drill down to untested part of source code and devise
  new tests
 Early Indicator for Testing Quality and Fixing it by
  adding new tests.
 Remove redundancy in testing
 Increased Confidence for Releases




                                               scmGalaxy.com
Test Your Test


             scmGalaxy.com
Typical Emotional Storyboard

Write Some code! Happy!
Does it work? Sad!
Write some test! Happy!
Do they really test the code? Sad!
Measure the Code Coverage! Happy!




                                scmGalaxy.com
Coverage Measurement

Shows Which line of code are
 executed
How much of your code is covered by
 your tests?
Your tests test your product
Coverage testing tests your tests




                               scmGalaxy.com
Goal

100%
  Coverage Ideal
  Not Always possible
  Can be expensive to achieve
  Design for testability




                                 scmGalaxy.com
Practical Goal

More Coverage is better: Good
Actual number does not matter
False quantifiability: bad
Use coverage results to understand
 your code




                                scmGalaxy.com
Good: Write more tests




   Only way to truly increase code
              coverage




                                scmGalaxy.com
Bad

      Excluding Code to boost
 Coverage




                                scmGalaxy.com
Types of Coverage

Statement Coverage
Branch Coverage
Path Coverage
Loop Path Coverage
Data – driven Code
Complex Conditionals
Hidden Branches




                        scmGalaxy.com
Code Coverage Terminologies

 Instrumentation
 Instrumentation is the process to add code to the
 application to be able to output Code Coverage data.
 Instrumentation can be done at Source Level or at
 Intermediate language level, and rarely at run-time as
 information collection.

 Source Level Instrumentation: Prior to compilation,
 instrumentation code are inserted by the code coverage
 tool to the application. This will be compiled into the
 application code.
 Object level Instrumentation: Post compilation of the
 Application, executable lines to collect Coverage data are
 injected into the Object code.

 Merge
 Ability to run tests in batches, or in different environments,
 yet consolidate the overall coverage reports. Most of good
 coverage tools support offline merge feature.



                                                      scmGalaxy.com
Tooling Infrastructure


For Code Coverage analysis the ideal
 infrastructure would be
- Integrated Instrumentation with the
 build process
- Deployment of Code Coverage
 instrumented application
- Auto-Collection of Coverage data
 during testing
- Merge & Final Report automation
Code Coverage reports can be
 generated on every test cycle if tests.
                                  scmGalaxy.com
Code Coverage is NOT

 What Code Coverage is and is Not100% Code Coverage
  Does Not say the product is bug free, it ensures product is
  100% tested. If the product was tested wrongly, Code
  Coverage can’t help.
 Code Coverage testing does not require any special test
  methods – On the instrumented build – any testing that is
  carried out will generate coverage data. Regular using of
  the instrumented application will generate coverage
  information as well.
 Code Coverage is not about Whitebox testing. Code
  coverage is generated when you test the application in Any
  way. To analyse the code, the review happens at Code
  Level. It is not Whitebox testing.
 Code Coverage is not only through Unit Testing or
  Automated Testing.
 Code Coverage does not require extra testing efforts
 Code Coverage is not an end game activity, the earlier the
  better. It gives scope to improve tests and cover more
  code, thereby ensuring higher quality.
 Code Coverage instrumented builds can’t be used for
  Performance Testing. It will add performance overhead.

                                                     scmGalaxy.com
How?
       scmGalaxy.com
Coverage Tools

Clover
Cobertura
Emma




                 scmGalaxy.com
www.scmGalaxy.com

sG                   Author: Rajesh Kumar
                     rajesh@scmGalaxy.com




     scmGalaxy.com

Contenu connexe

Tendances

An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit TestingJoe Tremblay
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with CypressYong Shean Chong
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Mohamed Taman
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing PyramidNaresh Jain
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingBethmi Gunasekara
 
A Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End TestingA Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End TestingSmartBear
 
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
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test AutomationNaveen Kumar Singh
 
Unit Testing in Angular
Unit Testing in AngularUnit Testing in Angular
Unit Testing in AngularKnoldus Inc.
 
Selenium Grid
Selenium GridSelenium Grid
Selenium Gridnirvdrum
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategytharindakasun
 
Agile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil KaradeAgile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil KaradeIndicThreads
 

Tendances (20)

Cypress testing
Cypress testingCypress testing
Cypress testing
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with Cypress
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
 
Test Automation
Test AutomationTest Automation
Test Automation
 
Testing in Agile Development
Testing in Agile DevelopmentTesting in Agile Development
Testing in Agile Development
 
Static Code Analysis
Static Code AnalysisStatic Code Analysis
Static Code Analysis
 
A Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End TestingA Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End Testing
 
Rest assured
Rest assuredRest assured
Rest assured
 
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
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
 
Unit Testing in Angular
Unit Testing in AngularUnit Testing in Angular
Unit Testing in Angular
 
Selenium Grid
Selenium GridSelenium Grid
Selenium Grid
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategy
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Agile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil KaradeAgile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil Karade
 

En vedette

SCM Process and smartBuild
SCM Process and smartBuildSCM Process and smartBuild
SCM Process and smartBuildRajesh Kumar
 
Configuration Management in Software Engineering - SE29
Configuration Management in Software Engineering - SE29Configuration Management in Software Engineering - SE29
Configuration Management in Software Engineering - SE29koolkampus
 
Software configuration management
Software configuration managementSoftware configuration management
Software configuration managementJulia Carolina
 
Build And Automation
Build And AutomationBuild And Automation
Build And AutomationRajesh Kumar
 
Configuration Management
Configuration ManagementConfiguration Management
Configuration ManagementRajesh Kumar
 
Code Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoCode Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoEvgeny Mandrikov
 
Software configuration management in deep
Software configuration management in deepSoftware configuration management in deep
Software configuration management in deepFáber D. Giraldo
 
ISO 29119 and Software Testing - now what??
ISO 29119 and Software Testing - now what??ISO 29119 and Software Testing - now what??
ISO 29119 and Software Testing - now what??Fáber D. Giraldo
 
Branching and Merging Practices
Branching and Merging Practices Branching and Merging Practices
Branching and Merging Practices Rajesh Kumar
 
Fundamental of apache maven
Fundamental of apache mavenFundamental of apache maven
Fundamental of apache mavenRajesh Kumar
 
Software configuration management
Software configuration managementSoftware configuration management
Software configuration managementShivani Garg
 
Software Configuration Management And CVS
Software Configuration Management And CVSSoftware Configuration Management And CVS
Software Configuration Management And CVSRajesh Kumar
 
Software Configuration Management (SCM)
Software Configuration Management (SCM)Software Configuration Management (SCM)
Software Configuration Management (SCM)Nishkarsh Gupta
 
Introduction To Software Configuration Management
Introduction To Software Configuration ManagementIntroduction To Software Configuration Management
Introduction To Software Configuration ManagementRajesh Kumar
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration ManagementChandan Chaurasia
 

En vedette (16)

SCM Process and smartBuild
SCM Process and smartBuildSCM Process and smartBuild
SCM Process and smartBuild
 
Configuration Management in Software Engineering - SE29
Configuration Management in Software Engineering - SE29Configuration Management in Software Engineering - SE29
Configuration Management in Software Engineering - SE29
 
Software configuration management
Software configuration managementSoftware configuration management
Software configuration management
 
Build And Automation
Build And AutomationBuild And Automation
Build And Automation
 
Configuration Management
Configuration ManagementConfiguration Management
Configuration Management
 
Code Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCoCode Coverage Revised : EclEmma on JaCoCo
Code Coverage Revised : EclEmma on JaCoCo
 
Software configuration management in deep
Software configuration management in deepSoftware configuration management in deep
Software configuration management in deep
 
ISO 29119 and Software Testing - now what??
ISO 29119 and Software Testing - now what??ISO 29119 and Software Testing - now what??
ISO 29119 and Software Testing - now what??
 
Branching and Merging Practices
Branching and Merging Practices Branching and Merging Practices
Branching and Merging Practices
 
Why Scm
Why ScmWhy Scm
Why Scm
 
Fundamental of apache maven
Fundamental of apache mavenFundamental of apache maven
Fundamental of apache maven
 
Software configuration management
Software configuration managementSoftware configuration management
Software configuration management
 
Software Configuration Management And CVS
Software Configuration Management And CVSSoftware Configuration Management And CVS
Software Configuration Management And CVS
 
Software Configuration Management (SCM)
Software Configuration Management (SCM)Software Configuration Management (SCM)
Software Configuration Management (SCM)
 
Introduction To Software Configuration Management
Introduction To Software Configuration ManagementIntroduction To Software Configuration Management
Introduction To Software Configuration Management
 
Software Configuration Management
Software Configuration ManagementSoftware Configuration Management
Software Configuration Management
 

Similaire à Code coverage & tools

Top 5 Code Coverage Tools in DevOps
Top 5 Code Coverage Tools in DevOpsTop 5 Code Coverage Tools in DevOps
Top 5 Code Coverage Tools in DevOpsscmGalaxy Inc
 
Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assuranceTOPS Technologies
 
End to End Cloud App Deployment Solution
End to End Cloud App Deployment SolutionEnd to End Cloud App Deployment Solution
End to End Cloud App Deployment SolutionZuhaib Ansari
 
[India Merge World Tour] Coverity
[India Merge World Tour] Coverity[India Merge World Tour] Coverity
[India Merge World Tour] CoverityPerforce
 
Security Validation as Code.pdf
Security Validation as Code.pdfSecurity Validation as Code.pdf
Security Validation as Code.pdfPrancer Io
 
Security Validation as Code
Security Validation as CodeSecurity Validation as Code
Security Validation as CodePrancer Io
 
Coding and testing in Software Engineering
Coding and testing in Software EngineeringCoding and testing in Software Engineering
Coding and testing in Software EngineeringAbhay Vijay
 
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
 
Certified Software Testing Professional
Certified Software Testing ProfessionalCertified Software Testing Professional
Certified Software Testing ProfessionalNarender Rana
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedAshley Zupkus
 
Software Testing Certification
Software Testing CertificationSoftware Testing Certification
Software Testing CertificationVskills
 
SOFTWARE TESTING.pptx
SOFTWARE TESTING.pptxSOFTWARE TESTING.pptx
SOFTWARE TESTING.pptxssrpr
 
Improving ROI with Scriptless Test Automation
Improving ROI with Scriptless Test AutomationImproving ROI with Scriptless Test Automation
Improving ROI with Scriptless Test AutomationMindfire LLC
 
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
Parasoft .TEST, Write better C# Code Using  Data Flow Analysis Parasoft .TEST, Write better C# Code Using  Data Flow Analysis
Parasoft .TEST, Write better C# Code Using Data Flow Analysis Engineering Software Lab
 
How Does No Code Testing Work........pdf
How Does No Code Testing Work........pdfHow Does No Code Testing Work........pdf
How Does No Code Testing Work........pdfpcloudy2
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Security Validation
Security ValidationSecurity Validation
Security ValidationPrancer Io
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentalsAbdul Basit
 

Similaire à Code coverage & tools (20)

Top 5 Code Coverage Tools in DevOps
Top 5 Code Coverage Tools in DevOpsTop 5 Code Coverage Tools in DevOps
Top 5 Code Coverage Tools in DevOps
 
Software testing and quality assurance
Software testing and quality assuranceSoftware testing and quality assurance
Software testing and quality assurance
 
End to End Cloud App Deployment Solution
End to End Cloud App Deployment SolutionEnd to End Cloud App Deployment Solution
End to End Cloud App Deployment Solution
 
[India Merge World Tour] Coverity
[India Merge World Tour] Coverity[India Merge World Tour] Coverity
[India Merge World Tour] Coverity
 
Security Validation as Code.pdf
Security Validation as Code.pdfSecurity Validation as Code.pdf
Security Validation as Code.pdf
 
Security Validation as Code
Security Validation as CodeSecurity Validation as Code
Security Validation as Code
 
Coding and testing in Software Engineering
Coding and testing in Software EngineeringCoding and testing in Software Engineering
Coding and testing in Software Engineering
 
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
 
Certified Software Testing Professional
Certified Software Testing ProfessionalCertified Software Testing Professional
Certified Software Testing Professional
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
 
Software Testing Certification
Software Testing CertificationSoftware Testing Certification
Software Testing Certification
 
SOFTWARE TESTING.pptx
SOFTWARE TESTING.pptxSOFTWARE TESTING.pptx
SOFTWARE TESTING.pptx
 
Improving ROI with Scriptless Test Automation
Improving ROI with Scriptless Test AutomationImproving ROI with Scriptless Test Automation
Improving ROI with Scriptless Test Automation
 
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
Parasoft .TEST, Write better C# Code Using  Data Flow Analysis Parasoft .TEST, Write better C# Code Using  Data Flow Analysis
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
 
How Does No Code Testing Work........pdf
How Does No Code Testing Work........pdfHow Does No Code Testing Work........pdf
How Does No Code Testing Work........pdf
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
Security Validation
Security ValidationSecurity Validation
Security Validation
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
 
Software testing (2)
Software testing (2)Software testing (2)
Software testing (2)
 
Software coding and testing
Software coding and testingSoftware coding and testing
Software coding and testing
 

Plus de Rajesh Kumar

Plus de Rajesh Kumar (20)

Git and github fundamental
Git and github fundamentalGit and github fundamental
Git and github fundamental
 
Tools for quality matrix and kloc
Tools for quality matrix and klocTools for quality matrix and kloc
Tools for quality matrix and kloc
 
Cast vs sonar
Cast vs sonarCast vs sonar
Cast vs sonar
 
Cast vs sonar
Cast vs sonarCast vs sonar
Cast vs sonar
 
Testing in a glance
Testing in a glanceTesting in a glance
Testing in a glance
 
Rpm cheatbook
Rpm cheatbookRpm cheatbook
Rpm cheatbook
 
Scm process assessment guide
Scm process assessment guideScm process assessment guide
Scm process assessment guide
 
Cruise control
Cruise controlCruise control
Cruise control
 
Cloud computer
Cloud computerCloud computer
Cloud computer
 
Version Control With CVS
Version Control With CVSVersion Control With CVS
Version Control With CVS
 
Using Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee ApplicationsUsing Ant To Build J2 Ee Applications
Using Ant To Build J2 Ee Applications
 
Scm With Mks Integrity
Scm With Mks IntegrityScm With Mks Integrity
Scm With Mks Integrity
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
Introduction To Ant1
Introduction To  Ant1Introduction To  Ant1
Introduction To Ant1
 
Apache Ant
Apache AntApache Ant
Apache Ant
 
Process
ProcessProcess
Process
 
Oot
OotOot
Oot
 
Ood Post1
Ood Post1Ood Post1
Ood Post1
 
Ooa 1 Post
Ooa 1 PostOoa 1 Post
Ooa 1 Post
 
Ooa 2 Post1
Ooa 2 Post1Ooa 2 Post1
Ooa 2 Post1
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Code coverage & tools

  • 1. www.scmGalaxy.com sG Author: Rajesh Kumar rajesh@scmGalaxy.com scmGalaxy scmGalaxy.com
  • 2. What is Code Coverage  Code Coverage is an important measurement in Software Quality Engineering. While Software testing ensures correctness of the applications, a metric is required to track the completeness and effectiveness of the testing undertaken.  Code Coverage helps achieve reliable quality through identifying untested areas of the application. scmGalaxy.com
  • 3. Why Code Coverage Software testing is a challenging function. The testers need to ensure complete functional and non-functional correctness of the product. Considering the complex workflows and use cases of modern day applications, the number of unique cases that the software can be used often run into millions, which is not feasible to be covered under testing exercise. The testers thus need to - While Planning Tests o Ensure covering all workflows in terms of decision trees in the code o Ensure covering all data values – by identifying patterns rather covering millions of values - While testing o Ensuring the testing is completely exercising the whole application with planned and exploratory tests. scmGalaxy.com
  • 4. Why Code Coverage cont… At the end of testing, the decision to stop testing and release the product still remains subjective, based on the presence or absence of bugs, inflow of new bugs, success rate of each test cycle, confidence rating of the testers or users, etc. Whereas the definitive metric of quantifying how much of the application was really tested, is missed. Code Coverage is measured as quantification of application code exercised by the testing activities. Code Coverage can be measured at various levels – in terms of programming language constructs – Packages, Classes, Methods, Branches or in terms of physical artifacts - Folders, Files and Lines. For Eg. A Line Coverage metric of 67% means the testing exercised 67% of all executable statements of the application. A Code Coverage metric usually is accompanied by Code Coverage Analysis Report – which helps identify the un-tested part of the application code, thereby giving the testers early inputs for complete testing. scmGalaxy.com
  • 5. Benefits of Code Coverage  Objective Indicator of Test Coverage of application code  Pointers to uncovered Packages / Classes / Methods / Branches  Pointers to uncovered Folders / Files / Lines  Drill down to untested part of source code and devise new tests  Early Indicator for Testing Quality and Fixing it by adding new tests.  Remove redundancy in testing  Increased Confidence for Releases scmGalaxy.com
  • 6. Test Your Test scmGalaxy.com
  • 7. Typical Emotional Storyboard Write Some code! Happy! Does it work? Sad! Write some test! Happy! Do they really test the code? Sad! Measure the Code Coverage! Happy! scmGalaxy.com
  • 8. Coverage Measurement Shows Which line of code are executed How much of your code is covered by your tests? Your tests test your product Coverage testing tests your tests scmGalaxy.com
  • 9. Goal 100%  Coverage Ideal  Not Always possible  Can be expensive to achieve  Design for testability scmGalaxy.com
  • 10. Practical Goal More Coverage is better: Good Actual number does not matter False quantifiability: bad Use coverage results to understand your code scmGalaxy.com
  • 11. Good: Write more tests Only way to truly increase code coverage scmGalaxy.com
  • 12. Bad Excluding Code to boost Coverage scmGalaxy.com
  • 13. Types of Coverage Statement Coverage Branch Coverage Path Coverage Loop Path Coverage Data – driven Code Complex Conditionals Hidden Branches scmGalaxy.com
  • 14. Code Coverage Terminologies Instrumentation Instrumentation is the process to add code to the application to be able to output Code Coverage data. Instrumentation can be done at Source Level or at Intermediate language level, and rarely at run-time as information collection. Source Level Instrumentation: Prior to compilation, instrumentation code are inserted by the code coverage tool to the application. This will be compiled into the application code. Object level Instrumentation: Post compilation of the Application, executable lines to collect Coverage data are injected into the Object code. Merge Ability to run tests in batches, or in different environments, yet consolidate the overall coverage reports. Most of good coverage tools support offline merge feature. scmGalaxy.com
  • 15. Tooling Infrastructure For Code Coverage analysis the ideal infrastructure would be - Integrated Instrumentation with the build process - Deployment of Code Coverage instrumented application - Auto-Collection of Coverage data during testing - Merge & Final Report automation Code Coverage reports can be generated on every test cycle if tests. scmGalaxy.com
  • 16. Code Coverage is NOT  What Code Coverage is and is Not100% Code Coverage Does Not say the product is bug free, it ensures product is 100% tested. If the product was tested wrongly, Code Coverage can’t help.  Code Coverage testing does not require any special test methods – On the instrumented build – any testing that is carried out will generate coverage data. Regular using of the instrumented application will generate coverage information as well.  Code Coverage is not about Whitebox testing. Code coverage is generated when you test the application in Any way. To analyse the code, the review happens at Code Level. It is not Whitebox testing.  Code Coverage is not only through Unit Testing or Automated Testing.  Code Coverage does not require extra testing efforts  Code Coverage is not an end game activity, the earlier the better. It gives scope to improve tests and cover more code, thereby ensuring higher quality.  Code Coverage instrumented builds can’t be used for Performance Testing. It will add performance overhead. scmGalaxy.com
  • 17. How? scmGalaxy.com
  • 19. www.scmGalaxy.com sG Author: Rajesh Kumar rajesh@scmGalaxy.com scmGalaxy.com