an empirical study on the developers’ perception of...

119
Denys Poshyvanyk Gabriele Bavota Bogdan Dit Rocco Oliveto Massimiliano Di Penta Andrea De Lucia An Empirical Study on the Developers’ Perception of Software Coupling

Upload: others

Post on 13-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Denys Poshyvanyk

Gabriele Bavota

Bogdan Dit

Rocco Oliveto

Massimiliano Di Penta

Andrea De Lucia

An Empirical Study on theDevelopers’ Perception of Software 

Coupling

Page 2: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Coupling

Module 1 Module 2

Page 3: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Coupling

Module 1 Module 2

Page 4: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Module 1 Module 2

Coupling

Measure coupling…

Page 5: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Module 1 Module 2

Coupling

Measure coupling… Use coupling…- predicting fault proneness- change impact analysis- software remodularization- software reuse- change propagation- etc.

Page 6: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

What are the Typical Types of Information used for Coupling?

Page 7: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

What are the Typical Types of Information used for Coupling?

[Briand et al., TSE’99]: overview of structural metrics

Page 8: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

What are the Typical Types of Information used for Coupling?

[Briand et al., TSE’99]: overview of structural metrics

Typical types of information:StructuralDynamicSemanticLogical

Page 9: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Page 10: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

Page 11: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

y

Methods sharing attributes are more likely

to implement similar responsibility

Page 12: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

Methods grouped together by developers are more

likely to implement similar responsibility

Page 13: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Classes having inheritance relations are more likely to implement

similar responsibility

Page 14: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

C

methodC1()methodC2()

Calls between methods (Classes)

Page 15: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Dattribute_DmethodD1()methodD2()methodD3()

C

methodC1()methodC2()

E

methodE1()

Calls between methods (Classes)

Page 16: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Dynamic

Page 17: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Dattribute_DmethodD1()methodD2()methodD3()

C

methodC1()methodC2()

E

methodE1()

Page 18: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Dattribute_DmethodD1()methodD2()methodD3()

C

methodC1()methodC2()

E

methodE1()

Execution TraceA.methodA2() → C.methodC2()C.methodC2() → E.methodE1()

Page 19: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Dattribute_DmethodD1()methodD2()methodD3()

C

methodC1()methodC2()

E

methodE1()

Execution TraceA.methodA2() → C.methodC2()C.methodC2() → E.methodE1()

Page 20: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Dattribute_DmethodD1()methodD2()methodD3()

C

methodC1()methodC2()

E

methodE1()

Execution TraceA.methodA2() → C.methodC2()C.methodC2() → E.methodE1()

The calls that are not in the trace will not be used for computing dynamic coupling

Page 21: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Dattribute_DmethodD1()methodD2()methodD3()

C

methodC1()methodC2()

E

methodE1()

Execution TraceA.methodA2() → C.methodC2()C.methodC2() → E.methodE1()

The calls that are not in the trace will not be used for computing dynamic coupling

Dynamic couplingis more precise than structural coupling

Page 22: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Aattribute_AgetAttributeA()setAttributeA(…)methodA1()methodA2()

B

Dattribute_DmethodD1()methodD2()methodD3()

C

methodC1()methodC2()

E

methodE1()

Execution TraceA.methodA2() → C.methodC2()C.methodC2() → E.methodE1()

The calls that are not in the trace will not be used for computing dynamic coupling

Dynamic couplingis more precise than structural coupling

Dynamic couplingis harder to generate than

structural coupling

Page 23: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Dynamic

Semantic

Page 24: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems
Page 25: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Remove special characters

Page 26: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Remove common words

Remove common words

Remove common words

Remove special characters

Page 27: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Remove common words

Remove common words

Remove common words

Split identifiers

Remove special characters

Page 28: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Compute textual similarity between

documents“Textual” coupling…

Page 29: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Dynamic

Semantic

Logical (Evolutionary)

Page 30: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Source File

A

B

C

E

Time

D

Page 31: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Source File

A

B

C

E

Time

D

Changes to file A

Page 32: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Source File

A

B

C

E

Time

D

Page 33: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Source File

A

B

C

E

Time

D

A, D & E changed together often

Page 34: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Source File

A

B

C

E

Time

D

B & C changed together often

Page 35: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Source File

A

B

C

E

Time

D

B & C changed together often

Classes that often change together are likely to implement similar responsibility

Page 36: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Which type of coupling aligns better with developers’ perception?

Page 37: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Which type of coupling aligns better with developers’ perception?

Empirical study with 76 developers

Page 38: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Choosing Software Systems

Page 39: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems
Page 40: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Size 200 KLOC 29 KLOC 28 KLOC# of classes 1,889 289 245Vocabulary 7,961 2,834 2,418

