Homework 6: Unit testing
2013-02-26
Mar 6, 11:59PM
Working in your repository from
185 HW3, work on the project in:
homework/185/unit-testing
, and follow the directions below.
Then commit your work, push to your Bitbucket account, and email me when you're
done, with subject CSC 185 HW6.
You should first pull in the updates I've made to the main course
repository. To do that, within your local copy run: hg fetch
https://bitbucket.org/jlepak/csc-2013-spring
. That will download all
the updates I've posted to my copy, including the unit-testing
project.
Define unit tests for the intersects
method in the
Geometry
class Try to think of all the possible ways for two line segments to
intersect (or not intersect), and test to make sure they're handled correctly.
You should find at least one bug in the method.
You can define tests either in the main method, or in the separate unit test file.
Optional: fix the method so that it handles all cases properly.