what do practitioners ask about code clone? a preliminary investigation of stack overflow

26
e Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka Un What Do Practitioners Ask about Code Clone? A Preliminary Investigation of Stack Overflow Eunjong Choi 1 , Raula Gaikovina Kula 2 , Norihiro Yoshida 2 , Katsuro Inoue 1 1 Graduate School of Information Science and Technology, Osaka University, Japan 2 Graduate School of Information Science, Nagoya University, Japan 1

Upload: au-gai

Post on 31-Jul-2015

346 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

What Do Practitioners Ask about Code Clone? A Preliminary Investigation of Stack Overflow

Eunjong Choi1, Raula Gaikovina Kula2,

Norihiro Yoshida2, Katsuro Inoue1

1Graduate School of Information Science and Technology,

Osaka University, Japan2Graduate School of Information Science,

Nagoya University, Japan

1

Page 2: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

2

Very little is known about practitioner’s needs on the detection and analysis of code clones.

Motivation of This Study

researcher

practitioners

Page 3: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Stack Overflow (SO)

3

Page 4: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

The Data That We Analyzed

4

from July 31, 2008to July 31, 2012

Page 5: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

The Data That We Analyzed

5

from July 31, 2008to July 31, 2012

Choose keywords related code clones

Page 6: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

The Data That We Analyzed

6

from July 31, 2008to July 31, 2012

Choose keywords related code clones

Select questions based on the chosen keywords

'code clone''code cloning'

'code redundancy'

'code duplicate''code duplication''duplicate code'

'duplicated code'

Page 7: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

The Data That We Analyzed

7

from July 31, 2008to July 31, 2012

Choose keywords related code clones

Select questions based on the chosen keywords

Manually validate

'code clone''code cloning'

'code redundancy'

'code duplicate''code duplication''duplicate code'

'duplicated code'

1,654 questions

Page 8: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

The Data That We Analyzed

8

from July 31, 2008to July 31, 2012

925 questions

Choose keywords related code clones

Select questions based on the chosen keywords

Manually validate

'code clone''code cloning'

'code redundancy'

'code duplicate''code duplication''duplicate code'

'duplicated code'

1,654 questions

Page 9: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

The Data That We Analyzed

9

from July 31, 2008to July 31, 2012:

925 questions

Choose keywords related code clones

Select questions based on the chosen keywords

Manually validate

'code clone''code cloning'

'code redundancy'

'code duplicate''code duplication''duplicate code'

'duplicated code'

Page 10: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Research Question 1

• RQ1: What Kinds of Programming Languages/Techniques were Appeared

in Questions on Clones?

10

Page 11: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Methodology

11

Page 12: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Methodology

12

Tags related to development techniques?

Tags related to programming language ?

Page 13: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Methodology

13

Page 14: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Methodology

14

Tags related to development techniques?

Tags related to programming language ?

Page 15: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

python

ruby-on-rails

.net

javascript

php

jquery

asp.net

c++

java

c#

0 20 40 60 80 100 120 140 160 180 200

Finding (1/2)

Tags related to programming language

Page 16: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

mvc

architecture

unit-testing

generics

dry

design

templates

inheritance

design-patterns

refactoring

0 20 40 60 80

Finding (2/2)

Tags related to development techniques

Page 17: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

mvc

architecture

unit-testing

generics

dry

design

templates

inheritance

design-patterns

refactoring

0 20 40 60 80

Finding (2/2)

The most frequently appeared tags in the questionsare about object-oriented programming

languages and web programming languages.

Moreover, tags about clone management also frequently appear

Tags related to development techniques

Page 18: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Research Question 2

RQ2: Were Questions on Clones Asked by Trusted Practitioners?

18

Novice? Expert?

Practitioners that are interested in handling code clones

Page 19: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Methodology

19

Page 20: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Finding

20

Reputations(Clone) Reputations(General)0

500

1,000

1,500

2,000

2,500

3,000

AskedAnswered

The average reputations of practitioners who asked and answered questions on clones, and other questions

Page 21: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Finding

21

Reputations(Clone) Reputations(General)0

500

1,000

1,500

2,000

2,500

3,000

AskedAnswered

Practitioners who asked about clonesare trusted by the others in SO.

The average reputations of practitioners who asked and answered questions on clones, and other questions

Page 22: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Discussion

22

Page 23: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

23

Discussion

Page 24: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

24

Discussion

Page 25: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

25

Discussion

Page 26: What do practitioners ask about code clone? A preliminary investigation of Stack Overflow

Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Summary

26