Assignment 4: "But it works..." Due Wednesday July 14 at 9:00pm

Programs have to operate correctly but they must meet other goals, too...

This week you will be primarily writing reports about code, rather than writing new code itself.


All files (java, test data, documentation, etc.)

PART I:
Since the beginning of this course we've mentioned the importance of programming "practice" as well as program correctness (later in the course we'll take up  efficiency in a systematic way, too).   Exactly what defines "good" programming practice?  Sometimes  there will be informal  understandings, and other times there will be written expectations.  An example of the latter  are the Sun Microsystem's Coding Conventions for Java Programmers.

First, browse that document to get familiar with it.  As you do, see if you can spot differences between your own style and what that standard recommends.

Then take a look at a sample solution to Project 2 that we will post (in the directory with all the other files).  Go through the solution files (the ones that had to be turned in for the project).  Write a critique of the programming practice of those files.  That is, point out areas where there are discrpepancies, and/or areas where the code of the solution aheres to the standard.  Your critique should be between one paragraph and one page in length.

Part II:
We have talked about several ways to document expected program behavior, and to detect and report errors.  Look at the code for the package textfile (which among other classes contains the DelimitedTextFile you have used in the projects).   In particular, look at where, how, and why it uses 1) exceptions and 2) asserts.  See if you can patterns in where each is used.   Write a report (a paragraph to a page in length) describing and critiquing the use of these constructs in the textfile package.

Part III:
Take a look at your own solution to Project 3.  Critique it from a coding style point of view (as in Part I).  Also, consider when and how you might have used exceptions and/or asserts in the solution (as in Part II).   Write a paragraph or two on each.

Part IV:
Testing is another tool to help achieve good software.   Write code to test the method you saw last week in quiz section.  You are not asked to implement the method -- only to write a good test for it.  A good test would find any errors that existed in any implementation of the method.  Write your test as a JUnit test case, with a public method called testMethod().  You are free to write other (helper) methods if you wish, but we will run testMethod to evaluate your test.

KHand in the files electronically by the due date at the top of this page. 
Get started early and have fun!