Dicto - industrial presentation 2
-
Upload
andrea-caracciolo -
Category
Technology
-
view
179 -
download
0
Transcript of Dicto - industrial presentation 2
![Page 1: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/1.jpg)
DICTO Architecture Conformance Checking
Andrea Caracciolo
Die Mobiliar - June ‘15
http://scg.unibe.ch/dicto
![Page 2: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/2.jpg)
Architecture Compliance
2
=Design Code/
![Page 3: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/3.jpg)
Architecture Compliance
3
=Design Code/
![Page 4: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/4.jpg)
Quality Monitoring
011010
![Page 5: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/5.jpg)
011010
Architectural Rules+
Quality Monitoring
![Page 6: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/6.jpg)
Quality Monitoring
诶
Б
011010
![Page 7: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/7.jpg)
Quality Monitoring
诶
Б
011010
![Page 8: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/8.jpg)
Quality Monitoring
011010
Persistence cannot depend on Service
Service must have annotation "@Service"
System cannot contain cycles
Rules
![Page 9: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/9.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/10.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/11.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/12.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/13.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/14.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/15.jpg)
15
project B
![Page 16: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/16.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/17.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/18.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/19.jpg)
19
System cannot contain cycles
0
5
10
15
20
Dicto
4
19
cycles
Dicto vs. SonarQube
![Page 20: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/20.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/21.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/22.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/23.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/24.jpg)
24
![Page 25: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/25.jpg)
25
![Page 26: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/26.jpg)
New Issue
![Page 27: Dicto - industrial presentation 2](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/27.jpg)
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](https://reader031.fdocumento.com/reader031/viewer/2022021813/587a54671a28ab520b8b509f/html5/thumbnails/28.jpg)
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