Page 41: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Size 200 KLOC 29 KLOC 28 KLOC# of classes 1,889 289 245Vocabulary 7,961 2,834 2,418

Page 42: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Size 200 KLOC 29 KLOC 28 KLOC# of classes 1,889 289 245Vocabulary 7,961 2,834 2,418

Historical 8 years 5 years 12 years

Page 43: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Size 200 KLOC 29 KLOC 28 KLOC# of classes 1,889 289 245Vocabulary 7,961 2,834 2,418

Historical 8 years 5 years 12 years

Execution Traces

Coverage

Page 44: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

ArgoUMLNo test cases available…

Page 45: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

ArgoUML

Trace 1

No test cases available…

Page 46: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

ArgoUML

Trace 2

Trace 1

No test cases available…

Page 47: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

ArgoUML

Trace 2

Trace 1

Trace i

No test cases available…

Page 48: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Size 200 KLOC 29 KLOC 28 KLOC# of classes 1,889 289 245Vocabulary 7,961 2,834 2,418

Historical 8 years 5 years 12 years

Execution Traces

Coverage66% 67% 86%

Page 49: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Choosing Software Systems

Choosing Participants

Page 50: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

OriginalDevelopers

Page 51: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

OriginalDevelopers 6 36 3 3

Page 52: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

OriginalDevelopers 6 3 3

ExternalDevelopers 6464

6 3 3

Page 53: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

OriginalDevelopers 6 3 3

ExternalDevelopers 6464

5 with industrial experience7 faculty

16 PhD students33 MS students

3 undergraduates

6 3 3

Page 54: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

OriginalDevelopers 6 3 3

ExternalDevelopers 64

6 3 3

64Original developers evaluated their own system

Page 55: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Developers

ExternalDevelopers 6464

External developers evaluated all systems

Page 56: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Choosing Software Systems

Choosing Participants

Coupling Metrics

Page 57: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems
Page 58: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural Coupling:ICP: Information flow-based coupling [Lee et al.’95]

Dynamic Coupling:IC_CD: Import Coupling Class Dynamic Message [Arisholm et al.’04]

Semantic Coupling:CCBC: Conceptual Coupling Between Classes [Poshyvanyk et al.’08]

Logical Coupling:Association rule-based Change Coupling [Ying et al.’04] [Zimmerman et al.’04]

Page 59: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Choosing Software Systems

Choosing Participants

Coupling Metrics

Data Collection

Page 60: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Page 61: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Page 62: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

High Structural Coupling:- Top 2 pairs

Page 63: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

High Structural Coupling:- Top 2 pairs

Low Structural Coupling:- Bottom 2 pairs

Page 64: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems
Page 65: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

1 2 3 4 5Likert Scale

Highly coupledNo coupling

Page 66: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Dynamic

Semantic

Logical

Page 67: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Structural

Dynamic

Semantic

Logical

16 pairs of classes / system

Page 68: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Choosing Software Systems

Choosing Participants

Coupling Metrics

Data Collection

Results

Page 69: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Likert scale for coupling perceived

by developers

Page 70: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Types of highcoupling

Page 71: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Types of highcoupling

If developers agree with high coupling, results

should be here…

Page 72: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

If developers agree with low coupling, results

should be here…

Types of lowcoupling

Page 73: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Orig

inal

Dev

.Ex

tern

al D

ev.

Page 74: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Orig

inal

Dev

.Ex

tern

al D

ev. Statistical

analysis

Page 75: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems
Page 76: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Page 77: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Classes with high semantic measure are perceived as strong coupled

Page 78: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Semantic outperforms others [p-value<0.05]

Page 79: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Structural and dynamic align well with developers’ perception

Page 80: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Logical is outperformed by others

Page 81: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Qualitative example…

Page 82: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Original developer:

“these classes have a very high coupling even if there is no cooperation between them”

ActionVisibilityPrivate ActionVisibilityProtected

Page 83: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Original developer:

“these classes have a very high coupling even if there is no cooperation between them”

Semantic measure is the only one capturing coupling between these classes

Page 84: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Classes with low semantic measure are perceived as loose coupled

Page 85: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Semantic outperforms others [p-value<0.05]

Page 86: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

6 O

rigin

al D

ev.

64Ex

tern

al D

ev.

Wider distribution of values…why?

Page 87: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

AboutBox FigCompartmentBox

Classes with low dynamic coupling, but ranked as strong coupled.

Page 88: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Original developer:

“even if indirectly, the two classes exhibit some form of coupling since they implement similar jobs and changes to the GUI are likely to involve both classes”

AboutBox FigCompartmentBox

Classes with low dynamic coupling, but ranked as strong coupled.

Page 89: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems
Page 90: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Page 91: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Classes with high semantic measure are perceived as strong coupled

