carocad / data.hypobus

GNU Lesser General Public License v3.0
0 stars 0 forks source link

create generative test for routing algorithms #10

Open carocad opened 7 years ago

carocad commented 7 years ago

It can be fairly complicated to get a routing algorithm right specially if it is suppose to remain flexible to what values it might contain. The current solution to similar problems in the functional languages environment is called generative testing.

It basically allows a computer to generate test cases based on properties that the function should fulfill. For example: return the same output given the same input.

If we want to keep a stable yet flexible implementation I think it is important to have at least some base properties covered up so that we can rely on them rather than doing manual testing (how I was doing it).

I think we should restrict the testing to single-edge directed graph since those are the ones that we are interested in for OSM routing.

Right now I can think of the following properties for a routing algorithm using Dijkstra's solution:

OPTIONAL (these are a bit more complicated so we can postpone them)

References: