SlideShare a Scribd company logo
Revisiting Assert Use in
GitHub Projects
Pavneet Singh Kochhar, and David Lo
Singapore Management University
21st International Conference on
Evaluation and Assessment in Software Engineering (EASE)
Assertions
• To test the assumptions about a piece of code
• Contains a boolean expression
2/30
Next
statements
Assertion
Error
Expr.
Assertions Example
• Checking null condition
3/30
Use of Assertions
• Enforce
• Preconditions
• Postconditions
• Invariants
• Effective way to detect and correct bugs earlier
• Similar to unit test directly embedded in the code
• Tests the program on real data
• Also serve as documentation to improve readability and
maintainability
4/30
Original Study
Casalnuovo et al. – “Assert Use in GitHub Projects”
• Goal – To understand impact of asserts on defect occurrence
• 69 C and C++ projects from GitHub
• Metrics – LOC added, No. of developers, No. of bug-fix
commits, No. of asserts
• Bug-fix commits – “bug”, “error”, “defect”, “flaw”, “issue”
5/30
Original Study
RQ1: How does assertion use relate to defect occurrence?
Asserts have a negative and significant relationship with
defect occurrence.
RQ2: How does assertion use relate to the collaborative/human
aspects of software engineering, such as ownership and
experience?
Developers who have added asserts have higher
ownership and experience.
6/30
Original Study
RQ3: What aspects of network position of a method in a call-
graph are associated with assertion placement?
No conclusive results were found for other network
measures such as authority, in-degree, out-degree and
betweeness.
RQ4: Does the domain of application of a project relate to
assertion use?
Application domain has no impact on the number of
assertions added.
7/30
Our Study
Partial replication of Casalnuovo et al.
RQ1: How does assertion use relate to defect occurrence?
RQ2: How does assertion use relate to developer characteristics
such as code ownership and experience?
RQ3: How are asserts used by developers?
8/30
Original Study vs. Our Study
9/30
Original Our
Number of
Projects
69 185
Language C, C++ Java
Research
Questions
1 Assert vs. Defect
Occurrence
1 Assert vs. Defect
Occurrence
2 Assert vs. Ownership
& Experience
2 Assert vs. Ownership
& Experience
3 Assert vs. Network
metrics 3 Assert Usage
4 Assert vs. Domain of
application
Data Collection
342 projects
10
>10 asserts added
185 projects
Popular – Apache Hadoop, HttpClient, Maven etc.
Dataset
11
Project Details
Number of Projects 185
Number of Developers 2791
KLOC 20,033
Number of Files 201,600
Number of Methods 1,993,828
Assert Methods 30,253
Total Period 12/1998 – 04/2016
# All Commits Total 4,852,069
With Asserts 7,540
#Bugfix Commits Total 29,867
With Asserts 741
Statistical Method
12
• Hurdle regression model
- Hurdle component
- Count component
• Dependent variables
Number of bug fixing commits
• Independent variables
Number of asserts
• Control variables
Lines changed, number of developers
Research Questions
RQ1:
How does assertion use relate to
defect occurrence?
13
RQ1: Assertion & Defect Occurrence
14
RQ1: Assertion & Defect Occurrence
15
RQ1 Findings
Adding asserts lead to lower defect
occurrence
Asserts added to methods with many
developers has a larger effect
16
Research Questions
RQ2:
How does assertion use relate to
developer characteristics such as code
ownership and experience?
17
Ownership & Experience
18
• Ownership
% of changes made to a method by a developer.
• Experience
Total number of commits made by the developer to a
method.
RQ2: Assertion & Ownership
19
MWW test p-value < 2.2e-16
Effect Size (Cohen’s d) - Medium
RQ2: Assertion & Experience
20
MWW test p-value < 2.2e-16
Effect Size (Cohen’s d) - Small
RQ2 Findings
Developers who added asserts have higher
ownership and experience
21
Research Questions
RQ3:
How are asserts used by developers?
22
Types of Asserts
23
• Null Condition Check
• Process State Check
• Initialization Check
• Resource Check
• Resource Lock Check
• Min and Max Value Constraint Check
• Collection Data and Length Check
• Implausible Condition Check
RQ3: Assert Usage
24
Null Condition check
RQ3: Assert Usage
25
Process State check
RQ3: Assert Usage
26
Initialization check
RQ3: Assert Usage
27
Resource check
RQ3: Assert Usage
28
Resource Lock check
RQ3: Assert Usage
29
Min & Max Value Constraint check
RQ3: Assert Usage
30
Collection Data & Length check
RQ3: Assert Usage
31
Implausible Condition check
RQ3 Findings
Asserts are used for several purposes such
as null check, resource lock check etc.
32
Key Takeaways
Adding asserts to a method have a small yet
significant relationship with defect occurrence.
Developers that added asserts have higher
ownership and experience
Assert Usage - null condition, initialization, process
state, resource lock, implausible condition, etc.
33/30
Thank You!
www.kochharps.wix.com/pavneet
kochharps.2012@smu.edu.sg

