Test cases in the codebase

[no guarantees that the following is 100% accurate, but it is pretty close]

Good news: There are 822 unique *.dot and *.gv files in the codebase

There are 822 unique *.dot and *.gv files in the codebase
There are 717 unique *.dot and *.gv files under the 'tests' directory

Less good: some attributes are used in only a few of the files. For example:

Count   with
of      this
files   object / attribute

23      graph / ordering
18      edge / weight
11      edge / constraint
3       node / xlabel
2       node / group
1       node / ordering
1       graph / overlap
1       graph / layersep
1       edge / xlabel
0       graph / sep
0       graph / overlap_shrink
0       graph / overlap_scaling
0       graph / esep

So what?
100% coverage is probably not needed, but over time we should probably add files that use some of the infrequently referenced attributes.
If anyone has a wishlist, I can probably find / build files to fill your request.

The entire list:



Count   with
of      this
files   object / attribute

516	node / label
482	node / shape
436	node / width
431	node / height
366	graph / bb
223	cluster / label
204	node / style
204	graph / label
193	graph / rankdir
162	node / color
131	graph / size
129	cluster / labelloc
127	edge / label
125	cluster / bb
111	graph / lp
111	cluster / labeljust
110	node / fontname
110	cluster / lp
108	edge / color
106	node / fontsize
85	edge / headport
81	edge / tailport
78	subgraph / rank
70	edge / style
62	graph / splines
60	edge / fontsize
58	node / fontcolor
58	edge / arrowhead
57	graph / labeljust
55	edge / dir
54	graph / labelloc
53	edge / fontname
52	graph / fontsize
51	node / fillcolor
49	graph / ranksep
49	graph / fontname
42	graph / nodesep
37	edge / lp
36	cluster / style
32	cluster / color
31	node / URL
31	graph / ratio
31	edge / fontcolor
29	edge / arrowsize
26	graph / bgcolor
26	edge / arrowtail
25	node / rects
25	cluster / fontsize
25	cluster / fontname
23	graph / ordering
23	graph / fontcolor
20	node / margin
19	node / image
19	graph / compound
19	edge / headlabel
19	cluster / bgcolor
18	node / sides
18	edge / weight
17	node / distortion
16	node / peripheries
16	node / orientation
16	graph / page
16	graph / concentrate
16	edge / taillabel
15	edge / minlen
15	edge / labeldistance
15	cluster / fontcolor
14	edge / ltail
13	node / skew
13	edge / lhead
12	graph / style
12	cluster / fillcolor
11	edge / samehead
11	edge / constraint
10	node / labelloc
10	edge / penwidth
9	graph / pack
9	graph / orientation
9	graph / layout
9	graph / charset
9	graph / center
9	edge / sametail
8	node / href
7	node / penwidth
7	node / gradientangle
7	node / fixedsize
7	edge / headclip
7	cluster / margin
6	graph / newrank
6	graph / lwidth
6	graph / lheight
6	graph / imagepath
6	graph / dpi
6	edge / id
5	node / tooltip
5	graph / packmode
5	edge / tailclip
5	edge / tail_lp
5	edge / labelangle
5	edge / head_lp
4	node / regular
4	node / id
4	node / class
4	cluster / penwidth
3	node / xlabel
3	node / target
3	node / layer
3	graph / pad
3	graph / nslimit1
3	graph / layers
3	graph / URL
3	edge / layer
3	edge / labelfontsize
3	edge / decorate
3	edge / class
3	edge / URL
3	cluster / peripheries
3	cluster / cluster
2	node / nojustify
2	node / imagescale
2	node / group
2	node / colorscheme
2	graph / tooltip
2	graph / outputorder
2	graph / margin
2	graph / id
2	edge / tooltip
2	edge / len
2	edge / labelfontcolor
2	cluster / id
2	cluster / class
1	node / shapefile
1	node / ordering
1	graph / xdotversion
1	graph / stylesheet
1	graph / showboxes
1	graph / rotate
1	graph / remincross
1	graph / overlap
1	graph / nslimit
1	graph / model
1	graph / mode
1	graph / layersep
1	graph / gradientangle
1	graph / forcelabels
1	graph / beautify
1	graph / TBbalance
1	edge / xlabel
1	edge / tailtooltip
1	edge / tailURL
1	edge / nojustify
1	edge / labelURL
1	edge / headtooltip
1	edge / headURL
1	edge / edgetooltip
1	edge / colorscheme
1	cluster / tooltip
1	cluster / pencolor
1	cluster / gradientangle
1	cluster / colorscheme
1	cluster / URL
0	subgraph / cluster
0	node / z
0	node / xlp
0	node / vertices
0	node / sortv
0	node / showboxes
0	node / samplepoints
0	node / root
0	node / pos
0	node / pin
0	node / imagepos
0	node / comment
0	node / area
0	node / Attributes
0	graph / voro_margin
0	graph / viewport
0	graph / truecolor
0	graph / target
0	graph / start
0	graph / sortv
0	graph / smoothing
0	graph / sep
0	graph / searchsize
0	graph / scale
0	graph / rotation
0	graph / root
0	graph / resolution
0	graph / repulsiveforce
0	graph / quantum
0	graph / quadtree
0	graph / pagedir
0	graph / overlap_shrink
0	graph / overlap_scaling
0	graph / oneblock
0	graph / notranslate
0	graph / normalize
0	graph / nojustify
0	graph / mindist
0	graph / mclimit
0	graph / maxiter
0	graph / linelength
0	graph / levelsgap
0	graph / levels
0	graph / layerselect
0	graph / layerlistsep
0	graph / landscape
0	graph / label_scheme
0	graph / inputscale
0	graph / href
0	graph / fontpath
0	graph / fontnames
0	graph / esep
0	graph / epsilon
0	graph / diredgeconstraints
0	graph / dimen
0	graph / dim
0	graph / defaultdist
0	graph / comment
0	graph / colorscheme
0	graph / clusterrank
0	graph / class
0	graph / _background
0	graph / K
0	graph / Damping
0	graph / Attributes
0	edge / xlp
0	edge / target
0	edge / tailtarget
0	edge / tailhref
0	edge / showboxes
0	edge / pos
0	edge / labeltooltip
0	edge / labeltarget
0	edge / labelhref
0	edge / labelfontname
0	edge / labelfloat
0	edge / href
0	edge / headtarget
0	edge / headhref
0	edge / fillcolor
0	edge / edgetarget
0	edge / edgehref
0	edge / edgeURL
0	edge / comment
0	edge / Attributes
0	cluster / target
0	cluster / sortv
0	cluster / nojustify
0	cluster / lwidth
0	cluster / lheight
0	cluster / layer
0	cluster / href
0	cluster / area
0	cluster / K
0	cluster / Attributes

