COS4017-BCoursework1 Specification 2023-24
COS4017-BCoursework1 Specification 2023-24
1st Coursework
Use Case Diagrams, Programming and Unit Testing
Important Information
This coursework, worth 50%, is an individual assignment. You must complete the work
yourself, without assistance from other students. Do not ask other students to help you, and
do not share code or any related materials with other students. All parts of your
submission will be checked for similarity to other student submissions. During the lab session on
21tst March 2024 you will present your work to lab demonstrators and will be asked to
explain various parts of your code.
Learning Outcomes
The first two out of three Learning Outcomes (LOs) are addressed by this coursework.
LO1:
a. discuss and apply fundamental theoretical concepts in software project development; --
use object-oriented approaches and rigorous testing (unit testing)
b. use basic principles of software design and express aspects of design in an
appropriate modelling language; -- UML notation (Use case diagrams)
LO2:
a. apply advanced OO analysis, design & programming concepts to construct reliable
software; -- OO analysis, design and programming; separation of concerns; unit testing
b. interpret and utilise software designs expressed in an appropriate modelling language; --
architectural and component design are transposed into appropriate classes and unit testing
follows the internal structure of the code
Introduction
The coursework assignment for this module requires you to complete two tasks outlined in this
document. The first task, “A. Use case diagram” [30%], will ask you to understand
the requirements of a system, described by a scenario, and define its key functions and
interactions with several stakeholders as a use case diagram. The second task, “B.
Programming and Unit Testing” [70%], will ask you to implement a class with several methods
and provide unit testing, using JUnit, for one of the methods.
The topics involved in this 1st Coursework are delivered, through lectures and lab sessions, as
follows:
• Java programming basics (FoP – semester 1)
• API on strings (week 1)
• Text I/O files (week 2)
• Exceptions (week 3)
• UML Use case diagrams (week 4)
• Unit testing & JUnit (week 5)
Please ensure you follow the instructions provided precisely to avoid having marks deducted.
A web-based banking portal aimed at handling the process of managing mortgages has the
functions described below.
• The Mortgage Manager (MM) is able to add new customers to the bank’s database; and
update their details. MM can also add new employees (e.g., Risk and Compliance
Officers) to their team; and update their details. MM then manages an automatic
allocation of mortgage contract schemes to customers, based on their credit score and
banking history. When there are no available schemes that match a customer’s profile, a
suitable error message is displayed.
• Every customer is able to view a subset of schemes that are returned by the system as
options that match their credit profile.
• Risk and Compliance Officers are able to view the selected scheme for each customer.
They can also view the customers allocated to them for monitoring and mentorship.
Questions
A.1. Define the concepts of actor and use case. [5%]
A.2. Identify the actors and list them. [5%]
A.3. Draw a use case diagram showing the use cases, the actors, and their relationships, as
described by the scenario. [20%]
Marking scheme
A.1. Define the concepts of actor and use case. Correct definition [5%]
A.2. Identify the actors and list them. All the actors presented by the scenario [5%]
A.3. Draw a use case diagram showing the use cases, the actors, and their relationships,
as described by the scenario. Correct and complete set of actors and use cases [10%];
correct relationships [10%]
You are asked to implement a class, called YearlyOfficers, that will reorganise the records of the
bcs.txt file into four text files, bcs21.txt, bcs22.txt, bcs23.txt, bcs24.txt containing
students from bcs.txt registered with the Society in 2021, 2022, 2023, 2024, respectively.
It is expected that appropriate API handling strings will be used in connection with UoB numbers
and adequate Text I/O operations. When the first two digits of the UoB number are not
in the specified range then an exception is thrown, and preferably the error is recorded in an
error log file.
Questions
B.1. Implement the YearlyOfficers class and show by running it that it separates the
bcs.txt file by using the above-mentioned methods. [30%]
B.2. Apply unit testing, using JUnit, to the separateOfficers() method. Identify a minimal test set,
as a set of records in testOfficers.txt for testing this method and insert it, as comment, at the
beginning of the testing method. The output files will be testOfficers21.txt,
testOfficers22.txt, testOfficers23.txt and testOfficers24.txt. [20%]
B.3. Oral presentation of the implementation and unit testing. Apart from the Java source code
and JUnit, you should prepare a bcs.txt file, which includes at least two students per each year
and 10 overall, and testOfficers.txt file with minimum number of records, as they appear at
the beginning of the unit testing code. [20%]
The answers to questions B.1 and B.2 will be provided in a pdf file, where:
(i) the first line contains your full name, followed by UoB number, as Java comment; then
(ii) the Java solution to B.1 and unit testing code and testing file, as mentioned above (B.2).
For the oral presentation on 21st March (B.3), you should have prepared: (i) the Java code (B.1)
and bcs.txt file; (ii) JUnit code and testOfficers.txt. These must be the same with the java
code and JUnit testing code saved in the pdf file, as answers to questions B.1 and B.2.
Note 3. The answers for sections A (Use Case Diagram) and B (Programming and Unit
Testing) must be merged into one single pdf file, with contents of the pdf file associated
with A first, followed by Section B. The final pdf file is Name_Coursework1.pdf, where
Name is your full name, as it appears on the first line of the file. For example, if on the first
line it appears John Smith (followed by UoB) then the file Name is
JohnSmith_Coursework1.pdf
B.2. Correct unit testing approach (correct testing assertion) [7%]; covering all the cases [7%];
minimal test set provided [6%]
B.3. Oral presentation covering correct functionality [5%]; correct unit testing [5%]; correct
answers to questions [10%]. If basic questions are not answered then this might impact on
previous marks.
NB. in case of similarities with other submissions or lack of awareness of own code, a mark of 0
(zero) is recorded.