CSc 221 Spring 2007 Homework 4

Due before the beginning of class Tuesday, March 13.   Thursday, March 15  Yes, only a week after HW3, but there is relatively little new material. The HW3 teams will stay together for HW4.

Re-do HW3 with JUnit testing of the correctness of the result. In the "actual" and "expected" notation used in describing JUnit tests, the "actual" is the square or your answer, and the "expected" is just 2. Naturally, we can't expect an exact match for an iterative process that leads to an approximation to an infinitely repeating decimal, so you will have to specify a tolerance, which should be about 10-d, where d is the number of decimal places in your answer. That may be just a little too "tight"; we'll look into that as people start to get results.

More details as we go along, obviously.

ADDED 3.8.2007: Here is a list of all the methods in the Assert class: http://www.junit.org/news/junit/javadoc/3.8.1/index.html At least scan through this, to see what the pattern of parameters is: all the primitive types, plus Strings; where it makes sense there is a version with a delta and one without.

ADDED 3.6.2007: Wouldn't it be boring if the assignment never changed? It would definitely not be realistic. In the real world, all to often work must begin before there are any written specifications. We don't encourage such behavior by clients, but  it happens.

In this case I am your client . . . so things change before they have ever been written down. (I am doing this for your benefit, of course.) Homework 4 comes in two flavors: if your team number is an odd number, you do the JUnit testing thing. Even-numbered teams try to speed up the calculation of the approximation to the square root of 2 by greatly speeding up the division of the numerator by the denominator. Come to class.

The due date is still Tuesday, March 13. so you absolutely have to start on the HW before class on Thurs March 8, so you can have questions. And the first midterm--which will include questions on both parts of HW4, is  still scheduled for Thurs March 15. (You can do this. The midterm questions on JUnit testing will be simple.)

Check out the Darwin quote on the homepage. (Is what I am doing to you here a fair example of what Darwin meant by "change"?)

 

Back to the top of the Spring 2007 CSc 221 page

Back to Dan McCracken's Home Page