As I extol repeatedly on here, please contribute any and all test cases you have. We are not space-constrained here.

OK, I’ll get on it. I have some questions:
As a guess, I have ~4000 .gv files not already in the codebase.

  • would you really want them all?
  • maybe 25% are variations of some starting graph, many not an improvement. what good in sharing?
  • maybe 10% reference images
    • do you want me to provide images (not a problem)
    • any particular format - or some of each?
    • where (what directory) should the images be referenced (current directory, images.d, image_dir, images, …)
  • hundreds(?) cause warnings and/or errors. Dozens(?) cause aborts or “never” finish (see Graphviz / dot performance test cases · GitHub and Graphviz / dot init_rank tests init_rank_tests_README.md · GitHub). Do you want these also?
  • would you like them annotated (in comments) in any way - by gvstats.gvpr and/or gvlint.gvpr, or any manual comments I wanted to add?
  • What are the expected uses of these files? (just curious)
  • Should there be an easy (easy-ish) way for “others” (end users, developers, or chat-bots)
    • to access them?
    • to contribute their own files?
  • How can I make the file transfer(s)? I am pretty useless when it comes to git; though I can sometimes follow clear instructions. I’d like to make it pretty easy for me and you, as I may want to make more contributions and don’t want to piss-off the development team. (can I drop them off in my local supermarket used clothing dropbox?)

If you can describe some correctness condition about them that you want to preserve, yes.

I don’t know. Kind of impossible to know without seeing them. If you think there’s no point in sharing them, then don’t share them. I leave this judgement to you.

tests/test_rtest.py has infrastructure towards this kind of testing. Admittedly most of it is disabled, but any contributions towards reenabling this would be welcome.

You mean they provoke bugs? If so, please report them as Gitlab issues.

Then we probably want to make these available for profiling. See tests/compare_performance.py.

Again, kind of impossible to know without seeing them. If they are completely opaque, both in content and purpose, then their value is limited.

To try to avoid regressions. Future changes will almost inevitably (silently) break anything that isn’t tested. If you like it, then you should of put a ring (test case) on it.

I’m not sure what you mean. The Graphviz Gitlab repository is public and accepts Merge Request from anyone and everyone. If there’s a more open way to access and/or contribute test cases, I am not aware of it.

Gitlab Merge Requests. Admittedly this involves signing up for Gitlab, but I do not know any better way of accepting this kind of stuff. (Sorry, I am not willing to be emailed these kind of files).