Sta$s$cs with R Mining So0ware Repositories 2015 - - PowerPoint PPT Presentation

sta s cs with r
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Sta$s$cs ¡with ¡R ¡

Mining ¡So0ware ¡Repositories ¡2015 ¡ University ¡of ¡Koblenz ¡ ¡ Presenter: ¡Hakan ¡Aksu ¡

slide-2
SLIDE 2

Content ¡

  • 1. Introduc$on ¡to ¡R ¡
  • 2. Basic ¡Sta$s$cs ¡
  • 3. Advanced ¡Sta$s$cs ¡
  • 4. Example ¡(MSR-­‑Papers) ¡

MSR ¡SS15 ¡ 2 ¡

slide-3
SLIDE 3

INTRODUCTION ¡TO ¡R ¡

MSR ¡SS15 ¡ 3 ¡

slide-4
SLIDE 4

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 ¡

slide-5
SLIDE 5

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 ¡

slide-6
SLIDE 6

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 ¡

slide-7
SLIDE 7

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 ¡

slide-8
SLIDE 8

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 ¡

slide-9
SLIDE 9

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 ¡

slide-10
SLIDE 10

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 ¡

slide-11
SLIDE 11

Packages ¡in ¡R ¡

  • library() ¡ ¡

¡#shows ¡you ¡all ¡installed ¡packages ¡

  • library(X)

¡#load ¡the ¡package ¡X ¡

  • Install ¡new ¡packages: ¡

MSR ¡SS15 ¡ 11 ¡

slide-12
SLIDE 12

For ¡more ¡informa$on ¡about ¡R: ¡

hap://cran.r-­‑project.org/manuals.html ¡ ¡

MSR ¡SS15 ¡ 12 ¡

slide-13
SLIDE 13

BASIC ¡STATISTICS ¡

MSR ¡SS15 ¡ 13 ¡

slide-14
SLIDE 14

Basic ¡Sta$s$cs ¡

  • Number ¡of ¡items ¡
  • Frequnecy ¡of ¡values ¡
  • Mean ¡
  • Median ¡
  • Min/Max ¡
  • Quan$les ¡
  • Variance ¡

MSR ¡SS15 ¡ 14 ¡

slide-15
SLIDE 15

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) ¡

slide-16
SLIDE 16

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] ¡

slide-17
SLIDE 17

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] ¡ ¡ ¡ ¡

slide-18
SLIDE 18

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] ¡

slide-19
SLIDE 19

¡ ¡hap://de.urbandic$onary.com/define.php?term=min%2Fmax ¡

¡

MSR ¡SS15 ¡ 19 ¡

slide-20
SLIDE 20

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 ¡

slide-21
SLIDE 21

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 ¡

slide-22
SLIDE 22

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. ¡ ¡

slide-23
SLIDE 23

MSR ¡SS15 ¡ 23 ¡

slide-24
SLIDE 24

ADVANCED ¡STATISTICS ¡

MSR ¡SS15 ¡ 24 ¡

slide-25
SLIDE 25

Precision, ¡Recall, ¡F-­‑Measure ¡and ¡Accuracy ¡ ¡

MSR ¡SS15 ¡ 25 ¡

slide-26
SLIDE 26

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 ¡

slide-27
SLIDE 27

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 ¡

slide-28
SLIDE 28

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 ¡

slide-29
SLIDE 29

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 ¡

slide-30
SLIDE 30

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 ¡

slide-31
SLIDE 31

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 ¡

slide-32
SLIDE 32

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 ¡

slide-33
SLIDE 33

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 ¡

slide-34
SLIDE 34

EXAMPLES ¡ HOW ¡ARE ¡USED ¡STATISTICS ¡IN ¡MSR-­‑FIELD? ¡

MSR ¡SS15 ¡ 34 ¡

slide-35
SLIDE 35

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 ¡

slide-36
SLIDE 36
  • 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 ¡ ¡

slide-37
SLIDE 37

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 ¡

slide-38
SLIDE 38

MSR ¡SS15 ¡ 38 ¡

Characterizing ¡and ¡Predic?ng ¡Blocking ¡Bugs ¡in ¡Open ¡Source ¡Projects ¡ ¡

hap://dl.acm.org/cita$on.cfm?doid=2597073.2597099 ¡

slide-39
SLIDE 39

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 ¡

slide-40
SLIDE 40

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 ¡

slide-41
SLIDE 41
  • 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 ¡

slide-42
SLIDE 42
  • 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 ¡

slide-43
SLIDE 43

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 ¡

slide-44
SLIDE 44

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 ¡

slide-45
SLIDE 45
  • 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 ¡

slide-46
SLIDE 46

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 ¡ ¡

slide-47
SLIDE 47
  • 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 ¡ ¡

slide-48
SLIDE 48

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 ¡

slide-49
SLIDE 49

Ques$on? ¡

MSR ¡SS15 ¡ 49 ¡