SWE 437 Homework 2
Spring 2017
JUnit


Consider the cal() progam on page 226 of the Ammann/Offutt text. Note that the code is available online at the book web site.

Develop at least 10 JUnit tests to evaluate the cal() function only; ignore the main method. Since there is a precondition excluding basically all invalid inputs, you should test normal behavior only. Note that "data-driven" tests are probably the best fit for the required tests.

Identify at least one possible fault that you could install into the cal() method that your tests do not find.

Identify at least one possible fault that you could install into the cal() method that your tests do find.

Turn in a brief write-up (several paragraphs) along with your JUnit. Your write-up should give an assessment of your test set as well as the faults required.

Turn in this assignment on Blackboard. For credit, the GTA will need to be able to run your tests.

Grading criteria:

Note: cal() is written in the 1970's style of functional programming. You might think about what cal() would look like in a OO context.