retest / gui-state-machine-api

API for the creation and modification of incomplete state machines which represent the exploration of a GUI application.
2 stars 1 forks source link

Use Neo4J backend #19

Closed tdauth closed 5 years ago

tdauth commented 5 years ago

See #5 for the investigation of GraphDBs.

Neo4J allows transactions which provide concurrency support. It can also visualize the state machines/graphs.

Labels group nodes together, so a SutState is not really a label. An action type can be a label.

Some information about OGM:

We store only the hashes and some additional information of the SutStates and actions in the graphdb. Otherwise, it would be an antipattern. Note that we need to use the Bolt protocol to utilize most of the tools for visualization and management. Embedded databases are useful for storage only.

Open questions:

beatngu13 commented 5 years ago

The question is also: Do we drop the in-memory representation of the SUT model as soon as we have the DB backend?

beatngu13 commented 5 years ago

Regarding the node content, BLOBs seem to be an anti-pattern:

If you have to deal with BLOB data, choose an appropriate store for that use case and use Neo4j to store the URL that points you to the binary data.

This is also what @martin-v suggested, to only reference the state in Neo4j and store the actual data somewhere else, e.g., a key-value store.

The question is: How can we deterministically derive a unique ID from the state data that can be used as a reference. This also heavily depends on the upcoming artifact storage.

For now, we decided to go with a filtered textual representation of the state in Neo4j.

tdauth commented 5 years ago

We have to use Scala 2.11.x https://github.com/neo4j/neo4j/issues/8832

For visualization we could use the desktop tool or convert the graph into a .dot file: https://gist.github.com/peterneubauer/2652082

beatngu13 commented 5 years ago

Side note: Neo4j is licensed under GPLv3. So if we use Neo4j, we have to check what surili components need a compatible license.

beatngu13 commented 5 years ago

From https://neo4j.com/licensing/:

We chose GPL [v3] because it means that Neo4j Community Edition can be used for free with your project: whether in the cloud or behind the firewall. If you’re building an application that accesses a Neo4j database running inside your organization (or on any personal device), then you are free to use Community Edition, whether or not your software is closed source.

Sounds good, but the questions is also does the CE include everything we need?

tdauth commented 5 years ago

https://neo4j.com/subscriptions/#editions

Maybe better abstraction with http://tinkerpop.apache.org/

tdauth commented 5 years ago

Documented advantages vs disadvantages. Simple database like PostgreSQL or SQLite would be sufficient. If we really need advanced features from Neo4J, we can still use it in the future.