More Related Content

What's hot

Using HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsUsing HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review Analytics
The University of Adelaide
 
Who Should Review My Code?
Who Should Review My Code?  Who Should Review My Code?
Who Should Review My Code?
The University of Adelaide
 
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
The University of Adelaide
 
A Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software RefactoringA Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software Refactoring
Ali Ouni
 
Adopting code reviews for agile software development
Adopting code reviews for agile software developmentAdopting code reviews for agile software development
Adopting code reviews for agile software development
mariobernhart
 
Software bug prediction
Software bug prediction Software bug prediction
Software bug prediction
Muthukumaran Kasinathan
 
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
The University of Adelaide
 
An Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source ProjectsAn Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source Projects
Pavneet Singh Kochhar
 
Improving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer RecommendationsImproving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer Recommendations
The University of Adelaide
 
Recommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringRecommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software Enginnering
Ali Ouni
 
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
Ali Ouni
 
DerekGorthySandiaLOR
DerekGorthySandiaLORDerekGorthySandiaLOR
DerekGorthySandiaLOR
Derek Gorthy
 
Replication and Benchmarking in Software Analytics
Replication and Benchmarking in Software AnalyticsReplication and Benchmarking in Software Analytics
Replication and Benchmarking in Software Analytics
University of Zurich
 
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Fabio Palomba
 
Assessing the Reliability of a Human Estimator
Assessing the Reliability of a Human EstimatorAssessing the Reliability of a Human Estimator
Assessing the Reliability of a Human Estimator
Tim Menzies
 
Using Developer Information as a Prediction Factor
Using Developer Information as a Prediction FactorUsing Developer Information as a Prediction Factor
Using Developer Information as a Prediction Factor
Tim Menzies
 
Fse2012 shihab
Fse2012 shihabFse2012 shihab
Fse2012 shihab
SAIL_QU
 
Developer-Related Factors in Change Prediction: An Empirical Assessment
Developer-Related Factors in Change Prediction: An Empirical AssessmentDeveloper-Related Factors in Change Prediction: An Empirical Assessment
Developer-Related Factors in Change Prediction: An Empirical Assessment
Gemma Catolino
 
Data collection for software defect prediction
Data collection for software defect predictionData collection for software defect prediction
Data collection for software defect prediction
AmmAr mobark
 
Cser13.ppt
Cser13.pptCser13.ppt
Cser13.ppt
Ptidej Team
 

What's hot (20)

Using HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsUsing HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review Analytics
 
Who Should Review My Code?
Who Should Review My Code?  Who Should Review My Code?
Who Should Review My Code?
 
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...Ph.D. Thesis Defense:  Studying Reviewer Selection and Involvement in Modern ...
Ph.D. Thesis Defense: Studying Reviewer Selection and Involvement in Modern ...
 
A Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software RefactoringA Mono- and Multi-objective Approach for Recommending Software Refactoring
A Mono- and Multi-objective Approach for Recommending Software Refactoring
 
Adopting code reviews for agile software development
Adopting code reviews for agile software developmentAdopting code reviews for agile software development
Adopting code reviews for agile software development
 
Software bug prediction
Software bug prediction Software bug prediction
Software bug prediction
 
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...Revisiting Code Ownership and Its Relationship with Software Quality in the S...
Revisiting Code Ownership and Its Relationship with Software Quality in the S...
 
An Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source ProjectsAn Empirical Study on the Adequacy of Testing in Open Source Projects
An Empirical Study on the Adequacy of Testing in Open Source Projects
 
