Cha-Q 2 adding feature resolving issue adding feature resolving - - PowerPoint PPT Presentation

cha q 2 adding feature resolving issue adding feature
SMART_READER_LITE
LIVE PREVIEW

Cha-Q 2 adding feature resolving issue adding feature resolving - - PowerPoint PPT Presentation

Mining Repositories for Systematic Edits Presenter: Reinout Stevens Cha-Q 2 adding feature resolving issue adding feature resolving issue 3 Systematic Edits 4 Systematic Edits 4 Systematic Edits 4 Systematic Edits 4 Overview of the


slide-1
SLIDE 1

Mining Repositories for Systematic Edits

Presenter: Reinout Stevens

Cha-Q

slide-2
SLIDE 2

2

slide-3
SLIDE 3

3

adding feature resolving issue adding feature resolving issue

slide-4
SLIDE 4

Systematic Edits

4

slide-5
SLIDE 5

Systematic Edits

4

slide-6
SLIDE 6

Systematic Edits

4

slide-7
SLIDE 7

Systematic Edits

4

slide-8
SLIDE 8

Overview of the Approach

5

Mine Repository

public <method-name>(View <param1>, <type> <param2>) {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

} double <method-name>(View <param1>, <type> <param2>) { new Handler().post(new Runnable() { @Override public void run() {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

})}

Detect Systematic Edits Compute Changes

slide-9
SLIDE 9

Computing Changes

6

  • 1. insert(:body, onFocusChange, new Handler())
  • 2. insert(:identifier,new Hander(),post())
  • 3. insert(:arguments,post(),new Runnable())
  • 4. insert(:bodyDeclaration,new Runnable(), public void run())
  • 5. …
  • 6. move(:body, run(), optionsfocuschange())
  • 7. …

Move Insert

show_schedule.setOnFocusChangeListener(new … { @Override public void onFocusChange(View v, boolean hasFocus) {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

} }); show_schedule.setOnTouchListener(new …() { @Override public boolean onTouch(View v, MotionEvent event) {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

return true; } }); show_schedule.setOnFocusChangeListener(new … { @Override public void onFocusChange(View v, boolean hasFocus) { new Handler().post(new Runnable() { @Override public void run() {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

}}); } }); show_schedule.setOnTouchListener(new …() { @Override public boolean onTouch(View v, MotionEvent event) { new Handler().post(new Runnable() { @Override public void run() {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

}}); return true; } });

slide-10
SLIDE 10

Frequent Itemset Mining

Group Items 1 {Bread, Butter} 2 {Beer, Milk, Butter} 3 {Bread, Milk, Butter} 4 {Beer, Butter} 5 {Bread, Milk, Butter}

Negara, S. et al. (2014). Mining Fine-grained Code Changes to Detect Unknown Change Patterns. In Proceedings of the 36th International Conference on Software Engineering (ICSE) (pp. 803–813). May 31 - June 07, 2014, Hyderabad, IN.

7

slide-11
SLIDE 11

Frequent Itemset Mining

Group Items 1 {Bread, Butter} 2 {Beer, Milk, Butter} 3 {Bread, Milk, Butter} 4 {Beer, Butter} 5 {Bread, Milk, Butter}

Frequent pattern (support 3) {Bread, Butter} Frequent pattern (support 3) {Bread} …

Negara, S. et al. (2014). Mining Fine-grained Code Changes to Detect Unknown Change Patterns. In Proceedings of the 36th International Conference on Software Engineering (ICSE) (pp. 803–813). May 31 - June 07, 2014, Hyderabad, IN.

7

slide-12
SLIDE 12

Applied to Changes

Group Items 1 {Bread, Butter} 2 {Beer, Milk, Butter} 3 {Bread, Milk, Butter} 4 {Beer, Butter} 5 {Bread, Milk, Butter}

  • Q1. How to group changes?
  • Q2. When are two changes considered equal?

8

slide-13
SLIDE 13

Grouping Analogy

Group Items 1 {Bread, Butter} 2 {Beer, Milk, Butter} 3 {Bread, Beer, Butter} Group Items 1 {Saw, Gloves, Nails} 2 {Hammer, Nails, Wood} 3 {Nails, Gloves, Hammer} Group Items 1 {Coughing Syrup} 2 {Band Aid, Painkillers, Rubbing Alcohol} 3 {Band Aid, Painkillers}

9

slide-14
SLIDE 14

Grouping Analogy

Group Items 1 {Bread, Butter} 2 {Beer, Milk, Butter} 3 {Bread, Beer, Butter} Group Items 1 {Saw, Gloves, Nails} 2 {Hammer, Nails, Wood} 3 {Nails, Gloves, Hammer} Group Items 1 {Coughing Syrup} 2 {Band Aid, Painkillers, Rubbing Alcohol} 3 {Band Aid, Painkillers} Group Items 1 {Bread, Butter, Saw, Gloves, Nails, Syrup} 2 {Beer, Milk, Butter, Hammer, Nails, Wood, Band Aid, Painkillers, Rubbing Alcohol} 3 {Bread, Milk, Butter, Nails, Gloves, Hammer, Band Aid, Painkillers}

9

slide-15
SLIDE 15

Grouping Changes

Group Changes

  • nFocusChange()

insert(:body, onFocusChange, new Handler()) insert(:identifier,new Hander(),post()) insert(:arguments,post(),new Runnable()) insert(:bodyDeclaration,new Runnable(), public void run()) move(:body, run(), optionsfocuschange()) …

  • nTouch()

insert(:body, onTouch, new Handler()) insert(:identifier,new Hander(),post()) insert(:arguments,post(),new Runnable()) insert(:bodyDeclaration,new Runnable(), public void run()) move(:body, run(), optionsfocuschange()) …

Method File Commit Package

10

slide-16
SLIDE 16

Equality Analogy

Transaction Items 1 {White Bread, Butter} 2 {Alcohol-Free Beer, Soy Milk, Margarine} 3 {Brown Bread, Whole Milk, Butter} 4 {Trappist, Chocolate Paste} 5 {French Bread, Skimmed Milk, Butter}

Frequent pattern (support 3) {Bread, Butter} 11

slide-17
SLIDE 17

12

Context Modified

show_schedule.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { new Handler().post(new Runnable() { @Override public void run() {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

}}); } }); show_schedule.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { new Handler().post(new Runnable() { @Override public void run() {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

}}); return true; } });

  • nFocus

