25
by Lightning Talk @ GraphConnect Europe 26th April 2016 Dirk Mahler, buschmais GbR

GraphConnect Europe 2016 - Pushing the Evolution of Software Analytics with Graphs - Dirk Mahler

Embed Size (px)

Citation preview

by

Lightning Talk @ GraphConnect Europe26th April 2016

Dirk Mahler, buschmais GbR

2

I‘m a Java developer I‘m a human I make mistakes I need fast feedback I use analysis tools in my build chain

They‘re valuable, but…

MavenEnforcer Plugin

PMD

FindBugs

Checkstyle

3

tunnelvision

4

closed set ofrules & metrics

5

opinionated rules

6

low levelof abstraction

7

closeddata models

8

(jQAssistant:Tool)-[:USES]->(neo4j:Graph:Database)

http://jqassistant.org

http://neo4j.org

9

Scan software structures

Store in a database

Execute queries Explore

Add high level concepts

Find constraint violations

Create Reports

Neo4j

10

connectedextensible

natural

11

Maven

CREATES

Project

Web

Artifact

Beans

HAS_INTERCEPTOR

Xml

Java

Type

Java

Method

CONTAINS

DECLARES

Maven

Xml

Java

Provided byplugins

12

accessible

13

(project:Maven:Project)-[:CREATES]->(war:Web:Artifact)

(war)-[:CONTAINS]->(beans:Beans:Xml)

(beans)-[:HAS_INTERCEPTOR]->(type:Java:Type)

(type:Java:Type)-[:DECLARES]->(method:Java:Method)

14

multi dimensional

Maven

Repository

CONTAINS_ARTIFACT

Web

Artifact

Java

Type

CONTAINS

CONTAINS_ARTIFACT

Web

Artifact

Java

Type

CONTAINS

HAS_PREDECESSORHAS_PREDECESSOR

16

concrete&

abstract

17

Type

ClassAnnotation

ANNOTATED_BY

Type

OF_TYPE

Entity

Jpa

MATCH(entity:Type)-[:ANNOTATED_BY]->(annotation),(annotation)-[:OF_TYPE)->(:Type{fqn:"javax.persistence.Entity"})

SETentity:Jpa:Entity

RETURNentity.fqn

Concept

18

MATCH(package:Package)-[:CONTAINS]->(entity:Jpa:Entity)

WHEREpackage.name <> "model"

RETURNpackage.fqn, collect(entity.fqn)

Constraint

19

MATCH(service:Spring:Service)-[:DEPENDS_ON]->(other:Spring:Type)

WHERE NOTother:Serviceor other:Repository // Controller is disallowed

RETURNservice.fqn as Service, collect(other.fqn) as ForbiddenDeps

20

rules = queries

21

[[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)

WHEREpackage.name <> "model"

RETURNentity AS EntityInWrongPackage

----

Asciidoc

22

documentation = rules

23

24

Holistic and extensible view on code structure and systemarchitecture

Exploration of existing structures

Validation of rules using concepts from architecture & design language

Executable architecture and design specification

Mail: [email protected]

Web: jqassistant.org

Twitter: @jqassistant

by