dicto - industrial presentation 2

28
DICTO Architecture Conformance Checking Andrea Caracciolo Die Mobiliar - June ‘15 http://scg.unibe.ch/dicto

Upload: andrea-caracciolo

Post on 14-Jan-2017

178 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Dicto - industrial presentation 2

DICTO Architecture Conformance Checking

Andrea Caracciolo

Die Mobiliar - June ‘15

http://scg.unibe.ch/dicto

Page 2: Dicto - industrial presentation 2

Architecture Compliance

2

=Design Code/

Page 3: Dicto - industrial presentation 2

Architecture Compliance

3

=Design Code/

Page 4: Dicto - industrial presentation 2

Quality Monitoring

011010

Page 5: Dicto - industrial presentation 2

011010

Architectural Rules+

Quality Monitoring

Page 6: Dicto - industrial presentation 2

Quality Monitoring

Б

011010

Page 7: Dicto - industrial presentation 2

Quality Monitoring

Б

011010

Page 8: Dicto - industrial presentation 2

Quality Monitoring

011010

Persistence cannot depend on Service

Service must have annotation "@Service"

System cannot contain cycles

Rules

Page 9: Dicto - industrial presentation 2

Rule examples

9

Controller, Model, Dao must be layered CoreExceptions must be caught PojoMethods can only be named "get*", "set*" DataBean must have attribute "destroy-method"only TestPackage can contain dead methodsModel cannot contain code clones; contain cycles

ModelClasses cannot lead to deadlock PriceAPI must have content “*CHF”; status code "200" CustAPI must have latency < 100 msCustAPI must handle load from 30 users

Structural

Behavioural

Page 10: Dicto - industrial presentation 2

Rule examples

10

Entity DefinitionTests = Class with name:"*test_*" PojoMethods = Method with containingClass:”*.pojos.*" DeprecatedMethods = Method with annotation:"@Deprecated" JunitSetup = Method with annotation:"@Before", name:"setUp"

Tests

test_login

test_logout

test_register

Page 11: Dicto - industrial presentation 2

project A

11

Persistence = Package with name:”**.persistence.**”Service = Class with superClass:”*.IService”ImplClasses = Class with name:”*Impl”

Persistence cannot depend on ServiceImplClasses must have annotation “@XXService”System cannot contain cycles

50K LOC

Page 12: Dicto - industrial presentation 2

12

Persistence = Package with name:”**.persistence.**”Service = Class with superClass:”*.IService”ImplClasses = Class with name:”*Impl”

Persistence cannot depend on ServiceImplClasses must have annotation “@XXService”System cannot contain cycles

14

15

19

analysis: 30 secproject A

Page 13: Dicto - industrial presentation 2

13

Persistence = Package with name:”**.persistence.**” name!:”**.service.**”

Service = Class with superClass:”*.IService”ImplClasses = Class with name:”*Impl”

Persistence cannot depend on ServiceImplClasses must have annotation “@XXService” System cannot contain cycles

14

project A

4

Page 14: Dicto - industrial presentation 2

14

Persistence = Package with name:”**.persistence.**”, name!:”**.service.**”

Service = Class with superClass:”*.IService”Impl = Class with name:”*Impl”

Persistence cannot depend on Serviceonly ImplClasses can have annotation “@XXService”System cannot contain cycles

16

project A

Page 15: Dicto - industrial presentation 2

15

project B

Page 16: Dicto - industrial presentation 2

16

CoreProject cannot depend on StammdatenProject, AngebotProject, [..]

StammdatenProject cannot depend on AngebotProject, BetriebProject, [..]

AngebotProject cannot depend on BetriebProject, FosProject, [..]

BetriebProject cannot depend on StammdatenProject, FosProject, [..]

LoppisProject cannot depend on StammdatenProject, FosProject

ClientScoutSWTPackage cannot depend on ServerScoutPackage, ServicePackage, [..]

ClientScoutPackage cannot depend on ClientScoutSWTPackage, ServerScoutPackage, [..]

SharedScoutPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

ServerScoutPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

ServicePackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

BusinessPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

PersistencePackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

UtilityPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

ModelPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

0.5M LOCproject B

Page 17: Dicto - industrial presentation 2

17

CoreProject cannot depend on StammdatenProject, AngebotProject, [..]

