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

Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaEdureka!
 
Regression testing
Regression testingRegression testing
Regression testingMohua Amin
 
Software Testing 101
Software Testing 101Software Testing 101
Software Testing 101QA Hannah
 
Regression testing
Regression testingRegression testing
Regression testingHarsh verma
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDDDror Helper
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeEmre Dündar
 
Static Analysis with Sonarlint
Static Analysis with SonarlintStatic Analysis with Sonarlint
Static Analysis with SonarlintUT, San Antonio
 
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
 
Exploratory testing
Exploratory testingExploratory testing
Exploratory testingHuib Schoots
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPTsuhasreddy1
 
What is Regression Testing? | Edureka
What is Regression Testing? | EdurekaWhat is Regression Testing? | Edureka
What is Regression Testing? | EdurekaEdureka!
 
risk based testing and regression testing
risk based testing and regression testingrisk based testing and regression testing
risk based testing and regression testingToshi Patel
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingDimitri Ponomareff
 
Agile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User GroupAgile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User Groupsuwalki24.pl
 

Tendances (20)

Testing & Quality Assurance
Testing & Quality AssuranceTesting & Quality Assurance
Testing & Quality Assurance
 
Sonarqube
SonarqubeSonarqube
Sonarqube
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
 
Regression testing
Regression testingRegression testing
Regression testing
 
QA process Presentation
QA process PresentationQA process Presentation
QA process Presentation
 
Istqb foundation level day 1
Istqb foundation level   day 1Istqb foundation level   day 1
Istqb foundation level day 1
 
Regression testing
Regression testingRegression testing
Regression testing
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Software Testing 101
Software Testing 101Software Testing 101
Software Testing 101
 
Regression testing
Regression testingRegression testing
Regression testing
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
 
Static Analysis with Sonarlint
Static Analysis with SonarlintStatic Analysis with Sonarlint
Static Analysis with Sonarlint
 
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
 
Exploratory testing
Exploratory testingExploratory testing
Exploratory testing
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
 
What is Regression Testing? | Edureka
What is Regression Testing? | EdurekaWhat is Regression Testing? | Edureka
What is Regression Testing? | Edureka
 
risk based testing and regression testing
risk based testing and regression testingrisk based testing and regression testing
risk based testing and regression testing
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
Agile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User GroupAgile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User Group
 

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
 
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
 
White box & black box testing
White box & black box testingWhite box & black box testing
White box & black box testingSaket Khopkar
 

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
 
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
 
White box & black box testing
White box & black box testingWhite box & black box testing
White box & black box 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

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Dernier (20)

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

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