Parameterized Classes
1 Purpose
The primary purpose of this assignment is to help you review (and
demonstrate that you have acquired) the knowledge and skills
required to use parameterized classes in Java. There is
no network programming in this assignment.
2 Overview
You have already done some work for
KitchIntel, a (fictitious)
company that intends to simplify and improve all aspects of the
"kitchen experience" (including the purchase of food and materials,
meal preparation, and waste disposal).
Unfortunately, as is often the case when using Scrum
(because it is a lightweight process and not much time is devoted to design
at the start of the effort), the team has discovered a weakness
with the original design.
The team changed the design at the last sprint planning meeting,
and you must refactor your code accordingly.
(This is, in fact, a refactoring, because the external behavior of the
code is not being changed, just its internal structure.)
3 Preparatory Tasks
If you are not using a code management system (e.g., Subversion,
Git, Mercurial) then you should probably create a new project for
this assignment, and copy all of your existing code into it, since
you may need to go back to the original code at some point.
4 Documents
During the sprint planning meeting you took notes that, you think,
contain everything you need to proceed.
In case you lost them, they are
available here:
Notes from the Sprint 2 Planning Meeting
5 Tasks
You must refactor all of the classes and interfaces that require it.
In addition, you must update your unit test suite as necessary.
Your JUnit test suite must, again, cover all statements and all
branches (as measured by EclEmma) Your tests must be in a package
named testing
and each test class must include the word
"Test" in its name.
When compiled (e.g., from the command line using javax -Xlint
),
your code must not generate any "raw type" warnings. In other words, your
solution must be type safe.
6 Submission
You must submit (using
Autolab) a
.zip
file
named pa2.zip
that contains:
- Your implementation of the required interfaces/classes
in the appropriate package(s).
- JUnit tests for all of your classes in a package
named
testing
.
There is no limit on the number of submissions and no penalty for
excessive submissions.
7 Grading
Your submission will be graded as follows:
- Conformity to the Style Guide (Style) - 10% (All or Nothing)
- Passing your Tests (SelfTests) - 10% (All or Nothing)
- Coverage of your Tests (Coverage) - 20% (Partial Credit Possible)
- Correctness of your Code (OfficialTests) - 60% (Partial Credit Possible)
Points will be deducted manually (i.e., outside of
Autolab) for code that is unclear, inelegant, and/or poorly
documented.
8 Help Getting Started
If you have trouble getting started, you can try working with the
original refactoring of the
Amount
interface discussed
in your notes from the planning meeting for Sprint 1. Then, try to
refactor the
AbstractAmount
class accordingly. This
will, hopefully, help you understand why the team decided to use the
other refactoring of the
Amount
interface.
It will also help if you include @Override
annotations
where appropriate right from the start (rather than doing so after
you think everything is working) and pay attention to all compiler
warnings (not just errors).