Due Date: Thursday, 13 March
Individual project
Objectives
- Coding tools and conventions
- Eclipse IDE
- Java project organization
- Java coding and documentation standards
- Java language
- Design patterns
- Builder pattern (simple version)
- Iterator pattern
- Adapter pattern
- Decorator pattern
- Testing
- Test-driven development
- Unit testing using JUnit
Description
Code Skeleton/Architecture (10%)
A code skeleton has been set up for you. Check out the project WordOccurrences from the CVS example repository. This will create a project WordOccurrences in your workspace with the following folders:
doc
: documentation generated by javadocsrc
: Java sources for the packagestest
: Java sources for the JUnit testsbin
: compiled Java byte code
You are required to retain the structure of this skeleton. In particular:
- You must not change the given folder hierarchy, nor the public specifications of the interfaces and classes used by the test drivers. You must not change the test drivers either, but you are welcome (and in some cases required) to add your own test drivers.
- You must not print any output from any of the classes (other than during your own testing).
Documentation (10%)
Your project must be documented using javadoc and using inline comments where appropriate.
Document only the code that you added or modified, including any fields you added, then rerun the javadoc wizard from the Eclipse Java perspective as follows:
Project > Generate Javadoc...
types: [x] WordOccurrences
visibility: (x) private
destination: .../WordOccurrences/doc
Functionality (50%)
You are required to complete the functionality of the skeleton.
- Complete the code in the various Java source files within the
src
folder. Look in the Eclipse Tasks view for sections (methods or entire classes) marked as:TODO your job
You are done with this part when your code passes all tests (please see also below on testing).
- Do not make any other changes (other than adding more tests). In particular, you are not allowed to change the various top-level interfaces.
Testing (30%)
In this project, we are using JUnit for unit testing and overall system testing. In the test-first approach we are using here, you focus on one class at a time until it passes all the tests.
For example, while you are working on edu.luc.cs.laufer.cs313.occurrences.DefaultIndexImpl
, you will repeatedly run edu.luc.cs.laufer.cs313.occurrences.TestDefaultIndexImpl
.
You can run the tests using Eclipse's built-in support for JUnit testing. In the Eclipse Package Explorer, right-click on a test class (basically any class in the test folder) or an ancestor node of a test class and choose from the resulting context menu:
Run > Run As > JUnit Test
The test will now run in a special runner you can access through the JUnit tab. The JUnit runner has two tabs: failures and hierarchy. You can make changes to your code and rerun the test by pressing the button with the runner figure again.
In addition, you are required to complete those tests marked as:
TODO your job
(If you are not using Eclipse or any other IDE with support for JUnit, you will have to write your own driver with a main method. The JUnit FAQ explains how to do that; look in this section.)
How to submit
Please refer to the online submission procedure.