Answer the following questions. All homeworks are due before class on the due date. Please remember that the GMU Honor Code is in effect: You may use one of the collaborative options as specified on the syllabus. You may also request help and advice from your classmates on Piazza. Any other help not allowed by that policy will be an honor violation. Bring hardcopies of your answers to class; either hand written or printouts.
Consider the cal() program on page 226 of the Ammann & Offutt book. Note that the source code is available on the book web site. The structure cal() may look very old-fashioned—it uses a 1980s pre-OO style of programming. You should not waste time rewriting it.
Design and develop at least 10 JUnit tests to evaluate the cal() function. Do not develop tests for the main() and the getN() methods. Since cal() has a precondition that excludes almost all invalid inputs, you should focus on normal behavior. Note that “data-driven” tests could be very useful for this assignment.
Create at least one possible fault that you could place into the cal() method that your tests do not find.
Create at least one possible fault that you could place into the cal() method that your tests do find.
Submit the following on paper:
We will grade on several factors.