summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Robinson <kc@rampantmonkey.com>2014-01-19 23:31:08 -0500
committerCasey Robinson <kc@rampantmonkey.com>2014-01-19 23:31:08 -0500
commit28254ad2110f24ef388ba2ee3204483fe7038e83 (patch)
treebe1e6e8a2a457a063ed02ec0622cbf56f485777c
parent686c7da1c11691e5769c91310dda48c4eee5ced8 (diff)
downloadneighborhoods-28254ad2110f24ef388ba2ee3204483fe7038e83.tar.gz
neighborhoods-28254ad2110f24ef388ba2ee3204483fe7038e83.tar.bz2
neighborhoods-28254ad2110f24ef388ba2ee3204483fe7038e83.zip
discussion about testing strategiesHEADsubmissionmaster
-rw-r--r--doc/intro.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/intro.md b/doc/intro.md
index fb7e56a..06aa446 100644
--- a/doc/intro.md
+++ b/doc/intro.md
@@ -33,6 +33,25 @@ The linear search will on average require checking `n/2` neighborhoods, where `n
Since it forms the basis of the other approaches, this is the method currently implemented in `neighborhoods`.
In the discussion section, I mention a method for reducing this number with preprocessing.
+## Testing
+
+`neighborhoods` was developed following test driven development, so growing the testing suite was crucial to success.
+There are three main sections of the testing code: computational geometry internals, neighborhood processing, and the interface between the two.
+The computational geometry internals are tested with a few examples for each function with a mix between positive and negative expected results.
+
+The interface is tested by creating a polygon with specific features (concave and convex corners), choosing points by hand that correspond to interesting locations (where interesting is defined as 'potential trouble for the geometry').
+A graphical representation of the polygon and test points is provided below.
+Red points are outside and green are inside.
+A [gnuplot](http://www.gnuplot.info/) script is provided to regenerate the image if different data points are desired.
+The data is stored in [test/data](../test/data) and is accessed by both the testing framework and the plotting script.
+
+![polygon test](example_polygon.png)
+
+Processing of the neighborhood data is handled by running the entire program with the filenames for the Grand Rapids data as parameters (just as it would be called from the command line).
+The output is captured with my favorite Clojure function to date, `with-out-str`, and compared against expected results.
+
+These three groups of tests cover the ['happy path'](http://xunitpatterns.com/happy%20path.html) through `neighborhoods`.
+
## Discussion
There are many options for improving the performance of the approach implemented in neighborhoods.