Always at 23.59 on the same day as your TA session (Except if another deadline has been agreed with the TA). Consult the deadline for your class on the delivery plan.
The learning focus in this iteration is twofold: A) refactoring your HotStone code base to an Strategy pattern based architecture, by using your existing test cases to refactor the code base to a new design; and B) introduce new variants of the HotStone game by implementing new Strategy implementations.
Carefully read FRS § 37.3 which outline the new BetaStone, GammaStone, and DeltaStone variants.
Spend the first 15-20 minutes of the class in plenum discussing...
AlphaStone and BetaStone vary with respect to determining who wins the game: In Alpha, Findus always wins after eight turns, while in Beta, the winner is the one whose opponent hero's health reaches zero or less. As a Strategy pattern dictates that the winner algorithm is in another object distinct from the Game object there obviously must be passed information back and forth between the Game and the Strategy.
Discuss benefits and liabilities of choosing each of these viable ways of passing parameters from Game to the Strategy algorithm:
One of these options will be the lesser choice if case we invent future strategies for determining the winner based on other criterias. Which one?
Develop the BetaStone variant using TDD by refactoring the AlphaStone production code. Both variants must be maintained.
Sketch a compositional design for the HotStone system that supports the variants, and then refactor the AlphaStone production code to implement your design. Ensure your AlphaStone passes all test cases before starting to implement BetaStone. I advise to put common code into suitable packages, like hotstone.framework and hotstone.standard, but variant code in some other package, ala hotstone.variants or similar; and make similar changes in the test tree.
Develop the GammaStone variant using TDD by refactoring the HotStone common production code. All variants must be maintained.
Sketch a compositional design for HotStone to support the new variant, and refactor the existing HotStone production code to support the new design while all existing variants pass their test suites. Next, implement the GammaStone variant using TDD.
Note 1: Regarding the GammaStone solution use a Strategy pattern based approach for the GammaStone design! A sub-classing approach is not wrong, it is just that we want to train skills in applying a compositional design in this course. More details can be found in the W4-4 Mandatory Hints slides for the week.
Note 2: GammaStone strategies need to affect the state of the game, it is not a "pure function" as was the case with Beta. More details on ways to do that in the W4-4 Mandatory Hints slides.
Develop the DeltaStone variant using TDD by refactoring the HotStone common production code. All variants must be maintained.
Sketch a compositional design for HotStone to support the new variant, and refactor the existing HotStone production code to support the new design while all existing variants pass their test suites. Next, implement the DeltaStone variant using TDD.
Deliveries:
Develop on a feature branch named "iteration3" and release using a merge request.
Your submission is evaluated against the learning goals and adherence to the submission guidelines. The grading is explained in Grading Guidelines. The TAs will use the Iteration 3 Grade sheet to evaluate your submission.
Learning Goal | Assessment parameters |
Submission | Git repository contains merge request associated with "iteration3". Git repository is not public! Required artifacts (document with contents as outlined in the sections) must all be present. |
Refactoring Process | The code base is refactored before introducing test cases/production code for the given variant. All code changes are indeed refactoring changes (exact same behavior before and after code changes). Test cases are run frequently to ensure small steps and no defects are introduced. |
Composition | The Strategy pattern and 3-1-2 process have been correctly applied in the code base to support the variants. There is no source-code-copy, parametric, or polymorphic based variant handling code. The 3-1-2 and Strategy pattern terminology is used correctly in the screencast to explain the design and process. |
Unit and Integration Testing | The delegates/concrete strategies are unit tested/tested in isolation (if possible). Integration tests exist that test each of AlphaStone, BetaStone, GammaStone, and DeltaStone as a whole. Test classes are named appropriately. See footnote below. |
UML | The UML diagram is syntactically correct, correctly reflects Strategy, and is a correct overview of the architecture (including aggregation arrows from interfaces to delegates, which is proper for this course). The UML diagram does not show irrelevant implementation oriented details. The interfaces include the method(s) that encapsulate the central algoritm. |
TDD and Code | TDD process has been applied. Test code and Production code keeps obeying the criteria set forth in the previous iterations. The requirements of BetaStone, GammaStone, and DeltaStone are correctly implemented (minor deviations allowed). Missing features are noted in the backlog. |
Unit and Integration Testing clarification: Some concrete strategies can be tested in isolation, that is, unit tested without the StandardGame/GameImpl instance. If possible, please do so. Regarding naming of test classes, do not put tests of BetaStone into a test class named "TestAlphaStone" etc. Separate test suites into test classes with descriptive names, like done in FRS chapter 8.1.5 and onwards.