an empirical study of the effect of file editing patterns on software quality

31
An Empirical Study of the Effect of File Editing Patterns on Software Quality Feng Zhang, Foutse Khomh, Ying Zou and Ahmed E. Hassan

Upload: feng-zhang

Post on 05-Jul-2015

49 views

Category:

Technology


2 download

DESCRIPTION

While some developers like to work on multiple code change requests, others might prefer to handle one change request at a time. This juggling of change requests and the large number of developers working in parallel often lead to files being edited as part of different change requests by one or several developers. Existing research has warned the community about the potential negative impacts of some file editing patterns on software quality. For example, when several developers concurrently edit a file as part of different change requests, they are likely to introduce bugs due to limited awareness of other changes. However, very few studies have provided quantitative evidence to support these claims. In this paper, we identify four file editing patterns. We perform an empirical study on three open source software systems to investigate the individual and the combined impact of the four patterns on software quality. We find that: (1) files that are edited concurrently by many developers have on average 2.46 times more future bugs than files that are not concurrently edited; (2) files edited in parallel with other files by the same developer have on average 1.67 times more future bugs than files individually edited; (3) files edited over an extended period (i.e., above the third quartile) of time have 2.28 times more future bugs than other files; and (4) files edited with long interruptions (i.e., above the third quartile) have 2.1 times more future bugs than other files. When more than one editing patterns are followed by one or many developers during the editing of a file, we observe that the number of future bugs in the file can be as high as 1.6 times the average number of future bugs in files edited following a single editing pattern. These results can be used by software development teams to warn developers about risky file editing patterns.

TRANSCRIPT

Page 1: An Empirical Study of the Effect of File Editing Patterns on Software Quality

An Empirical Study of the

Effect of File Editing Patterns

on Software Quality

Feng Zhang, Foutse Khomh, Ying Zou

and Ahmed E. Hassan

Page 2: An Empirical Study of the Effect of File Editing Patterns on Software Quality

2

Do developers follow some file editing patterns?

Concurrent?

Extended?

Interrupted?

File Editing

Page 3: An Empirical Study of the Effect of File Editing Patterns on Software Quality

3

Concurrent?

Extended?

Interrupted?

?

?

?

What’s the impact on software quality?

File Editing

Page 4: An Empirical Study of the Effect of File Editing Patterns on Software Quality

4

Examples

Page 5: An Empirical Study of the Effect of File Editing Patterns on Software Quality

5

1. Example on concurrent editing

BugzillaTaskEditorPage.java

Frank Steffen Pingel David Green

Page 6: An Empirical Study of the Effect of File Editing Patterns on Software Quality

6

1. Concurrent Editing

Several developers edit the same file concurrently.

Page 7: An Empirical Study of the Effect of File Editing Patterns on Software Quality

7

2. Example on parallel editing

AbstractTaskEditorPage.java

Frank

TasksUiPlugin.java PlanningPerspectiveFactory.java

Page 8: An Empirical Study of the Effect of File Editing Patterns on Software Quality

8

2. Parallel Editing

Multiple files are edited in parallel by the same developer.

Page 9: An Empirical Study of the Effect of File Editing Patterns on Software Quality

9

3. Example on extended editing

DiscoveryViewer.java

4.5 hours

Mylyn Project

1.25 hours

3.6 times

Page 10: An Empirical Study of the Effect of File Editing Patterns on Software Quality

10

3. Extended Editing

Developers spend longer time editing a file. (threshold: third quantile)

Page 11: An Empirical Study of the Effect of File Editing Patterns on Software Quality

11

4. Example on interrupted editing

TaskCompareDialog.java

338 hours

Mylyn Project

2 hours

164 times

Page 12: An Empirical Study of the Effect of File Editing Patterns on Software Quality

12

4. Interrupted Editing

There is a longer idle period during the editing of a file.

(threshold: third quantile)

Page 13: An Empirical Study of the Effect of File Editing Patterns on Software Quality

13

File Editing Patterns Summary

1. Concurrent Editing

2. Parallel Editing

3. Extended Editing

4. Interrupted Editing

Page 14: An Empirical Study of the Effect of File Editing Patterns on Software Quality

14

How to evaluate the effect of

file editing patterns?

Time

Split Date Density of Future Bug

File Editing Patterns

Page 15: An Empirical Study of the Effect of File Editing Patterns on Software Quality

15

Subject Systems

3,883 logs

2,722 bugs

606 bugs

524 bugs

793 logs

638 logs

Mylyn

Eclipse Platform

PDE

