It will also help you learn a little bit about how to write JUnit tests for GUI components.
List<Line2D.Double>
in the document to
manage the lines that are being digitized? Might it be better to
use a Set
, Map
, or some other abstract
data type. In other words, what operations need to be performed
on the model?
Vector
,
DisplayDigtizerDocument
,
and DigitizerPanel
classes. You must use JUnit (v5)
for this purpose. Your JUnit test suite must cover 80% of all
statements and all branches (as measured by EclEmma) in these classes.
Your unit tests must be in a package named testing
and each test class must include the word "Test" in its name.
You must also perform system testing on all of the components you write. Nearby has provided you with the following classes and an image that you can use for this purpose.
The image file (which is an orthographic photograph of the area near
JMU) must be accessed from the current working directory (i.e., they
must not be accessed using a path). In Eclipse, this means that you
must copy the files into the project directory/folder (not
the src
folder or any folder underneath it).
.zip
file named pa2.zip
that contains:
gui
, math
, and
testing
packages
(packaged appropriately). Do not submit the app
package and do not submit any images.
There is no limit on the number of submissions and no penalty for excessive submissions.
Gradescope will provide you with hints, but may not completely identify the defects in your submission.
Note that some of the criteria are described as "Success Required". This means that Gradescope will not assess subsequent criteria unless this criterion is satisfied (and you will receive a grade of 0 for the criteria that aren't assessed). So, for this assignment, if your code does not conform to the style guide then nothing else will be assessed (and you will receive a grade of 0 for the assignment). You should be able to use the tools on your computer to comply with the style guide and you should be able to tset your code, without assistance from Gradescope.
Points will be deducted manually (i.e., after the due date) for code that is unclear, inelegant, and/or poorly documented.
Before you submit to Gradescope, make sure that your JUnit tests
terminate completely (without
invoking System.exit()
. If they do not terminate
properly, Gradescope will run for 10 minutes but not complete the
assessment. One common mistak in this regard is forgetting to invoke
dispose()
on the JWindow
object.
double[]
to represent points rather than
a Point2D
or two double
values?
java.awt.MouseAdapter
? Why wasn't
it used in the existing design? (Hint: Think about single
inheritance.)
Copyright 2025