Improving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer RecommendationsImproving Code Review Effectiveness Through Reviewer Recommendations
Improving Code Review Effectiveness Through Reviewer Recommendations
 
Recommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringRecommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software Enginnering
 
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
 
DerekGorthySandiaLOR
DerekGorthySandiaLORDerekGorthySandiaLOR
DerekGorthySandiaLOR
 
Replication and Benchmarking in Software Analytics
Replication and Benchmarking in Software AnalyticsReplication and Benchmarking in Software Analytics
Replication and Benchmarking in Software Analytics
 
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
 
Assessing the Reliability of a Human Estimator
Assessing the Reliability of a Human EstimatorAssessing the Reliability of a Human Estimator
Assessing the Reliability of a Human Estimator
 
Using Developer Information as a Prediction Factor
Using Developer Information as a Prediction FactorUsing Developer Information as a Prediction Factor
Using Developer Information as a Prediction Factor
 
Fse2012 shihab
Fse2012 shihabFse2012 shihab
Fse2012 shihab
 
Developer-Related Factors in Change Prediction: An Empirical Assessment
Developer-Related Factors in Change Prediction: An Empirical AssessmentDeveloper-Related Factors in Change Prediction: An Empirical Assessment
Developer-Related Factors in Change Prediction: An Empirical Assessment
 
Data collection for software defect prediction
Data collection for software defect predictionData collection for software defect prediction
Data collection for software defect prediction
 
Cser13.ppt
Cser13.pptCser13.ppt
Cser13.ppt
 

Similar to Revisiting Assert Use in GitHub Projects

Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Pavneet Singh Kochhar
 
Test-Driven Code Review: An Empirical Study
Test-Driven Code Review: An Empirical StudyTest-Driven Code Review: An Empirical Study
Test-Driven Code Review: An Empirical Study
Delft University of Technology
 
Practices and Tools for Better Software Testing
Practices and Tools for  Better Software TestingPractices and Tools for  Better Software Testing
Practices and Tools for Better Software Testing
Delft University of Technology
 
Slides1 - testing
Slides1 - testingSlides1 - testing
Slides1 - testing
Jyothi Vbs
 
How do Developers Test Android Applications?
How do Developers Test Android Applications?How do Developers Test Android Applications?
How do Developers Test Android Applications?
Kevin Moran
 
Webcast Presentation: Accelerate Continuous Delivery with Development Testing...
Webcast Presentation: Accelerate Continuous Delivery with Development Testing...Webcast Presentation: Accelerate Continuous Delivery with Development Testing...
Webcast Presentation: Accelerate Continuous Delivery with Development Testing...
GRUC
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
Kenta Yamamoto
 
What are the Characteristics of High-rated Apps
What are the Characteristics of High-rated AppsWhat are the Characteristics of High-rated Apps
What are the Characteristics of High-rated Apps
SAIL_QU
 
OOSE Unit 5 PPT.ppt
OOSE Unit 5 PPT.pptOOSE Unit 5 PPT.ppt
OOSE Unit 5 PPT.ppt
itadmin33
 
Oose unit 5 ppt
Oose unit 5 pptOose unit 5 ppt
Oose unit 5 ppt
Dr VISU P
 
Metrics Analysis on Continuous System Test (ASQN 2016)
Metrics Analysis on Continuous System Test (ASQN 2016)Metrics Analysis on Continuous System Test (ASQN 2016)
Metrics Analysis on Continuous System Test (ASQN 2016)
Kotaro Ogino
 
Alleman coonce-agile-2017 may2
Alleman coonce-agile-2017 may2Alleman coonce-agile-2017 may2
Alleman coonce-agile-2017 may2
Glen Alleman
 
Traceability Beyond Source Code: An Elusive Target?
Traceability Beyond Source Code: An Elusive Target?Traceability Beyond Source Code: An Elusive Target?
Traceability Beyond Source Code: An Elusive Target?
Lionel Briand
 
Automated Discovery of Performance Regressions in Enterprise Applications
Automated Discovery of Performance Regressions in Enterprise ApplicationsAutomated Discovery of Performance Regressions in Enterprise Applications
Automated Discovery of Performance Regressions in Enterprise Applications
SAIL_QU
 
The Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution AnalysesThe Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution Analyses
SAIL_QU
 
