题意:
实现一组类和接口并为PacmanBoard和ScoreBoard类方法编写Junit4测试
解析:
实现Javadoc中描述的每个类并编写PacmanBoardTest测试9个类方法和ScoreBoardTest测试7个类方法
涉及知识点:
Junit4测试
School of ITEE
CSSE2002/7023 — Semester 2, 2019
Assignment 1 (10%)
Due: 30 August 2019 18:00
Revision: 1.1
Abstract
The goal of this assignment is to implement a set of classes and interfaces1 to be used in later assignments. You will implement precisely the public and protected items described in the supplied documentation (no extra public/protected members or classes). Private members may be added at your own discretion.
Language requirements: Java version 11, JUnit 4
Preamble
All work on this assignment is to be your own individual work. As detailed in Lecture 1, code supplied by course staff (from this semester) is acceptable, but there are no other exceptions. You are expected to be familiar with “What not to do” from Lecture 1 and https://www.itee.uq. edu.au/itee-student-misconduct-including-plagiarism. If you have questions about what is acceptable, please ask course staff.
Supplied Material
• This task sheet
• Code specification document (javadoc).2
• A subversion repositiory for submitting your assignment.3
Javadoc
Code specifications are an important tool for developing code in collaboration with other people. Although assignments in this course are individual, they still aim to prepare you for writing code to a strict specification by providing a specification document (in Java, this is called Javadoc). You will need to implement the specification precisely as it is described in the specification document.
The Javadoc can be viewed in either of the two following ways:
1. Open https://csse2002.uqcloud.net/assignment/1/ in your web browser. Note that this will only be the most recent version of the Javadoc.
2. navigate to the relevant assignments folder under Assessment on Blackboard and you will be able to download the Javadoc .zip file containing html documentation. Unzip the bundle somewhere, and open doc/index.html with your web browser.
1From now on, classes and interfaces will be shortened to simply “classes”
2Detailed in the Javadoc section
3Detailed in the Submission section
Tasks
1. Fully implement each of the classes described in the Javadoc.
2. Write JUnit4 tests for the methods in the following classes:
• PacmanBoard (in a class called PacmanBoardTest)
• ScoreBoard (in a class called ScoreBoardTest)
Marking
The 100 marks available for the assignment will be divided as follows:
The overall assignment mark will be A1 = F + R + J with the following adjustments:
1. If F < 5, then R = 0 and code style will not be marked.
2. If R > F, then R = F.
For example: F = 22, R = 25, J = 17 ⇒ A1 = 22 + 22 + 17.
The reasoning here is to place emphasis on functional code and to not to give marks to well styled code and well implemented JUnit tests when the code is not functional.
Functionality Marking
The number of functionality marks given will be
F=.55
Each of your classes will be tested independently of the rest of your submission. Other required classes for the tests will be copied from a working version of the assignment.
Code Review
Your assignment will be style marked with respect to the course style guide, located under Learning Resources > Guides. The marks are broadly divided as follows:
Naming 5
Commenting 6
Structure and Layout 10
Good Object-Oriented Practices 4
Note that style marking does involve some aesthetic judgement (and the marker’s aesthetic judgement is final).
JUnit Test Marking
Marks will be awarded for test sets which distinguish between correct and incorrect implementations4. A test class which passes every implementation (or fails every implementation) will likely get a low mark. This will be assessed by running your JUnit test classes on a number of correct and incorrect assignment implementations. Marks will be rewarded for tests which pass or fail correctly.
There will be some limitations on your tests:
1. If your tests take more than 20 seconds to run, or
2. If your tests consume more memory than is reasonable or are otherwise malicious
then your tests will be stopped and a mark of zero given. These limits are very generous, (e.g. your tests shouldn’t take anywhere near 20 seconds to run).
Electronic Marking
The electronic aspects of the marking will be carried out in a linux environment. The environment will not be running Windows, and neither IntelliJ nor Eclipse (or any other IDE) will be involved. It is also critical that your code compiles. If one of your classes does not compile, you will recieve zero for any electronically derived marks for that class.
Submission
Submission is via your subversion repository. Details for how to submit your assignment is available in the Version Control Guide. Your repository url is:
https://source.eait.uq.edu.au/svn/csse2002-s???????/trunk/ass1.
Your submission should have the following internal structure:
src/ folders (packages) and .java files for classes described in the Javadoc
test/ folders (packages) and .java files for the JUnit test classes
A complete submission would look like:
src/pacman/util/Position.java
src/pacman/util/Direction.java
src/pacman/ghost/Clyde.java
src/pacman/ghost/Phase.java
src/pacman/ghost/Ghost.java
src/pacman/ghost/Pinky.java
src/pacman/ghost/GhostType.java
src/pacman/ghost/Blinky.java
src/pacman/ghost/Inky.java
src/pacman/score/ScoreBoard.java
src/pacman/hunter/Speedy.java
src/pacman/hunter/Hungry.java
src/pacman/hunter/HunterType.java
src/pacman/hunter/Phasey.java
src/pacman/hunter/Hunter.java
src/pacman/hunter/Phil.java
src/pacman/board/BoardItem.java
src/pacman/board/PacmanBoard.java
src/pacman/game/Entity.java
src/pacman/game/Moveable.java
test/pacman/score/ScoreBoardTest.java
4And get them the right way around
test/pacman/board/PacmanBoardTest.java
test/pacman/JdkTest.java
Ensure that your assignments correctly declare the package they are within. For example, PacmanBoard.java should declare package pacman.board.
Do not submit any other files (e.g. no .class files) other than test files ( in test directory ) but note that ScoreBoardTest and PacmanBoardTest will be compiled without the rest of your files.
Prechecks
Prechecks will be performed on your assignment repository multiple times before the assignment is due. They will assess whether your folders and files are in the correct structure and whether your public interface aligns with the expected public interface. Successfully passing a precheck does not guarantee any marks. No functionality or style is assessed.
Precheck #1: Approximately 6pm on the 18/08
Precheck #2: Approximately 6pm on the 21/08
Precheck #3: Approximately 6pm on the 25/08
Precheck #4: Approximately 6pm on the 28/08
Please endeavour to have code written and in your repository before at least one of these prechecks in order to make the most of them. No additional prechecks will be run for people who did not start the assignment in time, or who neglected to commit their code to their repository. Prechecks are valid only for currently released version of the Javadoc, if an update is made it may invalidate the precheck results.
Late Submission
Assignments submitted after the due date will recieve a mark of zero unless an extension is granted as outlined in the ECP — see the ECP for details.
Remark Requests
To submit a remark of this assignment please follow the information presented here: https://my.uq.edu.au/information-and-services/manage-my-program/exams-and-assessment/querying-result.
Revisions
If it becomes necessary to correct or clarify the task sheet or Javadoc, a new version will be issued and a course announcement will be made on Blackboard. No changes will be made on or after 26/08/2019.
4