JUnit Test

1 view
Skip to first unread message

Yiwei

unread,
Nov 28, 2010, 9:20:01 PM11/28/10
to Cornell CS 2110
What are we supposed to test in the JUnit to earn extra credit on
that? It seems that we have no access to maps and stuffs.
Is that ok to test for the graph algorithms that we used? Or are we
supposed to test for the run method?

Thank you.

Lonnie Princehouse

unread,
Nov 28, 2010, 10:49:32 PM11/28/10
to cornell...@googlegroups.com
Here's my response to a very similar question I was asked via email:

Hm. That's a good question. You're right that the setup we gave you doesn't really lend itself to JUnit testing.

As you've probably realized, in order to have a high-scoring naturalist, you need to capture your own representation of the graph so that you can run algorithms that need global knowledge, e.g., path-finding.  If you make your graph algorithms suitably generic (using type parameters instead of a fixed Node class), you could make individual JUnit tests that test those algorithms on fixed graphs that you create, using your own version of the Node class.

You could also invoke Simulator.main from inside a JUnit test, for example on running on custom maps to make sure the naturalist works on maps with strange topologies.


--
You received this message because you are subscribed to the Google Groups "Cornell CS 2110" group.
To post to this group, send email to cornell...@googlegroups.com.
To unsubscribe from this group, send email to cornell-cs211...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cornell-cs2110?hl=en.


Reply all
Reply to author
Forward
0 new messages