Costing ass4
Costing ass4Costing ass4
Costing ass4
BakhtyarBilal
 
Agile for Software as a Medical Device
Agile for Software as a Medical DeviceAgile for Software as a Medical Device
Agile for Software as a Medical Device
Orthogonal
 
Understanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptUnderstanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScript
Mark Daggett
 
An overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in AndroidAn overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in Android
Vahid Garousi
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
Ashley Zupkus
 

Similar to Revisiting Assert Use in GitHub Projects (20)

Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
Code Coverage and Test Suite Effectiveness: Empirical Study with Real Bugs in...
 
Test-Driven Code Review: An Empirical Study
Test-Driven Code Review: An Empirical StudyTest-Driven Code Review: An Empirical Study
Test-Driven Code Review: An Empirical Study
 
Practices and Tools for Better Software Testing
Practices and Tools for  Better Software TestingPractices and Tools for  Better Software Testing
Practices and Tools for Better Software Testing
 
Slides1 - testing
Slides1 - testingSlides1 - testing
Slides1 - testing
 
How do Developers Test Android Applications?
How do Developers Test Android Applications?How do Developers Test Android Applications?
How do Developers Test Android Applications?
 
Webcast Presentation: Accelerate Continuous Delivery with Development Testing...
Webcast Presentation: Accelerate Continuous Delivery with Development Testing...Webcast Presentation: Accelerate Continuous Delivery with Development Testing...
Webcast Presentation: Accelerate Continuous Delivery with Development Testing...
 
Vulnerability Detection Based on Git History
Vulnerability Detection Based on Git HistoryVulnerability Detection Based on Git History
Vulnerability Detection Based on Git History
 
What are the Characteristics of High-rated Apps
What are the Characteristics of High-rated AppsWhat are the Characteristics of High-rated Apps
What are the Characteristics of High-rated Apps
 
OOSE Unit 5 PPT.ppt
OOSE Unit 5 PPT.pptOOSE Unit 5 PPT.ppt
OOSE Unit 5 PPT.ppt
 
Oose unit 5 ppt
Oose unit 5 pptOose unit 5 ppt
Oose unit 5 ppt
 
Metrics Analysis on Continuous System Test (ASQN 2016)
Metrics Analysis on Continuous System Test (ASQN 2016)Metrics Analysis on Continuous System Test (ASQN 2016)
Metrics Analysis on Continuous System Test (ASQN 2016)
 
Alleman coonce-agile-2017 may2
Alleman coonce-agile-2017 may2Alleman coonce-agile-2017 may2
Alleman coonce-agile-2017 may2
 
Traceability Beyond Source Code: An Elusive Target?
Traceability Beyond Source Code: An Elusive Target?Traceability Beyond Source Code: An Elusive Target?
Traceability Beyond Source Code: An Elusive Target?
 
Automated Discovery of Performance Regressions in Enterprise Applications
Automated Discovery of Performance Regressions in Enterprise ApplicationsAutomated Discovery of Performance Regressions in Enterprise Applications
Automated Discovery of Performance Regressions in Enterprise Applications
 
The Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution AnalysesThe Impact of Task Granularity on Co-evolution Analyses
The Impact of Task Granularity on Co-evolution Analyses
 
Costing ass4
Costing ass4Costing ass4
Costing ass4
 
Agile for Software as a Medical Device
Agile for Software as a Medical DeviceAgile for Software as a Medical Device
Agile for Software as a Medical Device
 
Understanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptUnderstanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScript
 
An overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in AndroidAn overview of automated test suites and defect density in Android
An overview of automated test suites and defect density in Android
 
Zero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically GuaranteedZero-bug Software, Mathematically Guaranteed
Zero-bug Software, Mathematically Guaranteed
 

More from Pavneet Singh Kochhar

Mining Testing Questions on Stack Overflow
Mining Testing Questions on Stack OverflowMining Testing Questions on Stack Overflow
Mining Testing Questions on Stack Overflow
Pavneet Singh Kochhar
 
Cataloging GitHub Repositories
Cataloging GitHub RepositoriesCataloging GitHub Repositories
Cataloging GitHub Repositories
Pavneet Singh Kochhar
 
An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...
An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...
An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...
Pavneet Singh Kochhar
 
