Skip to content

Commit 84a4b27

Browse files
committed
add: project phase 2 spec and library
1 parent 362401e commit 84a4b27

File tree

4 files changed

+397
-0
lines changed

4 files changed

+397
-0
lines changed
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
<!--
2+
Create pdf with
3+
pandoc project-spec-2025.md -s -o project-spec-2025.pdf
4+
See installation notes here
5+
https://gist.github.com/ilessing/7ff705de0f594510e463146762cef779
6+
-->
7+
8+
---
9+
title: |
10+
```{=latex}
11+
\vspace{-2em}CITS5501/CITS3501 Project 2025 phase 2
12+
```
13+
classoption: oneside
14+
papersize: a4
15+
fontsize: 12pt
16+
geometry:
17+
- top=0.9in
18+
- bottom=0.8in
19+
- left=0.7in
20+
- right=0.7in
21+
colorlinks: true
22+
linkcolor: blue
23+
urlcolor: blue
24+
---
25+
26+
\vspace{-3em}
27+
28+
| **Version:** | 0.1 |
29+
|--------------|------------------------|
30+
| **Date:** | 12 September 2025 |
31+
32+
<!--
33+
**Changes in version 0.2**
34+
35+
- Changes here
36+
- Changes here
37+
-->
38+
39+
40+
<!-- these abbreviations only work in pdf not in html -->
41+
\def\travelsystem{\textsc{Tachi}} <!-- (https://en.wikipedia.org/wiki/Tachi) -->
42+
\def\travelco{\textsc{Koto}} <!-- Tachi were the mainstream Japanese swords of the Kotō period between 900 and 1596 -->
43+
\def\iata{\textsc{iata}}
44+
\def\iso{\textsc{iso}~}
45+
46+
\def\iata{\textsc{iata}}
47+
\def\iso{\textsc{iso}~}
48+
49+
50+
\def\totalmarks{35}
51+
\def\partonemarks{15}
52+
\def\parttwomarks{20}
53+
54+
55+
# Project Admin
56+
57+
For project administrative matters and rules, refer to the phase 1 project specification.
58+
59+
# Deliverables (\parttwomarks{} marks total)
60+
61+
There are three deliverables for phase 2 of the CITS5501 project:
62+
63+
- A text file containing an EBNF grammar. The grammar must compile using the [BNF
64+
Playground][bnf-playground] website.
65+
- A report (submitted as PDF), created from a Markdown file.
66+
- Your Java source code with Javadoc for a JUnit test class, `SegmentSubcommandTest.java`
67+
68+
The source for all three deliverables should be checked into version control in your GitHub
69+
repository. We will use the submitted version for marking, but your facilitator may inspect
70+
the GitHub repository for additional information on your group's collaboration and quality
71+
assurance processes.
72+
73+
74+
[bnf-playground]: https://bnfplayground.pauliankline.com
75+
76+
# Task 4 -- Tachi commands
77+
78+
## Task 4.1 -- Command grammar (3 marks)
79+
80+
Create a BNF or EBNF grammar that will parse (or generate) valid \travelsystem{}
81+
commands. Your grammar should be a plain text file (not MS Word, Markdown,
82+
or any other format).
83+
84+
Requirements for the grammar are as follows:
85+
86+
1. The syntax for \travelsystem{} commands is
87+
described in the Phase 1 specification, under "\travelsystem{} command description".
88+
2. Your grammar should use the notation accepted by the [BNF Playground][bnf-playground] website.
89+
3. You should not attempt to validate semantic properties of commands.
90+
4. The grammar should include a non-terminal,
91+
`<tachi_command>`, to be used as the start symbol for the grammar.
92+
5. The grammar SHOULD specify any whitespace that needs to appear
93+
between other symbols in the command. But as a simplifying assumption:
94+
if symbols need to be separated by horizontal whitespace (tabs and spaces),
95+
you can and should assume that a single space character is sufficient.
96+
6. Your grammar is a code artifact, and should be clear and well-presented, like any code.
97+
98+
\newpage
99+
100+
**Tips:**
101+
102+
1. Make sure you read the [BNF playground][bnf-playground] website thoroughly -- it includes a
103+
description of the dialect of EBNF it uses, under "Grammar Help".
104+
2. Read through the CITS5501 [rubric guide][rubric] on "Long answer" questions requiring code.
105+
Make sure you understand how those guidelines apply to EBNF grammars. (Your facilitator
106+
may be able to provide some assistance.) Ensure you know how to comment your grammar,
107+
structure it so it is clear to a reader, and make use of appropriate use of EBNF features
108+
which would make your grammar clearer or more concise.
109+
110+
[rubric]: https://cits5501.arranstewart.io/faq/#marking-rubric
111+
112+
**Submission**: You will submit your grammar as a text file in Moodle. You should also
113+
maintain it as a file within your project repository, so markers can see how it has been
114+
revised and reviewed.
115+
116+
## Task 4.2 -- Command grammar quality (3 marks)
117+
118+
Briefly explain (word limit: 1000 words) how you ensured your grammar from Task 4.1 is:
119+
120+
- correct;
121+
- clear; and
122+
- succinct.
123+
124+
What high-level strategies/approaches did you use? What concrete techniques did you apply?
125+
Did you adopt any coverage criteria, and if so, which ones and why?
126+
You should link to at least one point in your project repository where the grammar has been
127+
reviewed for quality.
128+
129+
You should discuss the degree to which your quality assurance techniques can be _automated_ --
130+
could they be run automatically when changes are made to the code, or do they require manual
131+
steps? If the latter, discuss whether this would be appropriate for a real-world project,
132+
and what improvements could be made to them.
133+
134+
**Submission**: This should be a section in your report, and be given the heading "Task 4.2".
135+
136+
# Task 5 -- Java testing
137+
138+
For Task 5, you are provided with a Java library (in the form of several JAR files)
139+
containing compiled code and documentation for classes that
140+
process \travelsystem{} commands. The JAR files can be downloaded
141+
[here](https://cits5501.arranstewart.io/project/tachi-jar-files.zip).
142+
You are required to discuss approaches to testing the library and to implement several tests.
143+
144+
The JAR files are intended to be used by adding them to a Java project. (How this is done
145+
depends on your exact project setup and/or IDE, but if using VS Code, it should be sufficient
146+
to add them to a `lib` directory that is a sibling of any `test` directory you create to
147+
contain your JUnit test class.)
148+
149+
## Task 5.1 -- `ShopFlightFareCommand` class analysis (3 marks)
150+
151+
Describe in detail the preconditions and postconditions of the
152+
constructor for the `ShopFlightFareCommand` class, justifying your
153+
answer (word limit: 500 words).
154+
155+
**Submission**: This should be a section in your report, and be given the heading "Task 5.1".
156+
157+
## Task 5.2 -- Input Space Partitioning (4 marks)
158+
159+
Apply Input Space Partitioning (ISP) to two methods or constructors
160+
in the Java library. One of these should be
161+
the `SegmentSubcommand` constructor; the other can be a method or constructor
162+
of your choice.
163+
164+
Explain the steps you took in applying ISP (word limit: 1000 words). Your explanation should
165+
include:
166+
167+
- a level of coverage you think your test cases should achieve, and why you chose that level;
168+
and
169+
- the characteristics and partitions you derived.
170+
171+
Your descriptions of characteristics and partitions can be fairly brief (bullet points,
172+
tables, etc. are sufficient), but you should pick three characteristics to discuss in more detail. Explain
173+
how you arrived at those characteristics and partitions, and what the rationale for them is.
174+
175+
You need only refine your characteristics and partitions into *four* test cases. At least
176+
three test cases should be for the `SegmentSubcommand` class. You should
177+
provide descriptions of those test cases. The test case descriptions should include:
178+
179+
1. A test ID, for easy reference later.
180+
2. A description of all fixtures, test values and expected values.
181+
182+
If you need to make any reasonable assumptions in order to derive your characteristics or test cases,
183+
state clearly what they are.
184+
185+
**Submission**: This should be a section in your report, and be given the heading "Task 5.2".
186+
187+
## Task 5.3 -- Test implementation (4 marks)
188+
189+
Write a test class using JUnit 5 called
190+
`SegmentSubcommandTest`. The test class should contain JUnit test methods
191+
for the `SegmentSubcommand` class, which implement the 3--4 test cases you described in Task 5.2.
192+
193+
Your test cases should follow appropriate best practices for JUnit tests, including:
194+
195+
- Your tests must properly "Arrange, Act and Assert" your test case. Tests that
196+
(for instance) contain no assertions will not be awarded marks.
197+
- Your test cases must be ones described in Task 5.2. For each test,
198+
include Javadoc documentation providing the test ID from Task 5.2
199+
that it corresponds to.
200+
201+
Your code should compile using a recent version of the Java Development Kit
202+
and the JUnit libraries. (You may assume that the current Long-Term Support release of the
203+
Java Development Kit, JDK 21, is acceptable, as is the current version of the JUnit Jupiter
204+
library, 5.13.4.)
205+
206+
**Submission**: You should submit your `SegmentSubcommandTest` Java code via Moodle.
207+
Refer to the Moodle site for further submission details.
208+
209+
## Task 5.4 -- Test quality (3 marks)
210+
211+
Explain how you assessed the quality of the tests from Task 5.3 (word limit: 500 words).
212+
213+
You should include links to your GitHub repository (to specific pull requests, issues,
214+
commits, etc.) which demonstrate the tests being reviewed for quality.
215+
216+
**Submission**: This should be a section in your report, and be given the heading "Task 5.4".
217+
218+
<!--
219+
vim: tw=94
220+
-->
175 KB
Binary file not shown.
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
CITS5501/CITS3501 Project 2025 phase 2
2+
Version:
3+
4+
0.1
5+
6+
Date:
7+
8+
August, 2025
9+
10+
PROJECT ADMIN
11+
For project administrative matters and rules, refer to the phase 1 project
12+
specification.
13+
14+
Tasks for Project Deliverable 2 [ 25 marks ]
15+
Answes to the following questions should be submitted via Moodle. A more
16+
detailed marking rubric will also be available on Moodle. Some of the questions
17+
require you to write English answers; others require you to write code.
18+
** TODO** 25 marks.
19+
- continue question numbers from part 1 - are these questions suitable for
20+
groups? - should we mark based on evidence of quality assurance through
21+
effective use of issues and pull requests and reviews - possible genAI question
22+
- get them to use genAI to generate a set of test cases and then critique them
23+
using their pull request rules (including a review)
24+
Question 4 [4 marks] YES
25+
Write a BNF or EBNF grammar that will parse (or generate) valid
26+
gladius commands. Your grammar should use the notation accepted
27+
by the BNF playground. Your ansewr must present your grammar in
28+
plain text which could be pasted into the BNF playground and compiled
29+
without error.
30+
The grammar should include a non-terminal <gladius_command> to
31+
be used as the start symbol for the grammar. The grammar should
32+
specify any whitespace that needs to appear between other symbols in
33+
1
34+
35+
the command. (As a simplifying assumption, you may assume that a
36+
single space character is sufficient as a separator between words.)
37+
Question X [4 marks] NO
38+
Write a static Java method, countTerminalSymbols, which counts the
39+
terminal symbols in a grammar.
40+
41+
The signature for the method should be: static int countTerminalSymbols(List<String
42+
The input will be a grammar in BNF or EBNF format (specifically, the
43+
notation accepted by the BNF playground), split into meta-symbols
44+
– each element of the List<String> will be one meta-symbol. Metasymbols consist of terminal symbols (the double quote marks are included in the meta-symbol), non-terminal symbols (the angle brackets
45+
are included in the meta-symbol), newlines, and other meta-syntactic
46+
symbols used by the EBNF playground (such as the “is-defined-as”
47+
symbol, ::= or the “alternative” or “or” symbol, |.)
48+
For example, the following List<String> would represent a very small
49+
grammar consisting of just two strings, sat and sun:
50+
List<String> myGrammar =
51+
List.of("<weekendDay>", "::=", "\"sat\"", "|", "\"sun\"");
52+
The countTerminalSymbols() method would return the int 2 given
53+
the grammar myGrammar.
54+
You may assume that java.util.* and java.util.regex.* import
55+
statements appear at the top of the source file for your code.
56+
Question X [4 marks] NO
57+
Would it be possible to exhaustively test the syntax of gladius
58+
commands (that is, to write tests which have derivation coverage)?
59+
Why or why not? What about if we restricted ourselves to just the
60+
shop flight fare command? Give reasons for your conclusions.
61+
(Maximum 500 word answer.)
62+
Question X [4 marks] NO
63+
64+
2
65+
66+
Write a static Java method, countProductions, which counts the number of productions in a grammar (see the Amman and Offutt text for a
67+
definition of “production”).
68+
The signature for the method should be: static int countProductions(List<String>).
69+
The input will be a grammar in BNF or EBNF format (specifically, the
70+
notation accepted by the BNF playground), as detailed in question 2.
71+
Your may assume that java.util.* and java.util.regex.* import
72+
statements appear at the top of the source file for your code.
73+
74+
3
75+
76+
Question 5 [4 marks] YES
77+
Describe in detail the preconditions and postconditions of the
78+
constructor for the ShopFlightFareCommand class, justifying your
79+
answer. (Max 500 words)
80+
Question 6 [10 marks] YES
81+
Apply Input Space Partitioning (ISP) to the constructor for the
82+
SegmentSubcommand constructor, explaining in detail the steps you
83+
take and what characteristics and partitions you would use.
84+
You should describe:
85+
• eight characteristics that would be useful for testing the constructor.
86+
• three test cases in detail, including all fixtures, test values and
87+
expected values. Include a test ID for each test case, so you can
88+
refer to it in question 7.
89+
You need not exhaustively describe all characteristics, partitions, test
90+
cases and values that would be needed, but should briefly discuss what
91+
more would be needed – beyond the eight characteristics and three test
92+
cases you have described – to achieve Base Choice Coverage, and how
93+
you would know when it was achieved.
94+
(Max 1000 words)
95+
Question 7 [12 marks] YES
96+
Write a test class using JUnit 5 called SegmentSubcommandTest, which
97+
contains @Test methods which implement the three test cases you
98+
described in question 6. Skeleton code for this class is provided in the
99+
supplied Java code, in the “test” directory.
100+
TODO OR get them to generate test cases with an AI tool and then review
101+
the test cases. Issues should be use to track problems with the generated test
102+
cases.
103+
Your test cases should implement all appropriate best practices for
104+
unit tests.
105+
4
106+
107+
Note that to obtain any marks, it is a requirement of the question that:
108+
- you implement three of your question 6 test cases -- for each test,
109+
include Javadoc documentation providing the test ID from question 6
110+
which it corresponds to. If you implement something else instead, no
111+
marks will be awarded.
112+
- your tests properly "Arrange, Act and Assert" your test case. Tests that
113+
(for instance) contain no assertions will not be awarded marks.
114+
The code checks available via Moodle can be useful to highlight
115+
possible problems in your code, but passing them is not a guarantee of any
116+
marks being awarded.
117+
Question 8 [4 marks] YES
118+
Describe a set of test cases for the CommandParser.parse() method
119+
which have production coverage of the grammar you specified as an
120+
answer to question 1. Explain why it is that your test cases satisfy this
121+
coverage criterion.
122+
TODO Should they write these test cases?
123+
max 1000 words
124+
Question 10 [4 marks] NO
125+
Your colleague Oreb has been reading about logic-based testing, and
126+
wonders whether it would be a good use of time to assess – once an
127+
initial suite of tests is in place – what level of coverage the tests for the
128+
gladius system have (e.g. do they have Active Clause Coverage)?
129+
Answer the following question: Would measuring logic-based coverage
130+
for the gladius system be a good use of the team’s time? Why or why
131+
not? Explain your reasoning.
132+
133+
Extension tasks
134+
You may submit an answer to either of the following questions for 3 bonus
135+
marks, awarded at the discretion of the unit coordinator based on the coher5
136+
137+
ence and quality of the answer. These 3 bonus marks cannot take your final
138+
mark higher than 35.
139+
• How could mutation testing be used to evaluate the quality of your
140+
team’s tests, and what empirical evidence exists that mutation testing is
141+
a sound approach to evaluating test quality? If you conclude mutation
142+
testing is not a sound approach, suggest alternatives, and explain your
143+
reasoning. Your answer should include appropriate academic references.
144+
• Write a parser and read–eval–print (REPL) loop for the command
145+
syntax described in this project specification, in any language of your
146+
choosing that can be compiled and run on an Ubuntu 20.04 distribution
147+
running on AMD64 processors. Your REPL loop may return canned
148+
responses to commands.
149+
Commands for building and running your program should be uploaded
150+
as an image to the Docker Hub or any other publicly available Docker
151+
repository, so that the program can be run using a docker run command.
152+
Your Moodle answer should explain what testing approaches you adopted
153+
while writing the program, give a URL on a repository for the source
154+
code, and include the details of the docker run command needed to
155+
run it. (Note: ensure you keep your source code repository private until
156+
the marker requests access, as this is an individual project.)
157+
158+
6
159+
160+

0 commit comments

Comments
 (0)