Dicto - industrial presentation 3

Post on 14-Jan-2017

224 views 5 download

Transcript of Dicto - industrial presentation 3

DICTO Architecture Conformance Checking

Andrea Caracciolohttp://scg.unibe.ch/dicto

Architecture Compliance

2

=Design Code/

Architecture Compliance

3

=Design Code/

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ut dui fermentum, blandit ligula vel, hendrerit velit. Donec laoreet, urna et sodales pretium, lacus sapien pharetra libero, nec sodales neque velit sit amet tortor. Phasellus vitae magna at leo sagittis tincidunt. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent eu accumsan diam. Phasellus lectus enim, elementum sed ultrices vitae, volutpat eget urna. Aliquam vitae sagittis urna, in lobortis orci.

TestMethods = Class with annotation:"@Test"Controllers = Package with name:”*controller*”, name!:Core = {Controllers, Model} except {Tests, Utils}

Core cannot contain code clones only Controllers can catch ValidationExceptionsWebAPI must have latency < "100 ms"Tests must have method Setup, Teardown

only Controllers can catch InputExceptionsTests must have method Setup, TeardownXMLWeb must have child "servlet-mapping"

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ut dui fermentum, blandit ligula vel, hendrerit velit. Donec laoreet, urna et sodales pretium, lacus sapien pharetra libero, nec sodales neque velit sit amet tortor. Phasellus vitae magna at leo sagittis tincidunt. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent eu accumsan diam. Phasellus lectus enim, elementum sed ultrices vitae, volutpat eget urna. Aliquam vitae sagittis urna, in lobortis orci.

Analyzers

DSLEvaluatorArchitect

Pre-configured rule checkers

Custom rules

Custom rules

Rule examples

8

Controller, Model, Dao must be layered ServiceMethods must have annotation “@*Transactional" PojoMethods can only be named "get*", "set*" DataBean must have attribute “destroy-method"XMLServletClass must have text “[..].DispatcherServlet”

ModelClasses cannot lead to deadlock CustAPI must have latency < 100 msCustAPI must handle load from 30 users

Structure

Behaviour

http://scg.unibe.ch/dicto/examples.php

only TestPackage can contain dead methodsModel cannot contain contain cycles Model cannot have empty catch block

Flaws

Rule examples

9

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

project A

10

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

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

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

50K LOC

11

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

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

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

4

16

19

analysis: 30 secproject A

12

project B

13

ClientScoutPackage can only depend on SharedScoutPackage ServerScoutPackage can only depend on SharedScoutPackage, ServicePackage ServicePackage can only depend on BusinessPackage BusinessPackage can only depend on ServicePackage, PersistencePackage FosBatch cannot depend on ForUiImpl FosBatch cannot depend on ForPublicImpl Persistence cannot depend on Service Batch cannot depend on Persistence […]

ModelClasses, DTOClasses must implement interface "java.io.Serializable" ServiceUiMethods, ServicePublicMethods must throw CisiServiceException ServiceImplClasses must have annotation "@XXXRemoteService"

0.5M LOCproject B

14

ClientScoutPackage can only depend on SharedScoutPackage ServerScoutPackage can only depend on SharedScoutPackage, ServicePackage ServicePackage can only depend on BusinessPackage BusinessPackage can only depend on ServicePackage, PersistencePackage FosBatch cannot depend on ForUiImpl FosBatch cannot depend on ForPublicImpl Persistence cannot depend on Service Batch cannot depend on Persistence […]

ModelClasses, DTOClasses must implement interface "java.io.Serializable" ServiceUiMethods, ServicePublicMethods must throw CisiServiceException ServiceImplClasses must have annotation "@XXXRemoteService"

project B analysis: 8 min

27

22

12

7

8

15

Core 1M LOC

16

analysis: 2 minMain project

17

0

5

10

15

20

Dicto

4

19

cycles

Accuracy

0

2

4

6

8

Dicto

2

8

Dependencies

18

Integration

http://ci.ilias.de/

19

Integration

Summary

• Enforce guidelines

• Check NFRs

• Readable & executable specification

20

Persistence cannot depend on Service

Service must have annotation “@Service”

System cannot contain cycles

@ scg.unibe.ch/dicto