java user group darmstadt 11/2015 dirk mahler analysis using... · analysis of software systems...
TRANSCRIPT
![Page 1: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/1.jpg)
by
Java User Group Darmstadt11/2015
Dirk Mahler
![Page 2: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/2.jpg)
2
jQAssistant Software As A Graph About Structures, Rules and Code Verifying Rules With The Graph Model Wrap Up Q&A
![Page 3: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/3.jpg)
Software Analysis Using jQAssistant And Neo4j
3
![Page 4: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/4.jpg)
4
http://jQAssistant.org
Open Source: GPLv3
Current release: 1.0.0 (1.1.0-RC2) initiated: 03/2013 first stable release: 04/2015
Neo4j Community Edition http://neo4j.org embedded, no installation necessary
![Page 5: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/5.jpg)
5
The Idea Scan software structures
Store in a database
Execute queries Explore
Add high level concepts
Find constraint violations
Create Reports
Database
Find all…
![Page 6: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/6.jpg)
6
Command Line/
Maven
Scan
Analyze
Report
Plugins
Plugins
Plugins
![Page 7: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/7.jpg)
7
Available scanner plugins
Plugin API is public
*.class
RDBMS Schema
GitJaCoCo
FindBugsCheckStyle
LiquibaseJAR, WAR, EARZIP
application.xmlweb.xml
MANIFEST.MF /META-INF/services/*
beans.xml
pom.xml surefire-reports.xml
GZ
*.properties
*.xsd
M2 Repository
*.yaml
![Page 8: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/8.jpg)
8
Getting Started – Command Line
unzip jqassistant.distribution-1.0.0.zip cd jqassistant.distribution-1.0.0/bin
jqassistant.sh scan –f model.jar jqassistant.sh scan –f acme.war jqassistant.sh scan –f acme.ear jqassistant.sh scan –u http://somewhere.com/acme.ear jqassistant.sh scan –u maven:repository::http://host/releases
jqassistant.sh scan –u rdbms:schema::jdbc:oracle:thin:user/secret@host:1521:sid
jqassistant.sh server http://localhost:7474
![Page 9: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/9.jpg)
9
Getting Started – Maven Project
<build><plugins><plugin>
<groupId>com.buschmais.jqassistant.scm</groupId><artifactId>jqassistant-maven-plugin</artifactId><version>1.0.0</version>
</plugin></plugins>
</build>
mvn install jqassistant:scan mvn jqassistant:server
![Page 10: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/10.jpg)
Software Analysis Using jQAssistant And Neo4j
10
![Page 11: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/11.jpg)
11
All we need is… Nodes Labels Properties Relationships
Modeling is just… Taking a pen Drawing the structures on a whiteboard (i.e. the database)
We don‘t need… Foreign keys Tables and schemas Deep knowledge in graph theory
Type
EXTENDSfqn:org.springframework.samples.
petclinic.model.Owner
![Page 12: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/12.jpg)
Project
Artifact
Maven
CONTAINS
Package
name:org
CONTAINS
Package
name:springframework CONTAINS
Package
name:petclinic
Package
CONTAINS
name:model
name:petclinic
CONTAINS
Package
name:samples
CREATES
![Page 13: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/13.jpg)
RETURNS
READS
Field
DECLARES
name:address
Package
name:model
Class
Type
CONTAINS
fqn:org.springframework.samples.petclinic.model.Person
name:Person
Annotation
ANNOTATED_BY
Type
OF_TYPEfqn:javax.persistence.MappedSuperclass
Type
EXTENDS
Class
fqn:org.springframework.samples.petclinic.model.Owner
name:Owner
Type
OF_TYPE
fqn:java.lang.String
DECLARES
Method
name:getAddress()
Annotation
ANNOTATED_BY
Type
OF_TYPEfqn:javax.persistence.Entity
![Page 14: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/14.jpg)
14
TypeType
Class
EXTENDS
Explore an application using queries Which class extends from another class?
Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
![Page 15: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/15.jpg)
15
TypeType
Class
EXTENDS
Explore an application using queries Which class extends from another class?
Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
()-[]->()
![Page 16: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/16.jpg)
16
C2Type
C1Type
Class
EXTENDS
Explore an application using queries Which class extends from another class?
Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
(c1)-[]->(c2)
![Page 17: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/17.jpg)
17
C2Type
C1Type
Class
EXTENDS
Explore an application using queries Which class extends from another class?
Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
(c1)-[:EXTENDS]->(c2)
![Page 18: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/18.jpg)
18
Explore an application using queries Which class extends from another class?
Let‘s convert this to ASCII art… () as nodes
-[]-> as directed relationships
(c1:Class)-[:EXTENDS]->(c2:Type)
C2Type
C1Type
Class
EXTENDS
![Page 19: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/19.jpg)
19
Explore an application using queries Which class extends from another class?
Pattern matching is the core principle of Cypher
MATCH(c1:Class)-[:EXTENDS]->(c2:Type)
RETURNc1.fqn, c2.fqn
C2Type
C1Type
Class
EXTENDS
![Page 20: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/20.jpg)
Software Analysis Using jQAssistant And Neo4j
20
![Page 21: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/21.jpg)
Analysis of software systems using jQAssistant and Neo4j
21
![Page 22: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/22.jpg)
22
Sketch of an architecture
![Page 23: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/23.jpg)
23
Sketch of an architecture
My Big Fat Demo Application
![Page 24: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/24.jpg)
24
Sketch of an architecture Business modules
Shopping CartUsermanagement
![Page 25: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/25.jpg)
25
Sketch of an architecture Allowed dependencies between business modules
Shopping CartUsermanagement
![Page 26: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/26.jpg)
26
Sketch of an architecture Technical layering
JSF-UI REST
Business Logic
Persistence
JSF-UI REST
Business Logic
Persistence
![Page 27: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/27.jpg)
27
Sketch of an architecture Allowed dependencies between technical layers
JSF-UI REST
Business Logic
Persistence
JSF-UI REST
Business Logic
Persistence
![Page 28: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/28.jpg)
28
Sketch of an architecture Allowed dependencies between business modules and
technical layers
JSF-UI REST
Business Logic
Persistence
JSF-UI REST
Business Logic
Persistence
![Page 29: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/29.jpg)
29
Sketch of an architecture Allowed dependencies between business modules and
technical layers
JSF-UI REST
Business Logic
Persistence
JSF-UI REST
Business Logic
Persistence
![Page 30: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/30.jpg)
30
Sketch of an architecture Abstraction between layers (API vs. Implementation)
JSF-UI REST
Business Logic
Persistence
JSF-UI REST
Business Logic
Persistence
![Page 31: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/31.jpg)
31
Sketch of an architecture Forbidden dependency
JSF-UI REST
Business Logic
Persistence
JSF-UI REST
Business Logic
Persistence
![Page 32: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/32.jpg)
32
Sketch of an architecture Allowed external dependencies per layer
JSF-UI REST
EJB
JPA
JSF-UI REST
Business Logic
Persistence
![Page 33: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/33.jpg)
Translation of architecture rules into a projectstructure Java language element: Package
org.jqassistant.demo
33
![Page 34: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/34.jpg)
Translation of architecture rules into a projectstructure Java language element: Package
Definition of business modules on „top level“
34
Shopping Cart„org.jqassistant.demo.cart“
Usermanagement„org.jqassistant.demo.user“
![Page 35: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/35.jpg)
35
Translation of architecture rules into a projectstructure Java language element: Package
Technical layers …demo.cart.ui
…demo.cart.rest
…demo.cart.logic
…demo.cart.persistence
JSF-UI REST
Business Logic
Persistence
![Page 36: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/36.jpg)
36
Translation of architecture rules into a projectstructure Java language element: Package
Technical layers …demo.cart.ui
…demo.cart.rest
…demo.cart.logic.api
…demo.cart.logic.impl
…demo.cart.persistence.api
…demo.cart.persistence.impl
JSF-UI REST
Business Logic
Persistence
![Page 37: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/37.jpg)
37
Package Names All packages in a Maven module must be prefixed with
${groupId}.${artifactId}
Example:groupId=org.jqassistantartifactId=demo
=> org.jqassistant.demo
![Page 38: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/38.jpg)
38
Class Names Message Driven Beans must have a suffix „MDB“.
![Page 39: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/39.jpg)
39
Class location JPA entities must be located in „model“ packages.
![Page 40: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/40.jpg)
40
Test design Every test method must contain at least one assertion.
Each assertion must provide a human readable message.
![Page 41: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/41.jpg)
41
Abstraction Remote APIs must be interfaces declaring only primitives or
immutables as parameter or return types.
OSGi-Bundles must only export dedicated API packages.
![Page 42: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/42.jpg)
42
Source CodeJava, Properties,
XML, YML
Complexity ErosionMaintainability
„Code Quality“
![Page 43: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/43.jpg)
43
Source CodeJava, Properties,
XML, YML
PeopleArchitect, Developer,
Test
DocumentationUML, Wiki, readme.txt
ToolsCompiler, Static Code
Analysis, CI
![Page 44: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/44.jpg)
44
Source Code – Abstraction levels
Folder, FileFile System
Package, Class, Field, Method, AnnotationJava
Abstraction, Immutable, FactoryDesign
Module, Layer, DependencyArchitecture
![Page 45: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/45.jpg)
45
Source Code – Automated validation
Folder, FileFile System
Package, Class, Field, Method, AnnotationJava
Abstraction, Immutable, FactoryDesign
Module, Layer, DependencyArchitecture
![Page 46: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/46.jpg)
46
Java elements represent higher level concepts Package Module
Annotated Class Entity
Constraints apply to these concepts JPA entities must be located in „model“ packages
![Page 47: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/47.jpg)
47
Concepts and Constraints How to make them visible?
Is there a language to describe them?
![Page 48: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/48.jpg)
Software Analysis Using jQAssistant And Neo4j
48
![Page 49: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/49.jpg)
49
Analyze Execution of rules Defined in AsciiDoc or XML documents
Concepts Enrich data model
Constraints Detect violations
Group Allow different execution profiles
![Page 50: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/50.jpg)
50
ConstraintGroup
Concept ConceptConcept
Includes
Requires Requires
Requires
![Page 51: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/51.jpg)
51
Concept
== JPA Entities
[[jpa2:Entity]].Labels all types annotated with @javax.persistence.Entity with Jpa and Entity.[source,cypher,role=concept]----MATCH(t:Type)-[:ANNOTATED_BY]->()-[:OF_TYPE]->(a:Type)
WHERE a.fqn ="javax.persistence.Entity"SET t:Jpa:Entity
RETURN t AS Entity----
![Page 52: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/52.jpg)
52
Concept
Entity
JpaType
Class
fqn:org.springframework.samples.petclinic.model.Owner
name:Owner
Annotation
ANNOTATED_BY
Type
OF_TYPEfqn:javax.persistence.Entity
![Page 53: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/53.jpg)
53
Constraint
[[model:JpaEntityInModelPackage]]
.All JPA entities must be located in packages named "model".
[source,cypher,role=constraint,requiresConcepts="jpa2:Entity"]
----
MATCH
(package:Package)-[:CONTAINS]->(entity:Jpa:Entity)
WHERE
package.name <> "model"
RETURN
entity AS EntityInWrongPackage
----
![Page 54: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/54.jpg)
54
Group
[[default]][role=group,includesConstraints="model:JpaEntityInModelPackage"]== Naming Rules
The following naming rules apply:- <<model:JpaEntityInModelPackage>>
![Page 55: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/55.jpg)
55
AsciiDoc Wiki syntax
Rendering to
DocBook
HTML
Executable specification
Coding rules
Design & Architecture
![Page 56: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/56.jpg)
Software Analysis Using jQAssistant And Neo4j
56
http://github.com/buschmais/spring-petclinic
![Page 57: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/57.jpg)
Software Analysis Using jQAssistant And Neo4j
57
![Page 58: Java User Group Darmstadt 11/2015 Dirk Mahler Analysis Using... · Analysis of software systems using jQAssistant and Neo4j 21. 22 Sketch of an architecture. 23 Sketch of an architecture](https://reader035.vdocuments.mx/reader035/viewer/2022081406/5f0dd8147e708231d43c5df5/html5/thumbnails/58.jpg)
58
Benefits Of Using A Graph Database
Easy modeling natural language
low technical „noise“
Flexible and extensible Schema defined per node by its labels
Different aspects of software in the same database
Enables plugin architecture
Enrichment by queries (e.g. abstractions)
Expressive queries (Open-)Cypher