Official Coding Period: Week 8 (July 21 - July 27)
As we officially enter the second phase of the coding period, my focus shifted on writing the rest of the pgTAP tests and then moving on to the documentation eventually. This was a tricky task as I’ll mention again, the BGL guide is so minimal, it doesn’t give me enough information to decide which edge cases to exactly test for sloan specifically, for example if it is resulting in the same graph for two disconnected vertices.
I simplified the PREPARE functions for testing according to my mentor’s suggestion so that instead of
-- 0 edge, 0 vertex test
PREPARE iq1 AS
SELECT id, source, target, cost, reverse_cost
FROM edges WHERE id > 18;
PREPARE q1 AS
SELECT * FROM pgr_sloanOrdering('iq1'); < -- this is corrected
this would be much simpler:
PREPARE q1 AS
SELECT * FROM pgr_sloanOrdering(
'SELECT id, source, target, cost, reverse_cost FROM edges WHERE id > 18');
I followed the official pgTAP documentation and made necessary changes and also removed any unneeded tests or marked todo
to unsure test functions.
For testing individually the single vertex, two connected or isolated vertices, I used the Graphviz program, extremely useful for graph visualization!
I was a little unfamiliar with the syntax of the test file, I must admit so I spent considerable time in reading the docs and reviewing a past contributor’s work.
I am however stuck on a problem, while testing for two connected vertices, I am getting an unexpected result: For example if I take this particular edge from the sample data
I get different results for the same graph that is it does not matter if either the node or sequence comes first, hmm that’s interesting. Maybe the tests are not to be run for connected vertices, I ‘ll discuss this with my mentor further.
Also, I’m also back in college and it has been a bit hard to manage my time already TT.