Page 92: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Semantic outperforms others [p-value<0.05]

Page 93: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Structural is most unsuited to capture coupling

Page 94: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Dynamic and semantic are the only ones that properly capture low coupling

Page 95: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Structural produces strange results… Why?

Page 96: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

ZoomTool ZoomUpdateStrategy

Classes with low coupling => perceived as coupled

Page 97: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

ZoomTool ZoomUpdateStrategy

Classes with low coupling => perceived as coupled

Original developer:

“these classes are peer features participating in the same context”

Page 98: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

ZoomTool ZoomUpdateStrategy

Semantic measure captures this coupling (CCBC=0.52)

Classes with low coupling => perceived as coupled

Original developer:

“these classes are peer features participating in the same context”

Page 99: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Semantic measure is not a silver bullet…

AWTCursor Locator

Not coupled, but semantic measure is high(CCBC=0.41)

Page 100: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems
Page 101: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Page 102: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

3 O

rigin

al D

ev.

64 E

xter

nal D

ev.

Same trends as other systems…

Page 103: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

How can these types of coupling affect the remodularization of a software 

system?

Page 104: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

A D

C

B

F

E

G

H

I

Package 1Package 1 Package 2Package 2 Package nPackage n

Original software structure

Page 105: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

A D

C

B

F

E

G

H

I

Package 1Package 1 Package 2Package 2 Package nPackage n

Original software structure

Structural dependencies

A C

B G

D E

I D

Page 106: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

A D

C

B

F

E

G

H

I

Package 1Package 1 Package 2Package 2 Package nPackage n

Original software structure

Structural dependencies

A C

B G

D E

I D

Bunch[Mitchell and Mancoridis’06]

Page 107: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

A D

C

B

F

E

G

H

I

Package 1Package 1 Package 2Package 2 Package nPackage n

Original software structure

Structural dependencies

A C

B G

D E

I D

Bunch[Mitchell and Mancoridis’06]

A I

H

B

F

E

C

Package iPackage i Package jPackage j

…D

Page 108: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

A D

C

B

F

E

G

H

I

Package 1Package 1 Package 2Package 2 Package nPackage n

Original software structure

Structural dependencies

A C

B G

D E

I D

Bunch[Mitchell and Mancoridis’06]

A I

H

B

F

E

C

Package iPackage i Package jPackage j

…D

Page 109: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

A D

C

B

F

E

G

H

I

Package 1Package 1 Package 2Package 2 Package nPackage n

Original software structure

Structural dependencies

A C

B G

D E

I D

Bunch[Mitchell and Mancoridis’06]

A I

H

B

F

E

C

Package iPackage i Package jPackage j

…D

MoJoFM[Wen and Tzerpos’04]

Page 110: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

A D

C

B

F

E

G

H

I

Package 1Package 1 Package 2Package 2 Package nPackage n

Original software structure

Structural dependencies

A C

B G

D E

I D

Bunch[Mitchell and Mancoridis’06]

A I

H

B

F

E

C

Package iPackage i Package jPackage j

…D

MoJoFM[Wen and Tzerpos’04]How many move and

join operations are required to transform

the produced modularization to the

original one?

Page 111: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Median MoJoFM for 30 runs of Bunch (to account for randomness)

Page 112: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Median MoJoFM for 30 runs of Bunch (to account for randomness)

Structural and semantic coupling produce better remodularity

Page 113: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Median MoJoFM for 30 runs of Bunch (to account for randomness)

Maybe not enough data?

Page 114: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Threats to Validity

• Metrics frequently used in the literature• Performance of dynamic and logical metrics may have been impacted by insufficient data

• Pairs of classes may not be representative• Remodularization task: use of current modularization of the system as oracle

• Choice of coupling measures

Page 115: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Conclusions

• Empirical study to assess the developer perception on software coupling– 76 developers

• Investigate which type of information is more suitable for remodularization

• We need more studies to generalize the results

Page 116: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Future Work

• Consider systems with more dynamic and logical information

• Use different coupling measures• Consider combinations of coupling metrics

Page 117: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Thank you! Questions?

http://www.distat.unimol.it/reports/coupling

Page 118: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

References

• B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems using the bunch tool,” IEEE Transactions on Software Engineering, vol. 32, no. 3, pp. 193–208, 2006.

• Z. Wen and V. Tzerpos, “An effectiveness measure for software clustering algorithms,” in Proceedings of the 12th IEEE International Workshop on Program Comprehension, 2004, pp. 194–203.

Page 119: An Empirical Study on the Developers’ Perception of ...denys/pubs/talks/ICSE'13.Coupling.pdf•B. S. Mitchell and S. Mancoridis, “On the automatic modularization of software systems

Overlap