For this assignment, you must create unit tests for and debug a
class that was written by SagaciousMedia. Specifically, you must
create JUnit tests for WeightedAverageStrategy.java
,
identify the faults it contains, and correct those faults.
You must also correct any other defects in
the WeightedAverageStrategy
class. This includes, but is not
limited to, style defects, incorrect/insufficient comments, "suspicious"
constructs, code duplication, lack of clarity, etc.
WeightedAverageStrategy
class
contains several faults. So, it should fail some of your tests.
If it does not, improve your test suite.
For each failed test, understand the symptom and the trigger condition (i.e., stabilize the faults). Then, localize each fault, correct each fault (documenting the correction in the source code), and verify the correction.
WeightedAverageStrategy
class. Your tests must be in a
package named testing
and each test class must include
the word "Test" in its name.
WeightedAverageStrategy
class, and your JUnit tests (for
the WeightedAverageStrategy
class only) in a file
named sub7.zip
. You must not submit any unnecessary
classes or tests.
Because you should not be using Gradescope to verify your code, you may submit to Gradescope at most 10 times and you will not receive any hints from Gradescope about the official tests.
WeightedAverageStrategy
; All or Nothing; Success Required)Copyright 2025