Page 16: An Empirical Study of the Effect of File Editing Patterns on Software Quality

16

Description of Data

Split Date: 2011-01-01

119 developers

98 bugs

2,140 files

5,070 CVS logs

Page 17: An Empirical Study of the Effect of File Editing Patterns on Software Quality

17

1. Recovering File Edit History

Data Processing

2. Recovering File Change History

3. Identifying File Editing Patterns

bug Id

density of bug

Page 18: An Empirical Study of the Effect of File Editing Patterns on Software Quality

18

Research Questions

RQ1: Are there different file editing patterns?

RQ2: Do file editing patterns lead to more bugs?

RQ3: Do interactions among file editing patterns lead to more bugs?

Page 19: An Empirical Study of the Effect of File Editing Patterns on Software Quality

19

RQ1: Are there different file editing patterns?

Occurrences of file editing patterns and their interactions

0

500

1000

1500

2000

2500

1. Concurrent

2. Parallel

3. Extended

4. Interrupted

File editing patterns do exist

Combinations of patterns

Single Pattern

No

Patt

ern

Page 20: An Empirical Study of the Effect of File Editing Patterns on Software Quality

20

RQ2: Do concurrent editing pattern lead to more bugs?

Odds Ratio of two groups:

NC: no concurrent editing

C: concurrent editing

2.1 times more likely to experience a future bug if concurrent editing pattern happens

Page 21: An Empirical Study of the Effect of File Editing Patterns on Software Quality

21

RQ2: Level of involvement in concurrent editing pattern

Definition of Level average number of developers involved in a concurrent editing of a file.

0

1

2

3

No Pattern ≤3rd quantile > 3rd quantile

2.4* 1.6 Statistically significant

Not statistically significant

Page 22: An Empirical Study of the Effect of File Editing Patterns on Software Quality

22

RQ2: Do parallel editing patterns lead to more bugs?

Odds Ratio of two groups:

NP: no parallel editing

P: parallel editing

1.9 times more likely to experience a future bug if parallel editing pattern happens

Page 23: An Empirical Study of the Effect of File Editing Patterns on Software Quality

23

RQ2: Level of involvement in parallel editing pattern

Definition of Level average number of files edited in parallel with a file.

0

1

2

3

4

5

No Pattern ≤3rd quantile > 3rd quantile

1.3

3.8* Statistically significant

Not statistically significant

Page 24: An Empirical Study of the Effect of File Editing Patterns on Software Quality

24

RQ2: Do extended editing patterns lead to more bugs?

1.9 times more likely to experience a future bug if extended editing pattern happens

Odds Ratio of two groups:

NE: no extended editing

E: extended editing

Page 25: An Empirical Study of the Effect of File Editing Patterns on Software Quality

25

RQ2: Level of involvement in extended pattern

Definition of Level average editing time of a file.

0

0.5

1

1.5

2

No Pattern ≤3rd quantile > 3rd quantile

1.0

1.9* Statistically significant

Not statistically significant

Page 26: An Empirical Study of the Effect of File Editing Patterns on Software Quality

26

RQ2: Do interrupted editing patterns lead to more bugs?

1.6 times more likely to experience a future bug if interrupted editing pattern happens

Odds Ratio of two groups:

NI: no interrupted editing

I: interrupted editing

Page 27: An Empirical Study of the Effect of File Editing Patterns on Software Quality

27

RQ2: Level of involvement in interrupted pattern

Definition of Level average interruption time of a file.

0

0.5

1

1.5

2

No Pattern ≤3rd quantile > 3rd quantile

1.2 1.8*

Statistically significant

Not statistically significant

Page 28: An Empirical Study of the Effect of File Editing Patterns on Software Quality

28

RQ3: Do interactions among file editing patterns lead to more bugs?

Odds ratio of 16 groups.

0

1

2

3

4

5

6

1. Concurrent

2. Parallel

3. Extended

4. Interrupted

Combinations of patterns are more risky than single pattern

Combinations of patterns

Single Pattern

No

Patt

ern

Page 29: An Empirical Study of the Effect of File Editing Patterns on Software Quality

29

Conclusion

Page 30: An Empirical Study of the Effect of File Editing Patterns on Software Quality

30

Concurrent Parallel

Extended Interrupted

2.1 Odds Ratio 1.9 Odds

Ratio

1.9 Odds Ratio 1.6 Odds

Ratio

Page 31: An Empirical Study of the Effect of File Editing Patterns on Software Quality

31

Average Bug Density:

as high as 1.7 times

Single v.s. Interactions