SWE30009 2023S2 Assignment 1
SWE30009 2023S2 Assignment 1
Assignment 1
This is an individual assignment worth 20% of the total unit score.
Due date: 11:00pm, Monday, 21 August 2023
DESCRIPTION
Assume that there are only four feasible arithmetic operators, namely, + (addition), - (subtraction), *
(multiplication) and / (division).
Assignment Requirement
This assignment serves to strengthen your understanding of the test activities as well as how to generate
test cases with reference to the code of the program under test. In particular, you are required to do the
following:
A. Tasks:
You are required to adopt the testing objective of detecting ANY possible incorrect use of
arithmetic operators in this program.
The above program contains two arithmetic operators, namely, “-” in the statement of “A = A
- B” and “*” in the statement of “C = A * 2”. By “ANY possible incorrect use of arithmetic
operators”, it means that “-” is incorrect, or “*” is incorrect, or both “-” and “*” are incorrect.
Task 1: Explain and show all details on how to design the test cases for the above testing
objective.
1
Task 2: Suppose you use test case (A=3, B=1) to test the above program. Is this test case able
to achieve the required testing objective? Provide your answer with justifications.
Task 3: Based on your design in Task 1, what is (or are) the concrete test case (or cases) that
can achieve the above testing objective? Explain and justify your concrete test case (or cases).
Task 4: Given B=1, find all possible values of A so that the concrete test cases (A,B) cannot
achieve the above testing objective? Explain and justify the correctness of your solution.
B. Requirement:
- You need to prepare a self-contained and complete report for addressing these four
tasks. Your report must use 12-point font size on A4 papers. The report must contain no
more than three pages. The coverage page is not required, but your submission must contain
your full name and your student number on the first line of its first page.
- You must submit the Assignment 1 report as a single PDF file (which must have the
filename specified in this format as “Assignment1-YourStudentID-YourSurname.pdf”, for
example, Assignment1-12345678-Nash.pdf) before the due date using the Submission
System for Assignment 1 in Canvas available to you.
C. Instructions:
You may want to refer to “Lecture 2” for all tasks. For Task 3, you can use the trial method and
may construct one or more than one concrete test cases. For Task 4, you can develop a program
to find them automatically, or prove the exhaustiveness of test cases.
MARKING CRITERIA