Sta$s$cs with R Mining So0ware Repositories 2015 - - PowerPoint PPT Presentation
Sta$s$cs with R Mining So0ware Repositories 2015 - - PowerPoint PPT Presentation
Sta$s$cs with R Mining So0ware Repositories 2015 University of Koblenz Presenter: Hakan Aksu Content 1. Introduc$on to R 2. Basic Sta$s$cs 3. Advanced
Content ¡
- 1. Introduc$on ¡to ¡R ¡
- 2. Basic ¡Sta$s$cs ¡
- 3. Advanced ¡Sta$s$cs ¡
- 4. Example ¡(MSR-‑Papers) ¡
MSR ¡SS15 ¡ 2 ¡
INTRODUCTION ¡TO ¡R ¡
MSR ¡SS15 ¡ 3 ¡
What ¡is ¡R? ¡
- R ¡has ¡
– an ¡effec$ve ¡data ¡handling ¡and ¡storage ¡facility, ¡ – a ¡suite ¡of ¡operators ¡for ¡calcula$ons ¡on ¡arrays, ¡in ¡par$cular ¡ matrices, ¡ – a ¡large, ¡coherent, ¡integrated ¡collec$on ¡of ¡intermediate ¡tools ¡for ¡ data ¡analysis, ¡ – graphical ¡facili$es ¡for ¡data ¡analysis ¡and ¡display ¡either ¡directly ¡at ¡ the ¡computer, ¡and ¡ – a ¡well ¡developed, ¡simple ¡and ¡effec$ve ¡programming ¡language ¡ (called ¡‘S’) ¡which ¡includes ¡condi$onals, ¡loops, ¡user ¡defined ¡ recursive ¡func$ons ¡and ¡input ¡and ¡output ¡facili$es. ¡ ¡ ¡[1] ¡
R ¡is ¡a ¡free ¡so0ware ¡environment ¡for ¡sta$s$cal ¡compu$ng ¡and ¡graphics. ¡It ¡compiles ¡ and ¡runs ¡on ¡a ¡wide ¡variety ¡of ¡UNIX ¡pla^orms, ¡Windows ¡and ¡MacOS. ¡[1] ¡
MSR ¡SS15 ¡ 4 ¡
How ¡to ¡get ¡R? ¡
- Download ¡and ¡install ¡the ¡free ¡sta$s$c-‑
so0ware-‑package ¡R ¡from ¡ hap://www.r-‑project.org/ ¡ ¡
- R ¡IDE: ¡RSTUDIO ¡
hap://www.rstudio.com/ ¡ ¡
MSR ¡SS15 ¡ 5 ¡
Simple ¡Manipula$ons ¡in ¡R ¡
a ¡<-‑ ¡“Hello ¡World!“ ¡ ¡ ¡ ¡# ¡Assign ¡String ¡to ¡variable ¡ b ¡<-‑ ¡3 ¡ ¡ ¡ ¡ ¡ ¡# ¡Assign ¡Integer ¡to ¡variable ¡ c ¡<-‑ ¡paste(“s1“,...,“sn“,sep=“-‑“) ¡# ¡Conca$na$on ¡of ¡Strings ¡with ¡Seperator ¡ ¡ d ¡<-‑ ¡c(3,5,7,9,11) ¡ ¡ ¡ ¡# ¡Define ¡vector ¡and ¡assign ¡to ¡variable ¡ d[2] ¡ ¡ ¡ ¡ ¡ ¡ ¡# ¡2nd ¡value ¡of ¡the ¡vector ¡d ¡ d[-‑2] ¡ ¡ ¡ ¡ ¡ ¡# ¡Vector ¡d ¡without ¡2nd ¡value ¡ e ¡<-‑ ¡c(1:5) ¡ ¡ ¡ ¡ ¡# ¡e ¡<-‑ ¡c(1,2,3,4,5) ¡ ¡ ¡ f ¡<-‑ ¡matrix(c(1:12),ncol=3) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡# ¡Define ¡Matrix ¡with ¡3 ¡columns ¡ g ¡<-‑ ¡cbind(e,d) ¡ ¡ ¡ ¡# ¡Define ¡Matrix ¡with ¡two ¡columns ¡e ¡and ¡d ¡ ¡ ¡
MSR ¡SS15 ¡ 6 ¡
plot(g) ¡ ¡ ¡ ¡ ¡ ¡ ¡# ¡draw ¡graphic ¡– ¡e ¡as ¡x-‑axis ¡and ¡d ¡as ¡y-‑axis ¡ vx ¡<-‑ ¡c(1:5) ¡ ¡ ¡ ¡ ¡ ¡# ¡Define ¡vector ¡vx ¡ vy ¡<-‑ ¡c(6,12,8,3,5) ¡ ¡ ¡ ¡ ¡# ¡Define ¡vector ¡vy ¡ ¡ plot(vx,vy, ¡ type="l“, ¡col="red", ¡lwd=6, ¡ ¡ sub="test", ¡main="TEST", ¡ xlab="xaxis",ylab="yaxis“) ¡ ¡ ¡ Descrip$on ¡of ¡arguments ¡and ¡possible ¡values ¡are ¡described ¡in ¡detail ¡in ¡the ¡ ¡ “R ¡Documenta$on“ ¡ ?plot ¡ ¡ ¡ ¡ ¡# ¡Show ¡documenta$on ¡for ¡plot{graphics} ¡ ¡ ¡
Graphics ¡in ¡R ¡ plot ¡
MSR ¡SS15 ¡ 7 ¡
Graphics ¡in ¡R ¡ boxplot ¡
A ¡graphic ¡representa$on ¡of ¡a ¡distribu$on, ¡which ¡mark ¡the ¡maximum ¡and ¡ minimum ¡values, ¡the ¡median ¡and ¡first ¡and ¡third ¡quar$les. ¡[2] ¡
MSR ¡SS15 ¡ 8 ¡
hap://www.bom.gov.au/water/ssf/faq/boxplot.png ¡
vx ¡<-‑ ¡c(1:9) ¡ ¡ ¡ vy ¡<-‑ ¡c(6,13,8,3,5,2,7,16,3) ¡ boxplot(vx,vy) ¡
Graphics ¡in ¡R ¡ boxplot ¡
MSR ¡SS15 ¡ 9 ¡
Graphics ¡in ¡R ¡ histogram ¡
h ¡<-‑ ¡c(4,3,7,3,5,7,1,4,2,4,8,9,6,4,2,7,4,9,5,3,4) ¡ hist(h,breaks=0:9) ¡
A ¡sta$s$cal ¡graph ¡that ¡represents ¡the ¡frequency ¡of ¡values ¡of ¡a ¡quan$ty. ¡ ¡[3] ¡ ¡
MSR ¡SS15 ¡ 10 ¡
Packages ¡in ¡R ¡
- library() ¡ ¡
¡#shows ¡you ¡all ¡installed ¡packages ¡
- library(X)
¡#load ¡the ¡package ¡X ¡
- Install ¡new ¡packages: ¡
MSR ¡SS15 ¡ 11 ¡
For ¡more ¡informa$on ¡about ¡R: ¡
hap://cran.r-‑project.org/manuals.html ¡ ¡
MSR ¡SS15 ¡ 12 ¡
BASIC ¡STATISTICS ¡
MSR ¡SS15 ¡ 13 ¡
Basic ¡Sta$s$cs ¡
- Number ¡of ¡items ¡
- Frequnecy ¡of ¡values ¡
- Mean ¡
- Median ¡
- Min/Max ¡
- Quan$les ¡
- Variance ¡
MSR ¡SS15 ¡ 14 ¡
Number ¡of ¡items ¡
¡ Example: ¡ X ¡= ¡[3,1,5,5,3,1,5,1,1,4,6,5,4,2,1] ¡ ¡ ¡ ¡ ¡à ¡n ¡= ¡15 ¡ R: ¡ length(X) ¡
MSR ¡SS15 ¡ 15 ¡
For ¡a ¡given ¡distributen ¡X ¡= ¡[x1,x2,...,xn] ¡is ¡n ¡the ¡number ¡of ¡items ¡(length) ¡
Frequnecy ¡of ¡values ¡ ¡
¡ Example: ¡ X ¡= ¡[3,1,5,5,3,1,5,1,1,4,6,5,4,2,1] ¡
à ¡[1] ¡occurs ¡5 ¡$mes ¡ ¡[2] ¡occurs ¡1 ¡$mes ¡ ¡[3] ¡occurs ¡2 ¡$mes ¡ ¡[4] ¡occurs ¡2 ¡$mes ¡ ¡[5] ¡occurs ¡4 ¡$mes ¡ ¡[6] ¡occurs ¡1 ¡$mes ¡
R: ¡ hist(X,breaks=0:6) ¡ ¡ ¡
MSR ¡SS15 ¡ 16 ¡
In ¡sta$s$cs ¡the ¡frequency ¡(or ¡absolute ¡frequency) ¡of ¡an ¡event ¡is ¡the ¡number ¡of ¡ $mes ¡the ¡event ¡occurred ¡in ¡an ¡experiment ¡or ¡study. ¡These ¡frequencies ¡are ¡o0en ¡ graphically ¡represented ¡in ¡histograms. ¡[4] ¡
Mean ¡
¡ ¡ ¡ Example: ¡ X ¡= ¡[3,1,5,5,3,1,5,1,1,4,6,5,4,2,1] ¡
à The ¡mean ¡is ¡(3+1+5+5+...+4+2+1)/15 ¡≈ ¡3.133 ¡
¡ R: ¡ mean(X) ¡ summary(X) ¡
MSR ¡SS15 ¡ 17 ¡
The ¡arithme)c ¡mean ¡is ¡the ¡sum ¡of ¡the ¡sampled ¡values ¡divided ¡by ¡the ¡number ¡of ¡ items ¡in ¡the ¡sample. ¡[5] ¡ ¡ ¡ ¡
Median ¡
¡ ¡ Example: ¡ X ¡= ¡[3,1,5,5,3,1,5,1,1,4,6,5,4,2,1] ¡ X ¡= ¡[1,1,1,1,1,2,3,3,4,4,5,5,5,5,6] ¡ ¡Y ¡= ¡[2,4,5,8] ¡ ¡
à The ¡median ¡is ¡3 ¡ ¡ ¡ ¡ ¡ ¡ ¡à ¡The ¡median ¡is ¡4.5 ¡
¡ R: ¡ median(X) ¡ summary(X) ¡ boxplot(X) ¡
MSR ¡SS15 ¡ 18 ¡
The ¡Median ¡is ¡the ¡middle ¡number ¡in ¡a ¡given ¡sequence ¡of ¡numbers, ¡taken ¡as ¡ the ¡mean ¡of ¡the ¡two ¡middle ¡numbers ¡when ¡the ¡sequence ¡has ¡an ¡even ¡ number ¡of ¡items. ¡[6] ¡
¡ ¡hap://de.urbandic$onary.com/define.php?term=min%2Fmax ¡
¡
MSR ¡SS15 ¡ 19 ¡
Min ¡& ¡Max ¡
¡ Example: ¡ X ¡= ¡[3,1,5,5,3,1,5,1,1,4,6,5,4,2,1] ¡ X ¡= ¡[1,1,1,1,1,2,3,3,4,4,5,5,5,5,6] ¡ ¡ ¡min ¡ ¡ ¡ ¡ ¡ ¡max ¡ R: ¡ min(X) ¡ max(X) ¡ range(X) ¡ summary(X) ¡ boxplot(X) ¡
MSR ¡SS15 ¡ 20 ¡
The ¡minimum ¡is ¡the ¡lowest ¡and ¡the ¡maximum ¡the ¡highest ¡value ¡of ¡a ¡distribu$on ¡
Quan$les ¡
- Important ¡quan$les ¡are: ¡ ¡
0% ¡(min), ¡25%, ¡50% ¡(median), ¡ ¡ 75%, ¡100% ¡(max) ¡
- 9 ¡different ¡ ¡
quan$le ¡algorithms ¡
- Default ¡in ¡R: ¡type ¡= ¡7 ¡
- See ¡?quan$le ¡
MSR ¡SS15 ¡ 21 ¡
Variance ¡
popula?on ¡variance ¡is ¡defined ¡in ¡terms ¡of ¡the ¡popula$on ¡ mean ¡μ ¡and ¡popula$on ¡size ¡N: ¡ ¡ ¡ ¡ (σ ¡is ¡called ¡standard ¡devia$on) ¡ Example: ¡ X ¡= ¡[3,1,5,5,3,1,5,1,1,4,6,5,4,2,1] ¡ à N ¡= ¡15, ¡μ ¡≈ ¡3.133 ¡à ¡The ¡variance ¡is ¡≈ ¡3.409524 ¡ R: ¡ var(X) ¡
MSR ¡SS15 ¡ 22 ¡
The ¡variance ¡is ¡a ¡numerical ¡measure ¡of ¡how ¡the ¡data ¡values ¡is ¡dispersed ¡around ¡the ¡mean. ¡ ¡
MSR ¡SS15 ¡ 23 ¡
ADVANCED ¡STATISTICS ¡
MSR ¡SS15 ¡ 24 ¡
Precision, ¡Recall, ¡F-‑Measure ¡and ¡Accuracy ¡ ¡
MSR ¡SS15 ¡ 25 ¡
Which ¡method? ¡
Difference ¡of ¡ distribu$ons ¡are ¡ sta$s$cally ¡ significant? ¡ A ¡normal ¡ distribu$on? ¡ T-‑Test ¡ Mann-‑Whitney ¡U ¡ test ¡equivalent ¡to ¡ Wilcoxon ¡rank ¡ test ¡ Not ¡a ¡normal ¡ distribu$on? ¡ Mann-‑Whitney ¡U ¡ test ¡equivalent ¡to ¡ Wilcoxon ¡rank ¡ test ¡
MSR ¡SS15 ¡ 26 ¡
Normal ¡distribu$on ¡
We ¡say ¡the ¡data ¡is ¡"normally ¡distributed“, ¡if ¡
- Mean ¡= ¡median ¡= ¡mode ¡
- Symmetry ¡about ¡the ¡center ¡
- 50% ¡of ¡values ¡less ¡than ¡the ¡mean ¡ ¡
and ¡50% ¡greater ¡than ¡the ¡mean ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Gaussian ¡bell ¡curve ¡
Many ¡things ¡follow ¡a ¡Normal ¡Distribu$on ¡
- Heights ¡of ¡people ¡
- Size ¡of ¡things ¡produced ¡by ¡machines ¡
- Errors ¡in ¡measurements ¡
- Blood ¡pressure ¡
- Marks ¡on ¡a ¡test ¡
R ¡
- rnorm(100) ¡à ¡Normal ¡distribu$on ¡with ¡100 ¡elements ¡
MSR ¡SS15 ¡ 27 ¡
Normal ¡distribu$on ¡
¡
- Normal ¡distribu?on ¡tests ¡assess ¡the ¡likelihood ¡that ¡the ¡given ¡data ¡set ¡{x1, ¡…, ¡xn} ¡comes ¡from ¡a ¡normal ¡distribu$on. ¡ ¡
- There ¡exist ¡over ¡40 ¡tests. ¡
¡ Frequently ¡uesd ¡tests: ¡
- "Visual" ¡tests ¡are ¡more ¡intui$vely ¡appealing ¡but ¡subjec$ve ¡at ¡the ¡same ¡$me, ¡as ¡they ¡rely ¡on ¡informal ¡human ¡judgement ¡to ¡
accept ¡or ¡reject ¡the ¡null ¡hypothesis. ¡ ¡
– Q-‑Q ¡plot ¡ – P-‑P ¡plot ¡ – Shapiro-‑Wilk ¡test ¡ – Normal ¡probability ¡plot ¡
- Moment ¡tests: ¡ ¡
– D'Agos?no's ¡K-‑squared ¡test ¡ – Jarque–Bera ¡test ¡
- Empirical ¡distribu?on ¡func?on ¡tests: ¡ ¡
– Kolmogorov–Smirnov ¡test ¡ – Lilliefors ¡test ¡(an ¡adapta$on ¡of ¡the ¡Kolmogorov–Smirnov ¡test) ¡ – Anderson–Darling ¡test ¡
In ¡R ¡(one ¡example): ¡ ¡
- Shapiro-‑Wilk ¡test: ¡shapiro.test(X) ¡
If ¡(p-‑value ¡<= ¡0.05) ¡then ¡(non-‑normal ¡distribu$on) ¡else ¡(normal ¡distribu$on) ¡ MSR ¡SS15 ¡ 28 ¡
Wilcoxon-‑Mann-‑Whitney ¡test ¡
- Also ¡called ¡Mann-‑Whitney ¡U ¡test, ¡Mann-‑Whitney-‑
Wilcoxon ¡(MWW), ¡Wilcoxon ¡rank-‑sum ¡test ¡(WRS) ¡
- Nonparametric ¡test ¡of ¡the ¡null ¡hypothesis ¡
- greater ¡efficiency ¡than ¡t-‑test ¡on ¡non-‑normal ¡
distribu$ons ¡
- nearly ¡as ¡efficient ¡as ¡the ¡t-‑test ¡on ¡normal ¡distribu$ons ¡
In ¡R: ¡
- wilcox.test(x,...) ¡
MSR ¡SS15 ¡ 29 ¡
Wilcoxon-‑Mann-‑Whitney ¡test ¡
- Given ¡are ¡two ¡distribu$ons ¡X,Y ¡
- Define ¡the ¡null ¡hypothesis ¡H0 ¡and ¡the ¡
alterna$ve ¡hypothesis ¡Ha ¡
- Ha ¡should ¡be ¡what ¡you ¡want ¡to ¡show ¡
- if ¡(p-‑value ¡< ¡0.05) ¡
– then ¡(reject ¡H0 ¡and ¡accept ¡Ha) ¡ ¡ – else ¡(accept ¡H0 ¡and ¡reject ¡Ha) ¡
MSR ¡SS15 ¡ 30 ¡
Cliff's ¡delta ¡ ¡
- use ¡it ¡for ¡ordinal ¡data ¡
- it ¡is ¡a ¡measure ¡of ¡how ¡o0en ¡one ¡the ¡values ¡in ¡one ¡distribu$on ¡are ¡
larger ¡than ¡the ¡values ¡in ¡a ¡second ¡distribu$on. ¡ ¡
- it ¡does ¡not ¡require ¡any ¡assump$ons ¡about ¡the ¡shape ¡or ¡spread ¡of ¡
the ¡two ¡distribu$ons. ¡
- |d|<0.2 ¡"negligible”, ¡|d|<0.5 ¡"small”, ¡|d|<0.8 ¡"medium”, ¡otherwise ¡"large” ¡
In ¡R: ¡
- Cliff.delta(treatment, ¡control) ¡(needs ¡library(effsize) ¡
MSR ¡SS15 ¡ 31 ¡
Correla$on ¡
- Correla$on ¡coefficients ¡r ¡can ¡range ¡from ¡-‑1.00 ¡to ¡+1.00. ¡ ¡
- ‑1.00 ¡represents ¡a ¡perfect ¡nega)ve ¡correla$on ¡ ¡
- +1.00 ¡represents ¡a ¡perfect ¡posi)ve ¡correla$on ¡ ¡
- 0.00 ¡represents ¡a ¡lack ¡of ¡correla$on. ¡
¡
- Pearson ¡r ¡correla?on ¡is ¡used ¡to ¡measure ¡the ¡degree ¡of ¡the ¡rela$onship ¡between ¡
linear ¡related ¡variables ¡
- Kendall ¡rank ¡correla?on ¡is ¡used ¡to ¡measure ¡the ¡strength ¡of ¡dependence ¡between ¡
two ¡variables ¡
- Spearman ¡rank ¡correla?on ¡is ¡used ¡to ¡measure ¡the ¡degree ¡of ¡associa$on ¡between ¡
two ¡variables ¡ ¡ In ¡R: ¡
- Cor(X,Y,method=“pearson“) ¡ ¡method ¡can ¡be ¡“spearman“, ¡“kendall“ ¡
- Cor.test(X,Y,method=“p|s|k“) ¡
MSR ¡SS15 ¡ 32 ¡
Correla$on ¡is ¡a ¡measure ¡of ¡the ¡rela$on ¡between ¡two ¡or ¡more ¡variables ¡
Correla$on ¡
Examples ¡
- r ¡= ¡0.8 ¡ ¡ ¡ ¡
à posi$ve ¡correla$on ¡if ¡p-‑value<=0.05 ¡
- r ¡= ¡0.0005 ¡
àno ¡correla$on ¡
- r ¡= ¡-‑0.2 ¡
à ¡if ¡p-‑value<0.05 ¡then ¡it ¡tends ¡to ¡nega$ve ¡ correla$on ¡
MSR ¡SS15 ¡ 33 ¡
EXAMPLES ¡ HOW ¡ARE ¡USED ¡STATISTICS ¡IN ¡MSR-‑FIELD? ¡
MSR ¡SS15 ¡ 34 ¡
Characterizing ¡and ¡Predic?ng ¡Blocking ¡Bugs ¡in ¡Open ¡Source ¡Projects ¡ ¡ Context: ¡
– They ¡propose ¡a ¡model ¡to ¡predict ¡blocking-‑bugs ¡ – Blocking ¡bugs ¡are ¡so0ware ¡bugs ¡that ¡prevent ¡other ¡bugs ¡from ¡being ¡fixed. ¡
Mo$va$on: ¡
– These ¡blocking ¡bugs ¡may ¡increase ¡maintenance ¡costs, ¡reduce ¡overall ¡quality ¡ and ¡delay ¡the ¡release ¡of ¡the ¡so0ware ¡systems. ¡ ¡
Ar$facts: ¡
– They ¡study ¡six ¡open ¡source ¡projects ¡ ¡ (Chromium, ¡Eclipse, ¡FreeDesktop, ¡Mozilla, ¡Netbeans, ¡Open-‑Office) ¡
Research ¡Ques$on ¡
– RQ1: ¡Can ¡we ¡build ¡highly ¡accurate ¡models ¡to ¡predict ¡whether ¡a ¡new ¡bug ¡will ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡be ¡a ¡blocking ¡bug? ¡ – RQ2: ¡Which ¡factors ¡are ¡the ¡best ¡indicators ¡of ¡blocking ¡bugs? ¡ ¡
¡
MSR ¡SS15 ¡ 35 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597099 ¡
- They ¡use ¡„Predic$on ¡models“ ¡to ¡iden$fy ¡whether ¡a ¡bug ¡will ¡
be ¡a ¡blocking ¡bug ¡or ¡not ¡ ¡
– Decision ¡Tree ¡Classifier ¡ – Naive ¡Bayes ¡Classifier ¡ – K-‑Nearest ¡Neighbor ¡Classifier ¡ – Random ¡Forest ¡Classifier ¡ – Zero-‑R ¡Classifier ¡
MSR ¡SS15 ¡ 36 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597099 ¡
Characterizing ¡and ¡Predic?ng ¡Blocking ¡Bugs ¡in ¡Open ¡Source ¡Projects ¡ ¡
To ¡see ¡if ¡there ¡is ¡a ¡significant ¡difference ¡between ¡ the ¡ blocking ¡ and ¡ non-‑blocking ¡ bugs, ¡ they ¡ performed ¡ an ¡ Wilcoxon-‑test ¡ for ¡ the ¡ hypothesis ¡ Ha ¡: ¡tblocking ¡> ¡tnonblocking. ¡Table ¡4 ¡shows ¡the ¡fixing-‑ $me ¡difference ¡reported ¡by ¡the ¡test. ¡The ¡p-‑values ¡ were ¡significant ¡for ¡all ¡projects ¡(p-‑value ¡< ¡0.001), ¡ meaning ¡that ¡the ¡fixing-‑?me ¡for ¡blocking ¡bugs ¡is ¡ sta?s?cally ¡ significantly ¡ longer ¡ than ¡ the ¡ fixing-‑ ?me ¡for ¡non-‑blocking ¡bugs. ¡ ¡
MSR ¡SS15 ¡ 37 ¡
Characterizing ¡and ¡Predic?ng ¡Blocking ¡Bugs ¡in ¡Open ¡Source ¡Projects ¡ ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597099 ¡
Median ¡
MSR ¡SS15 ¡ 38 ¡
Characterizing ¡and ¡Predic?ng ¡Blocking ¡Bugs ¡in ¡Open ¡Source ¡Projects ¡ ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597099 ¡
An ¡Empirical ¡Study ¡of ¡Dormant ¡Bugs ¡
Context ¡
– They ¡study ¡dormant ¡bugs ¡against ¡non-‑dormant ¡bugs ¡ – Dormant ¡bugs ¡are ¡bugs ¡which ¡are ¡introduced ¡in ¡a ¡version ¡of ¡the ¡ so0ware ¡system ¡and ¡are ¡found ¡and ¡reported ¡much ¡later ¡(e.g. ¡ a0er ¡three ¡versions ¡or ¡a0er ¡one ¡year) ¡
Mo$va$on: ¡
– Since ¡some ¡bugs ¡may ¡not ¡be ¡reported ¡$ll ¡much ¡later, ¡us-‑ing ¡only ¡ non-‑dormant ¡bugs ¡to ¡evaluate ¡the ¡overall ¡quality ¡of ¡a ¡version ¡of ¡ a ¡system ¡may ¡be ¡inaccurate. ¡If ¡many ¡bugs ¡are ¡reported ¡in ¡a ¡ version, ¡but ¡these ¡bugs ¡were ¡introduced ¡in ¡previous ¡version, ¡ then ¡the ¡quality ¡of ¡that ¡version ¡may ¡be ¡misjudged. ¡ ¡
Ar$facts: ¡
– 20 ¡Open-‑Source ¡Apache ¡founda$on ¡so0ware ¡systems ¡
MSR ¡SS15 ¡ 39 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597108 ¡
Research ¡Ques$on: ¡
RQ1: ¡How ¡quickly ¡are ¡dormant ¡bugs ¡fixed? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡RQ2: ¡What ¡is ¡the ¡size ¡of ¡a ¡dormant ¡bug ¡fix? ¡ ¡ ¡ ¡ RQ3: ¡Who ¡fixes ¡dormant ¡bugs? ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡RQ4: ¡What ¡are ¡the ¡root ¡causes ¡of ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡dormant ¡bug ¡fixes? ¡ . ¡
MSR ¡SS15 ¡ 40 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597108 ¡
An ¡Empirical ¡Study ¡of ¡Dormant ¡Bugs ¡
- They ¡used ¡the ¡Wilcoxon ¡rank-‑sum ¡test ¡to ¡compare ¡the ¡
fix ¡)me ¡of ¡the ¡dormant ¡and ¡non-‑dormant ¡bugs ¡
- The ¡dataset ¡is ¡highly ¡skewed ¡à ¡no ¡normal ¡distribu$on ¡
à ¡t-‑Test ¡not ¡possible ¡
- They ¡want ¡to ¡show ¡that ¡dormant ¡bugs ¡have ¡a ¡shorter ¡
fix ¡$me ¡à ¡alterna$ve ¡hypothesis ¡is ¡set ¡to ¡less ¡
- p-‑value ¡is ¡<< ¡0.001. ¡ ¡
à They ¡accept ¡the ¡alterna$ve ¡hypothesis. ¡ ¡ This ¡indicates ¡that ¡the ¡fix ¡$me ¡for ¡dormant ¡bugs ¡is ¡ sta$s$cally ¡significantly ¡smaller ¡than ¡that ¡of ¡non-‑dormant ¡
- bugs. ¡
¡ ¡
MSR ¡SS15 ¡ 41 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597108 ¡
An ¡Empirical ¡Study ¡of ¡Dormant ¡Bugs ¡
- Correla$on ¡between ¡dormant ¡)me ¡and ¡fix ¡
)me ¡
- Correla$on ¡value ¡r ¡= ¡0.073 ¡
à dormant ¡)me ¡does ¡not ¡have ¡any ¡rela$onship ¡ with ¡fix ¡)me ¡ ¡ ¡
MSR ¡SS15 ¡ 42 ¡
An ¡Empirical ¡Study ¡of ¡Dormant ¡Bugs ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597108 ¡
Mining ¡StackOverflow ¡to ¡Turn ¡the ¡IDE ¡into ¡a ¡ Self-‑Confident ¡Programming ¡Prompter ¡ ¡
Context ¡
– Analysis ¡of ¡StackOverflow ¡
Contribu$on ¡
– a ¡novel ¡ranking ¡model ¡that ¡evaluates ¡the ¡relevance ¡of ¡a ¡ Stack ¡Overflow ¡discussion, ¡given ¡a ¡code ¡context ¡in ¡the ¡IDE, ¡ by ¡considering ¡code, ¡conceptual ¡and ¡community ¡aspects ¡ – An ¡Eclipse ¡plug-‑in ¡named ¡PROMPTER ¡
MSR ¡SS15 ¡ 43 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597077 ¡
Generate ¡a ¡query ¡ with ¡source ¡code ¡
MSR ¡SS15 ¡ 44 ¡
Mining ¡StackOverflow ¡to ¡Turn ¡the ¡IDE ¡into ¡a ¡ Self-‑Confident ¡Programming ¡Prompter ¡ ¡
à ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597077 ¡
- Evaluate ¡PROMPTER ¡with ¡developers ¡
– Par$cipants ¡have ¡similar ¡experience ¡ – Par$cipants ¡perform ¡Maintnance ¡Task ¡(MT) ¡and ¡ Development ¡Task ¡(DT) ¡ – Par$cipants ¡work ¡with ¡PROMPTER(P) ¡and ¡without ¡ PROMPTER(NP) ¡
MSR ¡SS15 ¡ 45 ¡
Mining ¡StackOverflow ¡to ¡Turn ¡the ¡IDE ¡into ¡a ¡ Self-‑Confident ¡Programming ¡Prompter ¡ ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597077 ¡
Look ¡at ¡“Overall“: ¡
- The ¡P ¡median ¡is ¡68% ¡(mean ¡70%) ¡
against ¡the ¡40% ¡median ¡(mean ¡ 46%) ¡of ¡NP. ¡ ¡ ¡ à In ¡other ¡words, ¡Prompter ¡allowed ¡ par$cipants ¡to ¡achieve ¡a ¡median ¡ addi$onal ¡completeness ¡of ¡28% ¡ (mean ¡of ¡24%). ¡ ¡ ¡
MSR ¡SS15 ¡ 46 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597077 ¡
Mining ¡StackOverflow ¡to ¡Turn ¡the ¡IDE ¡into ¡a ¡ Self-‑Confident ¡Programming ¡Prompter ¡ ¡
- Sta$cal ¡significance ¡of ¡the ¡difference? ¡
- Use ¡Cliff‘s ¡delta ¡(d) ¡to ¡assess ¡the ¡magnitude ¡of ¡such ¡a ¡difference ¡
- Use ¡Wilcoxon-‑Mann-‑Whitney ¡test ¡
– Overall: ¡
- p-‑value ¡<0.01 ¡à ¡sta$s$cally ¡significant ¡
- d ¡= ¡0.65 ¡à ¡large ¡effect ¡
– MT ¡
- not ¡significant ¡(p-‑value=0.23) ¡ ¡
- d ¡= ¡0.38 ¡medium ¡effect, ¡ ¡
– DT ¡
- p-‑value=0.03 ¡à ¡sta$s$cally ¡significant ¡ ¡
- d ¡= ¡0.88 ¡large ¡effect ¡ ¡
MSR ¡SS15 ¡ 47 ¡
hap://dl.acm.org/cita$on.cfm?doid=2597073.2597077 ¡
Mining ¡StackOverflow ¡to ¡Turn ¡the ¡IDE ¡into ¡a ¡ Self-‑Confident ¡Programming ¡Prompter ¡ ¡
literature ¡
[1] ¡hap://www.r-‑project.org/ ¡ [2] ¡hap://dic$onary.reference.com/browse/box ¡plot ¡ [3] ¡hap://dic$onary.reference.com/browse/histogram ¡ [4] ¡hap://en.wikipedia.org/wiki/Frequency_(sta$s$cs) ¡ [5] ¡hap://en.wikipedia.org/wiki/Mean ¡ [6] ¡hap://dic$onary.reference.com/browse/median ¡ [7] ¡hap://www.r-‑tutor.com/elementary-‑sta$s$cs/non-‑parametric-‑methods/mann-‑whitney-‑wilcoxon-‑test ¡ [8] ¡hap://en.wikipedia.org/wiki/Precision_and_recall ¡ [9] ¡H. ¡V. ¡Garcia, ¡E. ¡Shibab: ¡Characterizing ¡and ¡Predic$ng ¡Blocking ¡Bugs ¡in ¡Open ¡Source ¡Projects, ¡MSR14, ¡ hap://dl.acm.org/cita$on.cfm?doid=2597073.2597099 ¡ [10] ¡T. ¡Chen, ¡M. ¡Nagappan, ¡E.Shibab, ¡A.E.Hassan: ¡An ¡Empirical ¡Study ¡of ¡Dormant ¡Bugs, ¡MSR14, ¡ hap://dl.acm.org/cita$on.cfm?doid=2597073.2597108 ¡ [11]L. ¡Ponzanelli, ¡G. ¡Bavota, ¡M.Di ¡Penta, ¡R. ¡Oliveto, ¡M. ¡Michele ¡Lanza: ¡Mining ¡StackOverflow ¡to ¡Turn ¡the ¡IDE ¡ into ¡a ¡Self-‑Confident ¡Programming ¡Prompter, ¡MSR14, ¡hap://dl.acm.org/cita$on.cfm?doid=2597073.2597077 ¡ [12] ¡hap://www.r-‑project.org/ ¡ ¡ ¡
MSR ¡SS15 ¡ 48 ¡
Ques$on? ¡
MSR ¡SS15 ¡ 49 ¡