Slide 1

Slide 1 text

An Empirical Study Osaka, 2016-03-16 Stefan Wagner On the Relationship of Inconsistent Software Clones and Faults

Slide 2

Slide 2 text

You can copy, share and change, film and photograph, blog, live-blog and tweet this presentation given that you attribute it to its author and respect the rights and licenses of its parts. based on slides by @SMEasterbrook und @ethanwhite

Slide 3

Slide 3 text

Technische Universität München

Slide 4

Slide 4 text

Class A Class B

Slide 5

Slide 5 text

Class A Class B

Slide 6

Slide 6 text

Class A Class B

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Often 20%–30% redundancy

Slide 9

Slide 9 text

Inconsistencies Can you spot the difference?

Slide 10

Slide 10 text

Types of Clones Type 1 an exact copy without modifications (except for whitespace and comments) Type 2 a syntactically identical copy; only variable, type, or function identifiers have been changed Type 3 a copy with further modifications; statements have been changed, added, or removed

Slide 11

Slide 11 text

How problematic are these inconsistencies? Indicating harmfulness Inconsistent evolution of clones in industrial telecom. SW. [Lague97] Higher revision number for files with clones in legacy SW. [Monden02] Substantial amount of coupled changes to code clones. [Kim05] Discovery of bugs through search for inconsistent clones or clone evolution analysis. [Li06], [SuChiu07], [Aversano07], [Bakota07] Every other unintentional inconsistency constitutes a fault as judged by developers [Juergens09] Doubting harmfulness Failure to statistically verify impact of clones on change couplings [Geiger06] Inconsistent clones hardly ever become consistent later. [Krinke07] Failure to statistically verify impact of clones on changeability. [Lozano08] Most changes intentionally inconsistent [Göde11] No statistically significant impacts on faults [RahmanBirdDevanbu12]

Slide 12

Slide 12 text

Developers’ awareness of clones is an important factor in the clones’ harmfulness.

Slide 13

Slide 13 text

Case Study Design

Slide 14

Slide 14 text

Research Questions RQ1: Do software systems contain type-3 clones? |CT3| / |C| RQ2: Do type-3 clones contain documented faults? |CT3 F| / |CT3| RQ3: Are developers aware of type-3 clones? |IMS| / |IM|, interviews with key developers Clone Groups C (exact and incons.) Inconsistent clone groups CT3 Faulty clone Groups CT3 F

Slide 15

Slide 15 text

Cases System Size (KLOC) Age (Years) Developers A 253 4 10 B 332 5 5 C 454 4 10 Java Automotive domain

Slide 16

Slide 16 text

Data Collection and Analysis ort HTML Dash- board v1 v2 v3 Extract Analyse Query for relationships and evolution Extract Interviews with developers Transcribe Coding

Slide 17

Slide 17 text

Results

Slide 18

Slide 18 text

Quantitative Results System A B C Overall Share of type-3 clones 0.56 0.23 0.79 0.52 Share of faulty clone type-3 classes 0.33 0.05 0.03 0.17 Share of simultaneously modified type-3 clones 0.58 0.89 0.92 0.85

Slide 19

Slide 19 text

Qualitative Results System A B C General clone awareness x No general clone awareness x x No specific clone awareness x x No clone check while bug fixing x x Clone warning while developing x Common code ownership x Discussion about co-changes x

Slide 20

Slide 20 text

Conclusions

Slide 21

Slide 21 text

Developer awareness and faultiness varies. Half of the clone groups are type-3 Rate of faulty type-3 clones ~17 % Future studies should look at awareness! Conclusions

Slide 22

Slide 22 text

Developers’ awareness of clones is an important factor in the clones’ harmfulness.

Slide 23

Slide 23 text

Prof. Dr. Stefan Wagner e-mail [email protected] phone +49 (0) 711 685-88455 WWW www.iste.uni-stuttgart.de/se Twitter prof_wagnerst ORCID 0000-0002-5256-8429 Institute of Software Technology Slides are available at www.stefan-wagner.biz. Joint work with Asim Abdulkhaleq, Kamer Kaya and Alexander Paar

Slide 24

Slide 24 text

Pictures Used in this Slide Deck „Clones“ by Nick Royer (https://flic.kr/p/d1DFPL) Happy Programmers by Jesper Ronn-Jensen (https://flic.kr/p/oi9kA) „Mercurial Logo“ by Mackall (http://www.selenic.com/hg-logo/)