ISEN 1000 Trimester 2, 2022
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
ISEN 1000
Trimester 2, 2022
Question 3: Unit Testing [Total Marks: 25]
*Following considerations should be made while answering this question
Name the file (python file) appropriately e.g., “MyCalculator.py” (for a calculator
software)
Name the functions appropriately e.g., “MySum” (for sum operation) All code should be executable on college provided VMWare based Linux
environment.
This question uses the git repository follow the guidelines.
A. Design a black box test (making table for all test cases) for the Equivalence Partitioning testing and write equivalent Python based test code. (7 marks) [submit the test code as python files]-Production code provided (see codes folder Q3PartA.py).
A function takes four integer inputs (num1, num2, num3, num4), and returns the mean four numbers if the numbers meet the basic requirement and - 1 otherwise. The basic requirement is, if num1 is grater then num2 and num3 is greater than or equal to num4, the result is mean of all number.
|
B. Design a test for the following for the Boundary Values Analysis (BVA) testing and write equivalent Python based test code. (5 marks) [submit test code as python files] - Production code provided (see codes folder Q3PartB.py)
A function estimates the eligibility for COVID vaccine based on the entered age (integer value) of individuals. If the age is less than 6 the output will be “Not Eligible” for age 6 to 12 shows “Eligible for 1 dose” for age up to 16 “Eligible for 2 doses”, for age up to 25 “Eligible for 3 doses” for age up to 45 “Eligible for optional dose” for age up to 60 output is “Must take optional dose” for age up to 85 output will be “See your GP for eligibility” . For any invalid age ranges (e.g., <0 or >85) system shows an output “Invalid age” .
|
C. Consider the following python code to find the median of 3 numbers, develop a test design for white box testing. (7 marks) [Production code is provided with question (see codes folder Q3PartC.py), submit both test code and edited code (if any)]
|
D. Implement your test design in parts A, B and C using python (unittest) modules, run show the screenshots in the report and submit the implemented python codes. (6 marks) [ Hint:
Convert the codes in class-based implementation.]
*The online uploaded codes should be a private repository.
Question 4: Modularity [Total Marks: 20]
*Consider the provided code file (Q4.py) with the exercise document and perform the following on the provided code. This question uses the git repository follow the guidelines.
A. Identify the modularity issues in all functions, list (make a table, see example below) the function name, identified issue, category of issue, comments on how it is an issue, proposed solution. (5 marks)
Table 2: Example details expected
Sr. |
Function name |
Identified issue |
Category of issue |
Comments |
Proposed Solution |
1. |
Func_ 1 |
Global variables used |
Coupling issue |
The global variables increase the dependency of Func1 and Func3 |
Remove global variables by parameters |
A. Demonstrate how the flag(s) used in the code provided are affecting the modularity, what specific kind issues are introduced using flag(s) in the code. (5 marks)
B. Refactor the code provided by remove the modularity issues identified in part A. change all functions and function calls in main function and other functions in the code. (7 marks)
C. Use version control to put all files initial and refactored file, making sure to meet the basic functions after refactoring (code running after refactoring) (3 marks) [provide the git repository and online git link (if uploaded to global repository i.e., online), Name repository as: studentID_Exercise2_ISE]
*The online uploaded codes should be a private repository.
2022-09-22