Developing a Codec: Test driven development
-------------------------------------------
The heard of this program is the codec which can create a graph in neo4j from a mxGraph input file.
An example for a mxGraph:
.. code-block:: none
The GraphML format
..................
The coded can also transform the arbitrary mxGraph format to the open GraphML standard,
which looks like this:
.. code-block:: none
Token
ros
no
ital
NPR
ult
spr
4
2
1
Hand 1
180
10
120
60
geometry
token
1
wrap
#FFFFFF
50
1
How can we verify that the codec works as wanted?
.................................................
Verification is always difficult. Because the codec is a input-output program without sideeffects
testing can be seen as an appropriate way.
In order to make sure that the tests make sense and the coverage is high Test Driven Development (TDD)
was employed.
What is the biggest XML file it can transform
.............................................
The codec is not optimized to work on big files but a few thousand elements with even more attributes are
possible. Increasing the performance of the codec can be achieved easily.
Batch-add (+checksum)
.....................
By clicking on the "Batch-add"-Button all fragments are checked whether they have changed or not.
Only if they have changed they are updated in the database.
A SHA1 hash from the file original mxGraph XML file is stored every time one of these files is
transferred to the database.