Practitioners’ Expectations on Automated Fault Localization
Practitioners’ Expectations on Automated Fault LocalizationPractitioners’ Expectations on Automated Fault Localization
Practitioners’ Expectations on Automated Fault Localization
Pavneet Singh Kochhar
 
A Large Scale Study of Multiple Programming Languages and Code Quality
A Large Scale Study of Multiple Programming Languages and Code QualityA Large Scale Study of Multiple Programming Languages and Code Quality
A Large Scale Study of Multiple Programming Languages and Code Quality
Pavneet Singh Kochhar
 
Understanding the Test Automation Culture of App Developers
Understanding the Test Automation Culture of App DevelopersUnderstanding the Test Automation Culture of App Developers
Understanding the Test Automation Culture of App Developers
Pavneet Singh Kochhar
 
Potential Biases in Bug Localization: Do They Matter?
Potential Biases in Bug Localization: Do They Matter?Potential Biases in Bug Localization: Do They Matter?
Potential Biases in Bug Localization: Do They Matter?
Pavneet Singh Kochhar
 
It’s Not a Bug, It’s a Feature: Does Misclassification Affect Bug Localization?
It’s Not a Bug, It’s a Feature:Does Misclassification Affect Bug Localization?It’s Not a Bug, It’s a Feature:Does Misclassification Affect Bug Localization?
It’s Not a Bug, It’s a Feature: Does Misclassification Affect Bug Localization?
Pavneet Singh Kochhar
 
Automatic Fine-Grained Issue Report Reclassification
Automatic Fine-Grained Issue Report ReclassificationAutomatic Fine-Grained Issue Report Reclassification
Automatic Fine-Grained Issue Report Reclassification
Pavneet Singh Kochhar
 

More from Pavneet Singh Kochhar (9)

Mining Testing Questions on Stack Overflow
Mining Testing Questions on Stack OverflowMining Testing Questions on Stack Overflow
Mining Testing Questions on Stack Overflow
 
Cataloging GitHub Repositories
Cataloging GitHub RepositoriesCataloging GitHub Repositories
Cataloging GitHub Repositories
 
An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...
An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...
An Exploratory Study of Functionality and Learning Resources of WebAPIs on Pr...
 
Practitioners’ Expectations on Automated Fault Localization
Practitioners’ Expectations on Automated Fault LocalizationPractitioners’ Expectations on Automated Fault Localization
Practitioners’ Expectations on Automated Fault Localization
 
A Large Scale Study of Multiple Programming Languages and Code Quality
A Large Scale Study of Multiple Programming Languages and Code QualityA Large Scale Study of Multiple Programming Languages and Code Quality
A Large Scale Study of Multiple Programming Languages and Code Quality
 
Understanding the Test Automation Culture of App Developers
Understanding the Test Automation Culture of App DevelopersUnderstanding the Test Automation Culture of App Developers
Understanding the Test Automation Culture of App Developers
 
Potential Biases in Bug Localization: Do They Matter?
Potential Biases in Bug Localization: Do They Matter?Potential Biases in Bug Localization: Do They Matter?
Potential Biases in Bug Localization: Do They Matter?
 
It’s Not a Bug, It’s a Feature: Does Misclassification Affect Bug Localization?
It’s Not a Bug, It’s a Feature:Does Misclassification Affect Bug Localization?It’s Not a Bug, It’s a Feature:Does Misclassification Affect Bug Localization?
It’s Not a Bug, It’s a Feature: Does Misclassification Affect Bug Localization?
 
Automatic Fine-Grained Issue Report Reclassification
Automatic Fine-Grained Issue Report ReclassificationAutomatic Fine-Grained Issue Report Reclassification
Automatic Fine-Grained Issue Report Reclassification
 

Recently uploaded

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 

Recently uploaded (20)

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 

