Top Banner
An Empirical Study of the Copy and Paste Behavior during Development Tarek M. Ahmed 1 Weiyi Shang Ahmed E. Hassan
26
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Msr presentation final

1

An Empirical Study of the Copy and Paste Behavior during Development

Tarek M. Ahmed Weiyi Shang Ahmed E. Hassan

Page 2: Msr presentation final

2

Copy & Paste leads to clones

//Code fragment Copy

//Code fragment

Paste

Page 3: Msr presentation final

3

//Code fragment Copy

//Code fragment

Paste

Copy & Paste leads to clones

Large number of code clones

Page 4: Msr presentation final

4

Clone detection tools detect C&P after it is performed

Source Code

Clone Detection

C&P

C&P

Code Clones

Page 5: Msr presentation final

5

There exists no large scale C&P study on developers

Controlled ExperimentSmall number Experienced only

Page 6: Msr presentation final

6

Larger scale study exists on regular users

• Regular computer users• Non-Software development tasks

A large scale C&P study is needed for software development tasks

Page 7: Msr presentation final

7

Eclipse Usage Data Collector (UDC) enables a large scale C&P study

20

Months>1 Millions

Users

Page 8: Msr presentation final

8

How to detect C&P in Eclipse UDC

User ID What Kind … Description

104526 Executed Command org.eclipse.ui.edit.copy

User performs Copy

Page 9: Msr presentation final

9

How to detect C&P in Eclipse UDC

User ID What Kind … Description

104526 Executed Command org.eclipse.ui.edit.copy

104526 Executed Command org.eclipse.ui.edit.paste

User performs Paste

Page 10: Msr presentation final

10

Our study focuses on users who frequently and actively use Eclipse

Create Development

Sessions

Find Active Sessions

Find Frequent Users

Page 11: Msr presentation final

11

20

Months4 Million C&P

20,000

Users

Page 12: Msr presentation final

12

Uncovering the C&P behavior of IDE users

Page 13: Msr presentation final

13

Average number of C&P per hour isdifferent from recent studies

2.73 16

Our finding Previous finding

#Commands > Average #Commands + 1 Standard deviation

#Commands > Average #Commands + 2 Standard deviation

Heavy Editing

Sessions

V. Heavy Editing

Sessions

11.39 13.18

Page 14: Msr presentation final

14

Do IDE users follow the same C&P patterns as regular users?

How do IDE users copy and paste code across different file formats?

Page 15: Msr presentation final

15

Do IDE users follow the same C&P patterns as regular users?

How do IDE users copy and paste code across different file formats?

Page 16: Msr presentation final

16

Copy

//Code fragment

Paste

//Code fragment

Inside the same file Between different files

Copy

//Code fragment

//Code fragment

Paste

Page 17: Msr presentation final

17

Copy

//Code fragment

Paste

//Code fragment

Inside the same file Between different files

Copy

//Code fragment

//Code fragment

Paste

IDE users often C&P within the same file

80%IDE 20%

IDE23%

Regular 77%Regular

Page 18: Msr presentation final

18

IDE users perform consecutive C&P

A

Repeat

Copy

C Copy

B Paste

D Paste

Page 19: Msr presentation final

19

IDE users perform consecutive C&P

AB

C

Distribution

Copy

Paste

Paste

Page 20: Msr presentation final

20

IDE users perform consecutive C&P

A B C

Relay

Copy

Copy Paste

Paste

Page 21: Msr presentation final

21

IDE users often perform relay on C&P

A

C

B

DA

B

C

A B C

Repeat Distribution

Relay

32%Regular

9%IDE

36%Regular

1%IDE

2%Regular

33%IDE

Others

30%Regular

57%IDE

Page 22: Msr presentation final

22

C&P behavior of IDE users is different from regular users

IDE Users

Higher Within Higher Relay Lower Distribution

Regular Users

Higher Between Lower Relay Higher Distribution

Eclipse IDE requires tailored C&P support tools that differfrom regular users’ C&P tools

Page 23: Msr presentation final

23

Do IDE users follow the same C&P patterns as regular users?

How do IDE users copy and paste code across different file formats?

There are major differences between C&P behavior of Eclipse IDE users and C&P behavior of regular users.

Page 24: Msr presentation final

24

Do IDE users follow the same C&P patterns as regular users?

How do IDE users copy and paste code across different file formats?

There are major differences between C&P behavior of Eclipse IDE users and C&P behavior of regular users.

There exists large number of C&P between editors, hence, clone detection techniques would consider detect clones across different languages.

Page 25: Msr presentation final

25

Summary

Page 26: Msr presentation final

26