Page 1
AValidatedSetofSmellsinMVCArchitectures
Maurício Aniche,GabrieleBavota,ChristophTreude,Arie vanDeursen,MarcoGerosa@mauricioaniche,@gbavota,@ctreude,@avandeursen,@gerosa_marco
Page 2
ICSME2016 2
Let’simprovethatfeature… Ohno!Codethere
sucks!
Page 3
ICSME2016 3
Lookforcodesmells,youngpadawan!
Page 4
ICSME2016 4
TakealookatthisGodClass!
Nah…
Page 5
ICSME2016 5
WhataboutthisControllerwithmanyroutes?
Yeah,thisisaproblem!!!!
Page 6
Interviews +surveys with
50 developers
ICSME2016 6
Page 7
ICSME2016 7
1. Layer-focused survey2. Role-focused survey3. Interviews with developers4. Expert review
Page 8
Result: A catalogueof smells
ICSME2016 8
Page 9
Promiscuous ControllerOffers too many actions
ICSME2016 9
Page 10
BrainControllerToo much business logic
ICSME2016 10
Page 11
Meddling ServiceQueries the database
ICSME2016 11
Page 12
Brain RepositoryComplex logic (SQL or code)
ICSME2016 12
Page 13
Laborious Repository Method
Many queries in a single method
ICSME2016 13
Page 14
Fat RepositoryManages many entities
ICSME2016 14
Page 15
Spring MVC in github
ICSME2016 15
Page 16
Detection strategies
ICSME2016 16
3Q + 1.5IRQ
Page 17
Smelly classes exist!
ICSME2016 17
Page 18
Our studyICSME2016 18
Page 19
RQ1. What is the impact of the proposed code smells on change-proneness of classes?
ICSME2016 19
Page 20
RQ2. What is the impact of the proposed code smells on defect-proneness of classes?
ICSME2016 20
Page 21
Smelly classes
ICSME2016 21
Clean classes
havechanged
have notchanged
havechanged
have notchanged
Isthisdifferencesignificant?
Page 22
Are they smells?
ICSME2016 22
Page 23
RQ3. Do developers perceive classes affected by the proposed code smells as problematic?
ICSME2016 23
Page 24
• We collected perceptions of 17 developers
• 6 random classes of existing systems(2 T-smelly, 2 non smelly, 2 MVC smelly)
• Evaluate from 0 to 5 the severity of the problem
ICSME2016 24
Page 25
Developers’ perceptions
Significantly different
ICSME2016 25
Page 26
SCAM2016+ICSME2016=
SCAM2016 26
Page 27
• Developersdocareaboutothertypesofsmells(contextualsmells)
• Bymeansofa4-stepapproach,wecoinedacatalogueofsmellsforMVCapps.
• Classesaffectedbythesesmellstendtobepronetochangeandtodefects.
• Developersclearlyperceivethesesmells.
SCAM2016 27
Page 28
AValidatedSetofSmellsinMVCArchitectures
Maurício Aniche,GabrieleBavota,ChristophTreude,Arie vanDeursen,MarcoGerosa@mauricioaniche,@gbavota,@ctreude,@avandeursen,@gerosa_marco