Due Date: Thursday, 13 March
- Coding tools and conventions
- Java language
- Design patterns
- Builder pattern (simple version)
- Iterator pattern
- Adapter pattern
- Decorator pattern
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 javadoc
src: Java sources for the packages
test: Java sources for the JUnit tests
bin: 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).
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
You are required to complete the functionality of the skeleton.
- Complete the code in the various Java source files within the
srcfolder. 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.
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
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
How to submit
Please refer to the online submission procedure.