Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ISYS1118 Software Engineering Fundamentals

Unit Testing & Software Quality

Learning Objectives Assessed

This assessment evaluates the following CLOs:

•    CLO 1: Explain and apply the main aspects of software engineering.

•    CLO 2: evaluate requirements for a software system

•    CLO 6: recognise and describe current trends in the area of software engineering

•    CLO 7: Design and carry out tests using various testing techniques and tools.

Authentic Assessment Principles

This assessment covers 4 key AA principles

•    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

Use the following naming convention for your tests:

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.

What is a dummy test?

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 is a dummy test in java

public void isValid_False_IfMandatoryFieldsMissing() {

assertTrue(true);

}

What are dummy returns?

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

Youll 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%)

For more details, check the rubric attached below:

Template Code and Submission: Code submissions are accepted via GitHub only. The base

code is made available through GitHub Classroomhttps://classroom.github.com/a/mai5gUZI (Note: Same code is also available on canvas -> assignment 4)

Activity 1 Implement and Test software function (Marks 16)

Note: Students are referred to the pre-recorded lectures of week 9and practical activities ofweek

11that 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  addStudent() in  class Programme 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: use the above mentioned convention for creating test cases. As here only “ONE”  method  will   be  tested,  so   method  name  could   be   ignored  in  this  assignment (MethodName_ExpectedBehavior_StateUnderTest).

What to implement?

Implement (marks 6) and test (marks 10) Programme.addStudent() that respects the following:

•     Get the number of student enrolled in a programme

•     A student cannot be enrolled if the start date of the programme has passed

•     Throws an exception if a student is already enrolled in the same programme

•     Get the enrollments of the programme

•    A programme cannot have more than 250 students

•     If the above constraints are met then enroll a student in a programme i.e. add a new student to the course and return true. If not then return false.

•    When student is successfully enrolled  in a  programme, student is also added to the available list of the students for Football” game (NOT to the football team).

You are expected to complete the following activities here:

•     Write test cases for  Programme.addStudent()

•     Each test criteria must be in an independent test method

•     Initialize the test object with initialise method. You are expected to use a proper unit testing initialisation

•     The test cases should be added to  test/java/AddStudent

•    You can correct any bugs in the skeleton code that doesn’t involve any changes to the skeleton code

•    All test units should be commented in the code to describe what conditions are being tested e.g. a sample comment to test the division by zero condition could be This method test the division method for numerator >0 and denominator =0”

The folders 'java/model' and 'java/utils' have some classes with default/fixed returns. These       classes are skeleton code that does not represent the real-world solution. You are only required to implement the function addStudent () in class Course 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 (don’t change the base skeleton code or add any new method/function). Note: The quality of the code you put here will influence your marking.

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.

Your response addresses CLO 1, 2

Activity 2 Design user stories and clearly communicate criteria (Marks 5)

Note: Students are referred to the pre-recorded lectures of week 10and practical activities ofweek

12that 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

Activity 3 Audit the Software Quality (Marks 4)

Note: Students are referred to the pre-recorded lectures ofweek 11that contain all the information needed to address this activity

You are give a code ( 'java/model/activity_3.java') that represents an “Employee” in an organization. Review the code and identify 2 quality problems with the given code. You also need to explain the reason behind the identified problem and propose a solution to improve the quality of the code

Your response addresses CLO 1, 2

Submission Guide:

•    Push your code to the GitHub respoistory created by accessing the assignmnet created using GitHub Classroom (https://classroom.github.com/a/mai5gUZI)

•     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_2023_S2_(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_2023_S2_ (this is the name of your repository created on GitHub Classroom)/src/test/java/model"

Important: Provide the link of your github repository on the written report. If the link of the github repository is not provided with the submission, then the group will receive a 0” mark for activity 1

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.