StammdatenProject cannot depend on AngebotProject, BetriebProject, [..]

AngebotProject cannot depend on BetriebProject, FosProject, [..]

BetriebProject cannot depend on StammdatenProject, FosProject, [..]

LoppisProject cannot depend on StammdatenProject, FosProject

ClientScoutSWTPackage cannot depend on ServerScoutPackage, ServicePackage, [..]

ClientScoutPackage cannot depend on ClientScoutSWTPackage, ServerScoutPackage, [..]

SharedScoutPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

ServerScoutPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

ServicePackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

BusinessPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

PersistencePackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

UtilityPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

ModelPackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

57136

27

2219

4

analysis: 8 minproject B

Page 18: Dicto - industrial presentation 2

18

Exceptions • classes cannot catch java.lang.Exception or java.lang.RuntimeExceptionClass Naming • interfaces must start with “I”• persistence classes must end with “PO”Class Hierarchy • impl classes must use interfaces parent packageComments • comments must start by TODO [ID]: or FIXME [ID]: Annotations • @Autowire can only be used on interface attributes

project B

Planned rules:

Page 19: Dicto - industrial presentation 2

19

System cannot contain cycles

0

5

10

15

20

Dicto

4

19

cycles

Dicto vs. SonarQube

Page 20: Dicto - industrial presentation 2

BetriebProject cannot depend on StammdatenProject, FosProject, [..]

LoppisProject cannot depend on StammdatenProject, FosProject [..]

ClientScoutPackage cannot depend on ClientScoutSWTPackage, ServerScoutPackage, [..]

ServicePackage cannot depend on ClientScoutSWTPackage, ClientScoutPackage, [..]

20

0

2

4

6

8

Dicto

2

8

logical dep.

Dicto vs. SonarGraph

Page 21: Dicto - industrial presentation 2

21

ilExceptionsWithoutTopLevelException can only depend on ilExceptions only GUIClasses can depend on ilTemplate IliasCodebase cannot use triggerError IliasCodebase cannot use eval IliasCodebase cannot use exitOrDie IliasCodebase cannot use SuppressErrors only GUIClasses can depend on ilLanguage IliasCodebase cannot depend on SetErrorOrExceptionHandler GUIClasses cannot depend on ilDB only GUIClasses can depend on ilTabs

1M LOCMain project

Page 22: Dicto - industrial presentation 2

22

7

101

6

3

45

227

203

316

4

5

analysis: 2 min

ilExceptionsWithoutTopLevelException can only depend on ilExceptions only GUIClasses can depend on ilTemplate IliasCodebase cannot use triggerError IliasCodebase cannot use eval IliasCodebase cannot use exitOrDie IliasCodebase cannot use SuppressErrors only GUIClasses can depend on ilLanguage IliasCodebase cannot depend on SetErrorOrExceptionHandler GUIClasses cannot depend on ilDB only GUIClasses can depend on ilTabs

Main project

Page 23: Dicto - industrial presentation 2

23

7

101

6

3

45

227

203

316

4

5

analysis: 2 min

ilExceptionsWithoutTopLevelException can only depend on ilExceptions only GUIClasses can depend on ilTemplate IliasCodebase cannot use triggerError IliasCodebase cannot use eval IliasCodebase cannot use exitOrDie IliasCodebase cannot use SuppressErrors only GUIClasses can depend on ilLanguage IliasCodebase cannot depend on SetErrorOrExceptionHandler GUIClasses cannot depend on ilDB only GUIClasses can depend on ilTabs

after 1st week -4 violations

Main project

Page 24: Dicto - industrial presentation 2

24

Page 25: Dicto - industrial presentation 2

25

Page 26: Dicto - industrial presentation 2

New Issue

Page 27: Dicto - industrial presentation 2

Evaluation

27

Consulting company Java EE / .NET1’000+ employees

Open source organization PHP (1.8M LOC)12 service providers, 900’000+ users

Transportation companyJava EE1’000+ employees

Page 28: Dicto - industrial presentation 2

Summary

• Enforce guidelines

• Check NFRs

• Readable & executable specification

28

Persistence cannot depend on Service

Service must have annotation “@Service”

System cannot contain cycles

@ scg.unibe.ch/dicto