Revisiting assert use in GitHub projects

Assertions are often used to test the assumptions that developers have about a program. An assertion contains a boolean expression which developers believe to be true at a particular program point. It throws an error if the expression is not satisfied, which helps developers to detect and correct bu...

Full description

Saved in:
Bibliographic Details
Main Authors: KOCHHAR, Pavneet Singh, LO, David
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2017
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/3740
https://ink.library.smu.edu.sg/context/sis_research/article/4742/viewcontent/p298_Kochhar.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-4742
record_format dspace
spelling sg-smu-ink.sis_research-47422017-09-13T05:15:32Z Revisiting assert use in GitHub projects KOCHHAR, Pavneet Singh LO, David Assertions are often used to test the assumptions that developers have about a program. An assertion contains a boolean expression which developers believe to be true at a particular program point. It throws an error if the expression is not satisfied, which helps developers to detect and correct bugs. Since assertions make developer assumptions explicit, assertions are also believed to improve under-standability of code. Recently, Casalnuovo et al. analyse C and C++ programs to understand the relationship between assertion usage and defect occurrence. Their results show that asserts have a small effect on reducing the density of bugs and developers often add asserts to methods they have prior knowledge of and larger ownership. In this study, we perform a partial replication of the above study on a large dataset of Java projects from GitHub (185 projects, 20 million LOC, 4 million commits, 0.2 million files and 1 million methods). We collect metrics such as number of asserts, number of defects, number of developers and number of lines changed to a method, and examine the relationship between asserts and defect occurrence. We also analyse relationship between developer experience and ownership and the number of asserts. Furthermore, we perform a study of what are different types of asserts added and why they are added by developers. We find that asserts have a small yet significant relationship with defect occurrence and developers who have added asserts to methods often have higher ownership of and experience with the methods than developers who did not add asserts. 2017-06-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/3740 info:doi/10.1145/3084226.3084259 https://ink.library.smu.edu.sg/context/sis_research/article/4742/viewcontent/p298_Kochhar.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University GitHub Assertions Replication study Numerical Analysis and Computation Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic GitHub
Assertions
Replication study
Numerical Analysis and Computation
Software Engineering
spellingShingle GitHub
Assertions
Replication study
Numerical Analysis and Computation
Software Engineering
KOCHHAR, Pavneet Singh
LO, David
Revisiting assert use in GitHub projects
description Assertions are often used to test the assumptions that developers have about a program. An assertion contains a boolean expression which developers believe to be true at a particular program point. It throws an error if the expression is not satisfied, which helps developers to detect and correct bugs. Since assertions make developer assumptions explicit, assertions are also believed to improve under-standability of code. Recently, Casalnuovo et al. analyse C and C++ programs to understand the relationship between assertion usage and defect occurrence. Their results show that asserts have a small effect on reducing the density of bugs and developers often add asserts to methods they have prior knowledge of and larger ownership. In this study, we perform a partial replication of the above study on a large dataset of Java projects from GitHub (185 projects, 20 million LOC, 4 million commits, 0.2 million files and 1 million methods). We collect metrics such as number of asserts, number of defects, number of developers and number of lines changed to a method, and examine the relationship between asserts and defect occurrence. We also analyse relationship between developer experience and ownership and the number of asserts. Furthermore, we perform a study of what are different types of asserts added and why they are added by developers. We find that asserts have a small yet significant relationship with defect occurrence and developers who have added asserts to methods often have higher ownership of and experience with the methods than developers who did not add asserts.
format text
author KOCHHAR, Pavneet Singh
LO, David
author_facet KOCHHAR, Pavneet Singh
LO, David
author_sort KOCHHAR, Pavneet Singh
title Revisiting assert use in GitHub projects
title_short Revisiting assert use in GitHub projects
title_full Revisiting assert use in GitHub projects
title_fullStr Revisiting assert use in GitHub projects
title_full_unstemmed Revisiting assert use in GitHub projects
title_sort revisiting assert use in github projects
publisher Institutional Knowledge at Singapore Management University
publishDate 2017
url https://ink.library.smu.edu.sg/sis_research/3740
https://ink.library.smu.edu.sg/context/sis_research/article/4742/viewcontent/p298_Kochhar.pdf
_version_ 1770573707500060672