Assignment 4-1
Assignment 4-1
Assignment 4-1
• Challenge
• Deep learning and critical reflection
• Artefact or performance
• Transferable knowledge and skills with real-world application
Assessment Details
In this assessment, you will need to implement the functionalities and verify your code using unit
testing to ensure specifications are met. IMPORTANT: If you believe that the provided code may
include bugs and is incomplete, then you can fix them ONLY if it is necessary for your solution.
This is TDD (Test Driven Development). You write your code first and then code enough to make
the test pass, and nothing more.
Naming Convention
MethodName_ExpectedBehavior_StateUnderTest
For example:
isValid_False_IfMandatoryFieldsMissing
calculateBonus_ThrowsException_IfNotValidEmployee
Warning: No Dummy Tests
The use of "dummy tests" is not allowed. If you have dummy tests or dummy returns in your
classes you will fail the assignment.
This test will always pass, regardless of the content of the classes (model). In short words, a
dummy test tests nothing! Any type of dummy test is forbidden and will make you fail the
assignment.
This refers to hard-coding a return in a class and you only test that very same return. This way,
the test will always pass, but tests nothing!
Assessment criteria
You’ll be assessed on the following activities:
• Activity 1 – Implement and Test software function (64%)
• Activity 2 - Design user stories and clearly communicate criteria (20%)
• Activity 3 - Explain the type of software maintenance (16%)
Template Code and Submission: Code submissions are accepted via GitHub only. The base
code is made available through GitHub Classroom https://classroom.github.com/a/hZ53JpxA
(Note: Same code is also available on canvas -> assignment 4)
Note: Students are referred to the pre-recorded lectures of week 9 and practical activities of week
11 that contain all the information needed to address this activity
The folders 'java/model' and 'java/utils' have some classes with default/fixed returns. These
classes are skeleton code that may not represent the real-world solution, but represents a real-
world scenario. You are only required to implement the function addCustomertoService() in
class Service based on the below-mentioned instructions. You can change the skeleton only if it
is necessary and these should be justified in the written report (minor changes are acceptable
e.g., changing return values from methods, major changes to the base skeleton code or addition
of new methods representing new features are not allowed). Note: The quality of the code you
write will influence your final marks of the activity.
There is a class in 'test/java/*'. You need to fill the tests according to the following
instructions. Note: name the tests using the naming convention defined above.
What to implement?
Implement (marks 6) and test (marks 10) Service.addCustomertoService() that respects the
following:
• Get the number of services a customer is currently using
• A customer cannot hold more than 3 services
• Throws an exception if a customer is already using the same service
• Get the number of customers associated with the service offered by a franchise
• A service offered by a franchise cannot have more than 500 customers
• If the above constraints are met then add service for the customer, return true and make
any changes to the attributes that are affected by this change. If not then return false
Note: Students are referred to the pre-recorded lectures of week 10 and practical activities of week
12 that contain all the information needed to address this activity
Using the scenario/code provided in activity 1, create 2 user stories. These user stories should
be accompanied by the acceptance criteria. The acceptance criteria for one user story should
be based on GWT (Given When Then) and the acceptance criteria for the second user story
should be based on rule-oriented approach (follow the guidelines discussed in the tutorials). You
can make assumptions about the system, but this needs to be explicitly mentioned in the report
Note: Students are referred to the pre-recorded lectures of week 11 that contain all the information
needed to address this activity
Assume that the code presented in this assessment has been delivered to the client as an
online/web system. Identify the type of software maintenance required for the following
scenarios. Your recommendation of the maintenance type should be accompanied by reasoning
(i.e., why the recommended maintenance type applies to the given scenario?)
Submission Guide:
• Push your code to the GitHub respoistory created by accessing the assignmnet created
using GitHub Classroom (https://classroom.github.com/a/hZ53JpxA)
• The provided code already has sub-folders, so DON'T create new sub-folders or change
the structure of the code.
• All the main code (containing the functionality-classes) are located in
folder "/assigment4_code(this is the name of your repository created on GitHub
Classroom)/src/main/java/model". Similarly, all the test cases should be located in
folder "/assigment4_code(this is the name of your repository created on GitHub
Classroom)/src/test/java/model"
Late work:
Unless special consideration has been granted, the late penalty is 10% of the total mark (25 x
10/100 = 2.5 marks) for the assessment per day late for up to 5 days late (so the maximum late
penalty is 50%). Submissions more than 5 days late are not accepted.
RMIT Classification: Trusted
Rubric
Criteria Ratings Pts
Activity 1 16 to >14 Pts 14 to >13.5Pts 13.5 to >11 Pts 11 to >8 Pts 8 to >0 Pts 16 pts
HIGH DISTINCTION DISTINCTION Credit Pass Fail
Implement The requested method is The requested method is The requested method is The requested method is The method to be
and Test correctly implemented. logically implemented. largely correctly somewhat correctly implemented is not
software Flawless testing (borderline Professional testing implemented. Correct testing implemented (minor errors). implemented or
function and common cases, with the (borderline and common (borderline and common Incomplete testing (not all implementation is
perfect organisation), code cases, with the acceptable cases, but the proportion borderline and common wrong/incorrect.
quality and organisation. All organisation), code quality may be off, or missing many cases are tested). Some There are try/catches
tests pass. No dummy tests or and organisation. All tests of them), code quality, and tests may be failing, there in the testing
returns. There are no try/catch pass. No dummy tests or organisation. All tests pass. may be problems with methods. -
blocks on the tests, the returns. There are no No dummy tests or returns. annotations, or Consistently incorrect
student is using Junit5, the try/catch blocks on the There are no try/catch organisation. The selection of asserts. -
variables are properly tests, the student is using blocks on the tests (there distribution of assert/test is Very poor distribution
initialised, and there is correct Junit5, the variables are may be errors), the student not adequate. Tests don't of asserts in test
distribution of asserts per test properly initialised, and is using Junit5, the variables follow the requested methods, and
method. All concepts are used there is correct distribution are properly initialised, and naming convention. There incorrect use of
consistently and properly. All of asserts per test method. there is the correct are no try/catch blocks on naming notations.
annotations are well used. The All concepts are used distribution of assets per test the tests, the student is The variables are
best assert for each case is properly but there may be method (but this may be using Junit5. The variables consistently initialised
used. The student created a some mistakes. All inconsistent). All concepts may be mixed (some the wrong way. The
professional test set that annotations are well used. are used, but they may be properly initialised, others testing set is vastly
minimises the number of tests The best assert for each inconsistent or have minor not). Concepts are incomplete, or the
written but also covers a wide case is used, but there problems. All annotations inconsistently used, and student tested only a
range of borderline/edge and may be better options. The are well used. The best there is a poor/convoluted single type of cases
common cases. Most relevant student created a assert for each case is used. choice about which assert (or too few of the
cases are tested, providing professional test set that The student created an to use (e.g., there was a other). The asserts
excellent insights. There are covers a wide range of acceptable test set but better/more straightforward are consistently used
no repeated tests. borderline/edge and doesn’t fully cover a nice solution). Some the wrong way. - The
common cases (but there range of borderline/edge annotations may be student is using
may be redundant cases or and common cases. Most missing. The test set that alternative ways to
missing cases). Most relevant cases are tested, minimises is either execute the test set
relevant cases are tested, providing major points. redundant or heavily that are wrong. There
providing some good There are repeated/missing incomplete or mixes both are dummy tests.
insight. tests. cases. However, there
must be both
borderline/edge and
common cases. Some
RMIT Classification: Trusted