Testing things NOT named infer-type....

12 views
Skip to first unread message

Parker J

unread,
Nov 30, 2011, 7:42:56 PM11/30/11
to byu-cs-330...@googlegroups.com
How extensive should tests be for all of the intermediate steps up to the infer-type function?  Do we need to have tons of lines of code testing all of the functionality of alpha-vary, generate-constraints, and unify?  It just seems to me like the tests for generate-constraints and unify could get ridiculously long with writing out all of those lists.  I mean, I know we need to convince ourselves that it works correctly before moving on, but how many tests for each piece do we need in order to convince you that it works correctly?  :)

- Parker and David

Jay McCarthy

unread,
Nov 30, 2011, 8:21:08 PM11/30/11
to byu-cs-330...@googlegroups.com
I find that most people write too few tests that are too large.

I would have one test case for each kind of expression in alpha-vary. One for each kind in g-c, where the sub-expression were trivial (ids). And for unify, you just need to check that each of the five cases is handled.

Jay

On Wed, Nov 30, 2011 at 5:42 PM, Parker J <gado...@gmail.com> wrote:
How extensive should tests be for all of the intermediate steps up to the infer-type function?  Do we need to have tons of lines of code testing all of the functionality of alpha-vary, generate-constraints, and unify?  It just seems to me like the tests for generate-constraints and unify could get ridiculously long with writing out all of those lists.  I mean, I know we need to convince ourselves that it works correctly before moving on, but how many tests for each piece do we need in order to convince you that it works correctly?  :)

- Parker and David



--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Brent Mouritsen

unread,
Dec 1, 2011, 6:22:13 PM12/1/11
to byu-cs-330...@googlegroups.com
is it possible to test the unify in one test case?

Jay McCarthy

unread,
Dec 1, 2011, 6:29:02 PM12/1/11
to byu-cs-330...@googlegroups.com
No because test should be small and help you find problems. This is why "coverage" tools are so bad

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages