a validated set of smells for mvc architectures - icsme 2016

28
A Validated Set of Smells in MVC Architectures Maurício Aniche, Gabriele Bavota, Christoph Treude, Arie van Deursen, Marco Gerosa @mauricioaniche, @gbavota, @ctreude, @avandeursen, @gerosa_marco

Upload: mauricio-aniche

Post on 15-Apr-2017

283 views

Category:

Technology


0 download

TRANSCRIPT

AValidatedSetofSmellsinMVCArchitectures

Maurício Aniche,GabrieleBavota,ChristophTreude,Arie vanDeursen,MarcoGerosa@mauricioaniche,@gbavota,@ctreude,@avandeursen,@gerosa_marco

ICSME2016 2

Let’simprovethatfeature… Ohno!Codethere

sucks!

ICSME2016 3

Lookforcodesmells,youngpadawan!

ICSME2016 4

TakealookatthisGodClass!

Nah…

ICSME2016 5

WhataboutthisControllerwithmanyroutes?

Yeah,thisisaproblem!!!!

Interviews +surveys with

50 developers

ICSME2016 6

ICSME2016 7

1. Layer-focused survey2. Role-focused survey3. Interviews with developers4. Expert review

Result: A catalogueof smells

ICSME2016 8

Promiscuous ControllerOffers too many actions

ICSME2016 9

BrainControllerToo much business logic

ICSME2016 10

Meddling ServiceQueries the database

ICSME2016 11

Brain RepositoryComplex logic (SQL or code)

ICSME2016 12

Laborious Repository Method

Many queries in a single method

ICSME2016 13

Fat RepositoryManages many entities

ICSME2016 14

Spring MVC in github

ICSME2016 15

Detection strategies

ICSME2016 16

3Q + 1.5IRQ

Smelly classes exist!

ICSME2016 17

Our studyICSME2016 18

RQ1. What is the impact of the proposed code smells on change-proneness of classes?

ICSME2016 19

RQ2. What is the impact of the proposed code smells on defect-proneness of classes?

ICSME2016 20

Smelly classes

ICSME2016 21

Clean classes

havechanged

have notchanged

havechanged

have notchanged

Isthisdifferencesignificant?

Are they smells?

ICSME2016 22

RQ3. Do developers perceive classes affected by the proposed code smells as problematic?

ICSME2016 23

• 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

Developers’ perceptions

Significantly different

ICSME2016 25

SCAM2016+ICSME2016=

SCAM2016 26

• Developersdocareaboutothertypesofsmells(contextualsmells)

• Bymeansofa4-stepapproach,wecoinedacatalogueofsmellsforMVCapps.

• Classesaffectedbythesesmellstendtobepronetochangeandtodefects.

• Developersclearlyperceivethesesmells.

SCAM2016 27

AValidatedSetofSmellsinMVCArchitectures

Maurício Aniche,GabrieleBavota,ChristophTreude,Arie vanDeursen,MarcoGerosa@mauricioaniche,@gbavota,@ctreude,@avandeursen,@gerosa_marco