49
SATT: Tailoring Code Metric Thresholds for Different Software Architectures 1 Maurício Aniche, Christoph Treude, Andy Zaidman, Arie van Deursen, Marco Gerosa @mauricioaniche, @ctreude, @azaidman, @avandeursen, @gerosa_marco

SATT: Tailoring Code Metric Thresholds for Different Software Architectures (SCAM 2016)

Embed Size (px)

Citation preview

SATT:TailoringCodeMetricThresholdsforDifferentSoftwareArchitectures

1

Maurício Aniche,ChristophTreude,AndyZaidman,Arie vanDeursen,MarcoGerosa@mauricioaniche,@ctreude,@azaidman,@avandeursen,@gerosa_marco

Medical Exams

SCAM2016 2

SCAM2016 3

Sugarlevel150[70,120]

SCAM2016 4

Coupling10<15

Howtofindthisnumber?

SCAM2016 5

Benchmarking

1. order by metric value

SCAM2016 6

1. order by metric value

2. weight

SCAM2016 7

1. order by metric value

2. weight

SCAM2016 8

LOC=100

1. order by metric value

2. weight

SCAM2016 9

LOC=100 LOC=200

1. order by metric value

2. weight

SCAM2016 10

100,000LOC

LOC=100 LOC=200

1. order by metric value

2. weight

SCAM2016 11

100,000LOC

LOC=1000.001%

LOC=200

3. weight aggregation

1. order by metric value

2. weight

SCAM2016 12

100,000LOC

LOC=1000.001%

LOC=2000.002%

3. weight aggregation

1. order by metric value

2. weight

SCAM2016 13

100,000LOC

LOC=1000.001%

LOC=2000.002%+0.001%

3. weight aggregation

1. order by metric value

2. weight

SCAM2016 14

100,000LOC

LOC=1000.001%

LOC=2000.003%

3. weight aggregation

1. order by metric value

2. weight

SCAM2016 15

100,000LOC

3. weight aggregation

0% 100%

0%10%30%70%80%90% 100%

SCAM2016 16

1. order by metric value

2. weight

3. weight aggregation

4. extract thresholds from metric values whereaggregated weight is 70%, 80% and 90%

0%10%30%70%80%90% 100%

SCAM2016 17

1. order by metric value

2. weight

3. weight aggregation

SCAM2016 18

Benchmarkin Controllers

19

Benchmarkin Controllers

SCAM2016 20

That’s not whatwe want

SCAM2016 21

SCAM2016 22

Quantiles

Coup

ling(CBO

)

SATT for the rescueSCAM2016 23

SCAM2016 24

Controllers Other classes

SCAM2016 25

1. order by metric value

SCAM2016 26

1. order by metric value

only controllers

SCAM2016 27

1. order by metric value

2. aggregate the weight

0%10%30%70%80%90% 100%

SCAM2016 28

1. order by metric value

2. aggregate the weight

3. extract thresholds from metric values whereaggregated weight is 70%, 80% and 90%

0%10%30%70%80%90% 100%

SCAM2016 29

Our studySCAM2016 30

projects’ sample

SCAM2016 31

CK metrics

SCAM2016 32

RQ1. What differences in metric values distributions does SATT find for common architectural styles such as MVC?

SCAM2016 33

RQ2. Can the differences in distributions thus found be explained from the architectural constraints imposed on classes fulfilling dedicated architectural roles?

SCAM2016 34

RQ3. What impact do these differences have on the use of thresholds for quality assessments?

SCAM2016 35

Differences!

SCAM2016 36

RQ1. The approach indeed finds architectural roles that present significantly higher (or lower) values for certain metrics when compared to other classes.

SCAM2016 37

We talked to experts

SCAM2016 38

SCAM2016 39

“Controllers are coupled to the framework while Services are coupled to domain objects.”

“Entities contain getters and setters”

RQ2. Experts considered most of the differences in metric values for architectural roles to be coherent. Their key explanation is that architectural roles have specific responsibilities.

SCAM2016 40

SCAM2016 41

SCAM2016 42

SCAM2016 43

SCAM2016 44

RQ3. The state-of-art approach tends to return doubtful results for architectural roles that have metric values distribution significantly different from other classes. Our approach improves it by using the architectural role’s metric values distribution to define thresholds.

SCAM2016 45

SameforAndroid!SCAM2016 46

SCAM2016+ICSME2016=

SCAM2016 47

• Benchmark-basedassessmenttechniquesdonottakethearchitecturalroleofaclassintoconsideration.

• SATTprovidesaspecificthresholdforanarchitecturalrolewhenitsmetricvaluesaresignificantlydifferentfromotherclasses.

• Theapproachseemstoprovidebetterresultsinthesecases.

SCAM2016 48

SATT:TailoringCodeMetricThresholdsforDifferentSoftwareArchitectures

49

Maurício Aniche,ChristophTreude,AndyZaidman,Arie vanDeursen,MarcoGerosa@mauricioaniche,@ctreude,@azaidman,@avandeursen,@gerosa_marco