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
Medical Exams
SCAM	2016 2
SCAM	2016 3
Sugar	level																150																							[70,120]
SCAM	2016 4
Coupling																				10																								<	15
How	to	find
this	number?
SCAM	2016 5
Benchmarking
1. order by metric value
SCAM	2016 6
1. order by metric value
2. weight
SCAM	2016 7
1. order by metric value
2. weight
SCAM	2016 8
LOC=100
1. order by metric value
2. weight
SCAM	2016 9
LOC=100 LOC=200
1. order by metric value
2. weight
SCAM	2016 10
100,000	LOC
LOC=100 LOC=200
1. order by metric value
2. weight
SCAM	2016 11
100,000	LOC
LOC=100
0.001%
LOC=200
3. weight aggregation
1. order by metric value
2. weight
SCAM	2016 12
100,000	LOC
LOC=100
0.001%
LOC=200
0.002%
3. weight aggregation
1. order by metric value
2. weight
SCAM	2016 13
100,000	LOC
LOC=100
0.001%
LOC=200
0.002%+0.001%
3. weight aggregation
1. order by metric value
2. weight
SCAM	2016 14
100,000	LOC
LOC=100
0.001%
LOC=200
0.003%
3. weight aggregation
1. order by metric value
2. weight
SCAM	2016 15
100,000	LOC
3. weight aggregation
0% 100%
0%																							10%																							30%																								70%																80%						90%																 100%
SCAM	2016 16
1. order by metric value
2. weight
3. weight aggregation
4. extract thresholds from metric values where
aggregated weight is 70%, 80% and 90%
0%																							10%																							30%																								70%																80%						90%																 100%
SCAM	2016 17
1. order by metric value
2. weight
3. weight aggregation
SCAM	2016 18
Benchmark
in Controllers
19
Benchmark
in Controllers
SCAM	2016 20
That’s not what
we want
SCAM	2016 21
SCAM	2016 22
Quantiles
Coupling	(CBO)
SATT for the rescue
SCAM	2016 23
SCAM	2016 24
Controllers Other classes
SCAM	2016 25
1. order by metric value
SCAM	2016 26
1. order by metric value
only controllers
SCAM	2016 27
1. order by metric value
2. aggregate the weight
0%																							10%																							30%																								70%																80%						90%																 100%
SCAM	2016 28
1. order by metric value
2. aggregate the weight
3. extract thresholds from metric values where
aggregated weight is 70%, 80% and 90%
0%																							10%																							30%																								70%																80%						90%																 100%
SCAM	2016 29
Our studySCAM	2016 30
projects’ sample
SCAM	2016 31
CK
metrics
SCAM	2016 32
RQ1. What differences in metric values
distributions does SATT find for common
architectural styles such as MVC?
SCAM	2016 33
RQ2. Can the differences in distributions
thus found be explained from the
architectural constraints imposed on
classes fulfilling dedicated architectural
roles?
SCAM	2016 34
RQ3. What impact do these differences
have on the use of thresholds for quality
assessments?
SCAM	2016 35
Differences!
SCAM	2016 36
RQ1. The approach indeed finds architectural roles
that present significantly higher (or lower) values
for certain metrics when compared to other classes.
SCAM	2016 37
We talked to experts
SCAM	2016 38
SCAM	2016 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.
SCAM	2016 40
SCAM	2016 41
SCAM	2016 42
SCAM	2016 43
SCAM	2016 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.
SCAM	2016 45
Same	for	Android!
SCAM	2016 46
SCAM	2016	+	ICSME	2016	=
SCAM	2016 47
• Benchmark-based	assessment	techniques	do	
not	take	the	architectural	role	of	a	class	into	
consideration.
• SATT	provides	a	specific	threshold	for	an	
architectural	role	when	its	metric	values	are	
significantly	different	from	other	classes.
• The	approach	seems	to	provide	better	results	
in	these	cases.
SCAM	2016 48
SATT:	Tailoring	Code	Metric	
Thresholds	for	Different	
Software	Architectures
49
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)