Skip to content

Commit f08cd3a

Browse files
committed
update
1 parent 2dec772 commit f08cd3a

69 files changed

Lines changed: 392 additions & 232 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 115 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FAQ.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ More information can be found in [Intellij IDEA documentation](https://www.jetbr
2626
4. Run the created run configuration in the toolbar to run tests.
2727

2828
More information can be found in [Intellij IDEA documentation](https://www.jetbrains.com/help/idea/run-debug-configuration-application.html).
29+
30+
### Q3: How to get the code coverage of tests?
31+
32+
1. Select the run configuration of tests created in Q2.
33+
2. Click the `Run with Coverage` button in the toolbar.
34+
![Q3-1](artifacts/img/Q3-1.png)
35+
3. After the running, a side window will show up with different types of coverage report.

README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## COMP3021 2020Fall Programming Assignment 1
22

3+
Please clone this repository, or download the zip file in the [Release](/releases/latest).
4+
Then, you need to create a **PRIVATE** Github repository of your own, and upload your code there.
5+
Please make sure to frequently make commits in your repository since commits also contribute to your grade of
6+
assignment 1.
7+
38
## Background
49

510
[Jeson Mor](https://en.wikipedia.org/wiki/Jeson_Mor) is a two-player strategy board game from Mongolia, which is a
@@ -175,15 +180,27 @@ The score of a move is the [Manhattan distance](https://xlinux.nist.gov/dads/HTM
175180
the destination and source of the move.
176181
* Players cannot capture pieces of their enemy or win within the first `N` moves, where `N` should be configurable.
177182

178-
### Bonus Tasks
183+
### Bonus Task 1 - Archer
179184

180185
Implement piece type `Archer`, which moves in the same way as **cannon in Chinese chess**
181186
[(Wikipedia)](https://en.wikipedia.org/wiki/Xiangqi#Cannon).
182187
When initialize the gameboard, each player should have half knights and half archers.
183-
Since the total number is odd, the difference between the number of knights and archers should be 1.
188+
Since the total number is odd, each player should have one more knight than archers.
189+
The arrangement of knights and archers of each player are should be in a staggered pattern.
184190

185191
**Note** that player cannot win the game by move an archer out of the central place.
186192

193+
### Bonus Task 2 - Additional Tests
194+
195+
In this bonus task, you are required to design additional JUnit5 tests besides the sample tests provided by us.
196+
The objective of this bonus task is to increase the [branch coverage](https://en.wikipedia.org/wiki/Code_coverage) of
197+
all classes under folder `src/main/java` by executing your tests along with the sample tests, compared
198+
with only using sample tests.
199+
The more branches (that are not covered by sample tests) are covered by your tests, the more bonus points you will get.
200+
You can get 1 point for each 10% improvement of branch coverage.
201+
202+
Your additional tests should be put in the `AdditionalTests` class in folder `src/test/java/castle/comp3021/assignment`.
203+
187204
## Obfuscated Version
188205

189206
We provide an obfuscated demo program which implements Jeson Mor.
@@ -215,6 +232,12 @@ We provide code skeleton with detailed JavaDoc for you to complete this assignem
215232
There are in total 9 (10 if you plan to implement Archer) `TODO`s for you to implement.
216233
Do not modify other parts of the Java code, otherwise many tests will fail unexpectedly.
217234

235+
### Dependencies
236+
237+
Code of this assignment depends on several libraries, including `JUnit5` and Jetbrains `Annotations`.
238+
Jar package of these dependencies are provided in folder `lib`, you need to add `lib` folder as the library of your
239+
IntelliJ Project. Typically, this is already done, if you download use the prepared code in this repository.
240+
218241
### Coordinate System
219242

220243
In order to facilitate implementation, we both use integers in the coordinates of x and y-axis (starting from 0) to
@@ -262,6 +285,8 @@ Sample tests are given in `src/test/java` folder.
262285

263286
* Try your best to consider as many corner cases as possible, your tests will test if your implementation is robust
264287
enough to handle various kinds of scenarios.
288+
* If you have doubts of any behaviours that are not specified, you can check the provided obfuscated version, or ask
289+
the TAs.
265290

266291
### Frequently Asked Questions
267292

@@ -289,6 +314,8 @@ Note that good code style is also a part of your grade in this assignment.
289314
Your submission is a zip file including:
290315
* The Java project. Please maintain the original file structure.
291316
* A `github_url.txt` file containing the url of your private repository.
317+
We will ask you to add TAs' accounts as collaborators.
318+
You need to submit your zip file in [CASS](https://cssystem.cse.ust.hk/UGuides/cass/index.html) (not CANVAS).
292319

293320
## Plagiarism
294321

@@ -308,7 +335,8 @@ We will conduct code plagiarism tests on your program, and your grade will be de
308335
| Keep your Github repository private | 5% | You must keep your repository private all the time. |
309336
| At least 3 commits in different days | 5% | You must commit in **three** **different** days in your repository. |
310337
| Pass all sample tests | 10% | (# of passed tests / # of sample tests) * 30% |
311-
| Pass all TA-only unit tests | 40% | (# of passed tests / # of unit tests) * 40% |
312-
| Pass all TA-only integrated tests | 30% | (# of passed tests / # of integrated tests) * 10% |
338+
| Pass all TA-only unit tests | 40% | (`# of passed tests` / `# of unit tests`) * 40% |
339+
| Pass all TA-only integrated tests | 30% | (`# of passed tests` / `# of integrated tests`) * 10% |
313340
| Code Style | 10% | Get 10% if no error in code style checking. Deduct 1% for each 5 errors. |
314-
| Pass tests for Bonus tasks | Up to 10% | (# of passed tests / # of all tests) * 10% |
341+
| Bonus Task 1: Pass tests for Bonus tasks 1 | Up to 10% | (`# of passed tests` / `# of all tests`) * 10% |
342+
| Bonus Task 2: new tests increasing branch coverage | Up to 5% | (`Branch Coverage of Your tests, including sample tests` - `Branch Coverage of Sample tests`) * 10% |

artifacts/img/Q3-1.png

10.6 KB
Loading

doc/allclasses-index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (14.0.2) on Mon Sep 07 18:34:53 HKT 2020 -->
5+
<!-- Generated by javadoc (14.0.2) on Wed Sep 09 10:39:03 HKT 2020 -->
66
<title>All Classes</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2020-09-07">
8+
<meta name="dc.created" content="2020-09-09">
99
<meta name="description" content="class index">
1010
<meta name="generator" content="javadoc/AllClassesIndexWriter">
1111
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

doc/allpackages-index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (14.0.2) on Mon Sep 07 18:34:53 HKT 2020 -->
5+
<!-- Generated by javadoc (14.0.2) on Wed Sep 09 10:39:03 HKT 2020 -->
66
<title>All Packages</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2020-09-07">
8+
<meta name="dc.created" content="2020-09-09">
99
<meta name="description" content="package index">
1010
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
1111
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

doc/castle/comp3021/assignment/JesonMor.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (14.0.2) on Mon Sep 07 18:34:53 HKT 2020 -->
5+
<!-- Generated by javadoc (14.0.2) on Wed Sep 09 10:39:03 HKT 2020 -->
66
<title>JesonMor</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2020-09-07">
8+
<meta name="dc.created" content="2020-09-09">
99
<meta name="description" content="declaration: package: castle.comp3021.assignment, class: JesonMor">
1010
<meta name="generator" content="javadoc/ClassWriterImpl">
1111
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
@@ -353,7 +353,7 @@ <h3><a id="getAvailableMoves(castle.comp3021.assignment.protocol.Player)">getAva
353353
</span><span class="modifiers">public</span>&nbsp;<span class="returnType">@NotNull <a href="protocol/Move.html" title="class in castle.comp3021.assignment.protocol">Move</a>[]</span>&nbsp;<span class="memberName">getAvailableMoves</span>&#8203;(<span class="arguments"><a href="protocol/Player.html" title="class in castle.comp3021.assignment.protocol">Player</a>&nbsp;player)</span></div>
354354
<div class="block">Get all available moves of one player.
355355
This method is called when it is the <a href="protocol/Player.html" title="class in castle.comp3021.assignment.protocol"><code>Player</code></a>'s turn to make a move.
356-
It will iterative all <a href="protocol/Piece.html" title="class in castle.comp3021.assignment.protocol"><code>Piece</code></a>s belonging to the <a href="protocol/Player.html" title="class in castle.comp3021.assignment.protocol"><code>Player</code></a> on board and obtain available moves of
356+
It will iterate all <a href="protocol/Piece.html" title="class in castle.comp3021.assignment.protocol"><code>Piece</code></a>s belonging to the <a href="protocol/Player.html" title="class in castle.comp3021.assignment.protocol"><code>Player</code></a> on board and obtain available moves of
357357
each of the <a href="protocol/Piece.html" title="class in castle.comp3021.assignment.protocol"><code>Piece</code></a>s through method <a href="protocol/Piece.html#getAvailableMoves(castle.comp3021.assignment.protocol.Game,castle.comp3021.assignment.protocol.Place)"><code>Piece.getAvailableMoves(Game, Place)</code></a> of each <a href="protocol/Piece.html" title="class in castle.comp3021.assignment.protocol"><code>Piece</code></a>.
358358
<p>
359359
<strong>Attention: Student should make sure all <a href="protocol/Move.html" title="class in castle.comp3021.assignment.protocol"><code>Move</code></a>s returned are valid.</strong></div>

doc/castle/comp3021/assignment/Main.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (14.0.2) on Mon Sep 07 18:34:53 HKT 2020 -->
5+
<!-- Generated by javadoc (14.0.2) on Wed Sep 09 10:39:03 HKT 2020 -->
66
<title>Main</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2020-09-07">
8+
<meta name="dc.created" content="2020-09-09">
99
<meta name="description" content="declaration: package: castle.comp3021.assignment, class: Main">
1010
<meta name="generator" content="javadoc/ClassWriterImpl">
1111
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

doc/castle/comp3021/assignment/package-summary.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (14.0.2) on Mon Sep 07 18:34:53 HKT 2020 -->
5+
<!-- Generated by javadoc (14.0.2) on Wed Sep 09 10:39:03 HKT 2020 -->
66
<title>castle.comp3021.assignment</title>
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8-
<meta name="dc.created" content="2020-09-07">
8+
<meta name="dc.created" content="2020-09-09">
99
<meta name="description" content="declaration: package: castle.comp3021.assignment">
1010
<meta name="generator" content="javadoc/PackageWriterImpl">
1111
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

0 commit comments

Comments
 (0)