Change View v boolean hasFocus

  • ptions

focus change OPTIONS_ SHOW_SCH EDULE

setOnFoc usChange Listener

  • nTouch

View v MotionEv ent event

setOnTou chListen er

new Handler. post() new Runnable …

  • ptions

focus change OPTIONS_ SHOW_SCH EDULE new Handler. post() new Runnable …

slide-18
SLIDE 18

TP Vision Data

=?

~1650 Commits ~300 Classes ~27000 LOC Grouped by method Structurally equal

slide-19
SLIDE 19

Results

14

#Systematic Edits

50 100 150 200 250 300 350 400 450 500

#Instances

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 21

467 221 98 88 49 41 29 15 10 5 6 4 5 5 4 4 4

slide-20
SLIDE 20

Example: Threading

15

show_schedule.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { + new Handler().post(new Runnable() { + @Override + public void run() {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

+ }}); } }); show_schedule.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { + new Handler().post(new Runnable() { + @Override + public void run() {

  • ptionsfocuschange(OPTIONS_SHOW_SCHEDULE);

+ }}); return true; } });

slide-21
SLIDE 21

Example: Disable

16

  • Log.i(TAG,"programdata dbSize

>IPEPGClientServiceConstants.MAX_DB_SIZE"+ dbSize); +//Log.i(TAG,"programdata dbSize >IPEPGClientServiceConstants.MAX_DB_SIZE"+ dbSize);

  • Log.i(TAG,"programdata dbSize is greater than max limit,

deleting programs for scid "+ scid); + //Log.i(TAG,"programdata dbSize is greater than max limit, deleting programs for scid "+ scid); ...

slide-22
SLIDE 22

Example: Conversion

17

  • private Tuning plfTuning;
  • private TuningDvbC plfTuningDvbc ;
  • private TuningDvbT plfTuningDvbt;
  • private TuningDvbSEx plfTuningDvbs;
  • private OnChangeListener listener;

+ private ITuning plfTuning; + private ITuningDvbC plfTuningDvbc; + private ITuningDvbT plfTuningDvbt; + private ITuningDvbS plfTuningDvbs; + private TvMediaPlayer tvMpl; + private ITvMediaPlayerContext itvmplctxt; + private ITuning.OnChangeListener listener;

slide-23
SLIDE 23

Conclusion

18

Mine Repository for Systematic Edits

#SysEdits

50 100 150 200 250 300 350 400 450 500

#Instances

3 4 5 6 7 8 9 10111213141516171821

467 221 98 88 49 41 29 15 10 5 6 4 5 5 4 4 4