Revisiting Assert Use in GitHub Projects

  • 1. Revisiting Assert Use in GitHub Projects Pavneet Singh Kochhar, and David Lo Singapore Management University 21st International Conference on Evaluation and Assessment in Software Engineering (EASE)
  • 2. Assertions • To test the assumptions about a piece of code • Contains a boolean expression 2/30 Next statements Assertion Error Expr.
  • 3. Assertions Example • Checking null condition 3/30
  • 4. Use of Assertions • Enforce • Preconditions • Postconditions • Invariants • Effective way to detect and correct bugs earlier • Similar to unit test directly embedded in the code • Tests the program on real data • Also serve as documentation to improve readability and maintainability 4/30
  • 5. Original Study Casalnuovo et al. – “Assert Use in GitHub Projects” • Goal – To understand impact of asserts on defect occurrence • 69 C and C++ projects from GitHub • Metrics – LOC added, No. of developers, No. of bug-fix commits, No. of asserts • Bug-fix commits – “bug”, “error”, “defect”, “flaw”, “issue” 5/30
  • 6. Original Study RQ1: How does assertion use relate to defect occurrence? Asserts have a negative and significant relationship with defect occurrence. RQ2: How does assertion use relate to the collaborative/human aspects of software engineering, such as ownership and experience? Developers who have added asserts have higher ownership and experience. 6/30
  • 7. Original Study RQ3: What aspects of network position of a method in a call- graph are associated with assertion placement? No conclusive results were found for other network measures such as authority, in-degree, out-degree and betweeness. RQ4: Does the domain of application of a project relate to assertion use? Application domain has no impact on the number of assertions added. 7/30
  • 8. Our Study Partial replication of Casalnuovo et al. RQ1: How does assertion use relate to defect occurrence? RQ2: How does assertion use relate to developer characteristics such as code ownership and experience? RQ3: How are asserts used by developers? 8/30
  • 9. Original Study vs. Our Study 9/30 Original Our Number of Projects 69 185 Language C, C++ Java Research Questions 1 Assert vs. Defect Occurrence 1 Assert vs. Defect Occurrence 2 Assert vs. Ownership & Experience 2 Assert vs. Ownership & Experience 3 Assert vs. Network metrics 3 Assert Usage 4 Assert vs. Domain of application
  • 10. Data Collection 342 projects 10 >10 asserts added 185 projects Popular – Apache Hadoop, HttpClient, Maven etc.
  • 11. Dataset 11 Project Details Number of Projects 185 Number of Developers 2791 KLOC 20,033 Number of Files 201,600 Number of Methods 1,993,828 Assert Methods 30,253 Total Period 12/1998 – 04/2016 # All Commits Total 4,852,069 With Asserts 7,540 #Bugfix Commits Total 29,867 With Asserts 741
  • 12. Statistical Method 12 • Hurdle regression model - Hurdle component - Count component • Dependent variables Number of bug fixing commits • Independent variables Number of asserts • Control variables Lines changed, number of developers
  • 13. Research Questions RQ1: How does assertion use relate to defect occurrence? 13
  • 14. RQ1: Assertion & Defect Occurrence 14
  • 15. RQ1: Assertion & Defect Occurrence 15
  • 16. RQ1 Findings Adding asserts lead to lower defect occurrence Asserts added to methods with many developers has a larger effect 16
  • 17. Research Questions RQ2: How does assertion use relate to developer characteristics such as code ownership and experience? 17
  • 18. Ownership & Experience 18 • Ownership % of changes made to a method by a developer. • Experience Total number of commits made by the developer to a method.
  • 19. RQ2: Assertion & Ownership 19 MWW test p-value < 2.2e-16 Effect Size (Cohen’s d) - Medium
  • 20. RQ2: Assertion & Experience 20 MWW test p-value < 2.2e-16 Effect Size (Cohen’s d) - Small
  • 21. RQ2 Findings Developers who added asserts have higher ownership and experience 21
  • 22. Research Questions RQ3: How are asserts used by developers? 22
  • 23. Types of Asserts 23 • Null Condition Check • Process State Check • Initialization Check • Resource Check • Resource Lock Check • Min and Max Value Constraint Check • Collection Data and Length Check • Implausible Condition Check
  • 24. RQ3: Assert Usage 24 Null Condition check
  • 29. RQ3: Assert Usage 29 Min & Max Value Constraint check
  • 30. RQ3: Assert Usage 30 Collection Data & Length check
  • 32. RQ3 Findings Asserts are used for several purposes such as null check, resource lock check etc. 32
  • 33. Key Takeaways Adding asserts to a method have a small yet significant relationship with defect occurrence. Developers that added asserts have higher ownership and experience Assert Usage - null condition, initialization, process state, resource lock, implausible condition, etc. 33/30