The Impact of Code Review Coverage and Code Review Participation on Software Quality
Shane McIntosh Ahmed E. Hassan Bram Adams Yasutaka Kamei
The Impact of Code Review Coverage and Code Review Participation on - - PowerPoint PPT Presentation
The Impact of Code Review Coverage and Code Review Participation on Software Quality Shane Yasutaka Bram Ahmed E. McIntosh Kamei Adams Hassan Code reviews : An opportunity for constructive criticism of code changes Yasu Shane Bram
The Impact of Code Review Coverage and Code Review Participation on Software Quality
Shane McIntosh Ahmed E. Hassan Bram Adams Yasutaka Kamei
2
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Bram and Yasu, I made a code change. Could you have a look?
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Bram and Yasu, I made a code change. Could you have a look? No way, Shane!
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Bram and Yasu, I made a code change. Could you have a look? No way, Shane! Your code sucks!
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
3
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Bram and Yasu, I made a code change. Could you have a look?
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Bram and Yasu, I made a code change. Could you have a look? Watch about NULL values at line 3!
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Patch
+ +
Bram and Yasu, I made a code change. Could you have a look? Watch about NULL values at line 3! Your code still sucks!
Shane Bram Yasu
Code reviews: An opportunity for constructive criticism of code changes
Traditional Code Inspections
Mandated reviewer checklists and in-person meetings
Traditional Code Inspections
Mandated reviewer checklists and in-person meetings
Traditional Code Inspections
Mandated reviewer checklists and in-person meetings
Modern Code Review
Lightweight, tool-supported
Traditional Code Inspections
Mandated reviewer checklists and in-person meetings
Modern Code Review
Lightweight, tool-supported
5
Are properties of the modern code review process linked to software quality?
5
Are properties of the modern code review process linked to software quality?
5
Are properties of the modern code review process linked to software quality?
6
Are properties of the modern code review process linked to software quality?
Patch
+ +
+ +
Shane Bram Yasu
Gerrit
Patch
+ +
+ +
Shane Bram Yasu
Gerrit
Patch
+ +
+ +
Shane Bram Yasu
Gerrit Request review
Patch
+ +
+ +
Shane Bram Yasu
Gerrit Watch about NULL values at line 3!
Patch
+ +
+ +
Shane Bram Yasu
Gerrit Watch about NULL values at line 3! Your code sucks!
Patch
+ +
+ +
Shane Bram Yasu
Gerrit Watch about NULL values at line 3! Your code sucks!
8
Shane Bram Yasu
Gerrit
8
Shane Bram Yasu
Gerrit
8
Shane Bram Yasu
Gerrit Upstream
8
Shane Bram Yasu
Gerrit Upstream
9
Reviews can be linked to commits in source code repositories
commit b5b46f398c1a04ab443bf22ec08c5efbf72c161e Author: Alan Alpert <alan.alpert@nokia.com> Date: Thu Mar 1 20:09:52 2012 +1000Gerrit Upstream
9
Reviews can be linked to commits in source code repositories
commit b5b46f398c1a04ab443bf22ec08c5efbf72c161e Author: Alan Alpert <alan.alpert@nokia.com> Date: Thu Mar 1 20:09:52 2012 +1000Gerrit Upstream
9
Reviews can be linked to commits in source code repositories
commit b5b46f398c1a04ab443bf22ec08c5efbf72c161e Author: Alan Alpert <alan.alpert@nokia.com> Date: Thu Mar 1 20:09:52 2012 +1000Gerrit Upstream
9
Reviews can be linked to commits in source code repositories
commit b5b46f398c1a04ab443bf22ec08c5efbf72c161e Author: Alan Alpert <alan.alpert@nokia.com> Date: Thu Mar 1 20:09:52 2012 +1000Gerrit Upstream
10
Are properties of the modern code review process linked to software quality?
11
Software Quality as Post-Release Defect Counts
Upstream Development Release Feature development Defect repairing Merge Commit types
11
Software Quality as Post-Release Defect Counts
Upstream Development Release Feature development Defect repairing Merge Commit types
11
Software Quality as Post-Release Defect Counts
Upstream Development Release Feature development Defect repairing Merge Commit types
11
Software Quality as Post-Release Defect Counts
Upstream Development Release Feature development Defect repairing Merge Commit types
11
Software Quality as Post-Release Defect Counts
Upstream v1.0 Development Release Feature development Defect repairing Merge Commit types
11
Software Quality as Post-Release Defect Counts
Upstream v1.0 Development Release Feature development Defect repairing Merge Commit types
11
Software Quality as Post-Release Defect Counts
Upstream v1.0 Development Release Feature development Defect repairing Merge Commit types
12
How many defects?
12
How many defects?
v1.0
13
Development Release
13
Development Release Defect model v1.0
14
Defect model v1.0
14
Defect model v1.0
15
15
Product Metrics
15
Product Metrics
e.g., SLOC, complexity
15
Product Metrics
Process Metrics e.g., SLOC, complexity
15
Product Metrics
Process Metrics e.g., SLOC, complexity e.g., Prior defects, churn
15
Product Metrics
Process Metrics Human Factors Metrics e.g., SLOC, complexity e.g., Prior defects, churn
15
Product Metrics
Process Metrics Human Factors Metrics e.g., SLOC, complexity e.g., Prior defects, churn e.g., # Minor contributors
16
16
1,339 components 254 defect-prone v5.0.0 1,337 components 187 defect-prone v5.1.0
16
1,339 components 254 defect-prone v5.0.0 1,337 components 187 defect-prone v5.1.0 170 components 15 defect-prone v5.10.0
16
1,339 components 254 defect-prone v5.0.0 1,337 components 187 defect-prone v5.1.0 170 components 15 defect-prone v5.10.0 218 components 24 defect-prone v4.3.0
Are properties of the code reviewing process linked to software quality?
18
Are properties of the code reviewing process linked to software quality?
18
Are properties of the code reviewing process linked to software quality?
Metrics
Reviewed churn (%)
19
Concrete Predicted Defect Count
How many defects?
Create artificial component setting explanatory variables to median values
Artificial Comp. 500 SLOC Explanatory Variable Value Reviewed changes 100% Churn 150
20
Concrete Predicted Defect Count
How many defects?
Calculate number of predicted defects
Artificial Comp. 500 SLOC Explanatory Variable Value Reviewed changes 100% Churn 150
20
Concrete Predicted Defect Count
How many defects?
Calculate number of predicted defects
Artificial Comp. 500 SLOC Explanatory Variable Value Reviewed changes 100% Churn 150
21
Concrete Predicted Defect Count
How many defects?
Artificial Comp. 500 SLOC Explanatory Variable Value Reviewed changes 90% Churn 150
Modify variable under test while keeping other explanatory variables constant
21
Concrete Predicted Defect Count
How many defects?
Artificial Comp. 500 SLOC Explanatory Variable Value Reviewed changes 90% Churn 150
Modify variable under test while keeping other explanatory variables constant
21
Concrete Predicted Defect Count
How many defects?
Artificial Comp. 500 SLOC Explanatory Variable Value Reviewed changes 90% Churn 150
Modify variable under test while keeping other explanatory variables constant
22
Proportion of Reviewed Changes
2 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Proportion of Reviewed Changes Concrete Predicted Defect Count
VTK 5.10.0
23
Are properties of the code reviewing process linked to software quality?
Metrics
Reviewed churn (%)
23
Are properties of the code reviewing process linked to software quality?
Results
not tell the whole story
Metrics
Reviewed churn (%)
24
⇧ ⇧ ⇧ ⇧ Reviewed changes
9∗∗∗ ⇧
15∗∗∗ ⇧ Reviewed churn † † † † † Discarded during correlation analysis (|ρ| > 0.7) ‡ Discarded during VIF analysis (VIF coefficient > 5) Statistical significance of explanatory power according to Drop One analysis: ⇧ p 0.05; ∗ p < 0.05; ∗∗ p < 0.01; ∗∗∗ p < 0.001
Additional factors are likely at play
Qt VTK ITK 5.0.0 5.1.0 5.10.0 4.3.0
2
Coef. ∆AIC Coef. ∆AIC Coef. ∆AIC Coef. ∆AIC Size ⇧ 0.46 6 0.19 223.4 ⇧
24
⇧ ⇧ ⇧ ⇧ Reviewed changes
9∗∗∗ ⇧
15∗∗∗ ⇧ Reviewed churn † † † † † Discarded during correlation analysis (|ρ| > 0.7) ‡ Discarded during VIF analysis (VIF coefficient > 5) Statistical significance of explanatory power according to Drop One analysis: ⇧ p 0.05; ∗ p < 0.05; ∗∗ p < 0.01; ∗∗∗ p < 0.001
Additional factors are likely at play
Qt VTK ITK 5.0.0 5.1.0 5.10.0 4.3.0
2
Reviewed changes is not a significant contributor of explanatory power
Coef. ∆AIC Coef. ∆AIC Coef. ∆AIC Coef. ∆AIC Size ⇧ 0.46 6 0.19 223.4 ⇧
Are properties of the code reviewing process linked to software quality?
Metrics
Reviewed churn (%)
Results
not tell the whole story
Are properties of the code reviewing process linked to software quality?
Metrics
Hastily reviewed changes (%) Changes without discussion (%)
Metrics
Reviewed churn (%)
Results
not tell the whole story
27
2 3 4 5 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Metric Value Concrete Predicted Defect Count
Qt 5.1.0 ITK 4.3.0
No discussion Self−Approved
27
2 3 4 5 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Metric Value Concrete Predicted Defect Count
Qt 5.1.0 ITK 4.3.0
No discussion Self−Approved
5 additional post-release defects
27
2 3 4 5 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Metric Value Concrete Predicted Defect Count
Qt 5.1.0 ITK 4.3.0
No discussion Self−Approved
5 additional post-release defects 3 additional post-release defects
27
2 3 4 5 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Metric Value Concrete Predicted Defect Count
Qt 5.1.0 ITK 4.3.0
No discussion Self−Approved
5 additional post-release defects 3 additional post-release defects Small increase leads to defects
28
Are properties of the code reviewing process linked to software quality?
Metrics
Hastily reviewed changes (%) Changes without discussion (%)
Metrics
Reviewed churn (%)
Results
not tell the whole story
28
Are properties of the code reviewing process linked to software quality?
Metrics
Hastily reviewed changes (%) Changes without discussion (%)
Metrics
Reviewed churn (%)
Results
participation are estimated to have five additional post-release defects
Results
not tell the whole story
@shane_mcintosh shanemcintosh@acm.org