Вы находитесь на странице: 1из 4

PROBLEM SOLVING # 3 (GRADED): SOFTWARE VERIFICATION & VALIDATION

Instruction: This assignment consists of FOUR questions with total marks of 60. Answer 1-3
questions. You may either do this assignment individually, or in pair.

Question 1 (15 marks)

You are assigned with a task to test an online car loan calculator application. The screen
snapshot for car loan calculator is presented in Figure 1 together with the system input
requirements. Analyse the figure to answer the following questions:

i. List five (5) test requirements that needed to test the web application (5 m)
ii. Use the equivalence class partitioning technique to generate test cases that relate to
the test requirements identified in (i). (10 m)

Figure 1: Car Loan Calculator Form

Question 2 (10 marks)

Consider a module, called ElecBill which is part of Tenaga National Berhad (TNB) billing
application. The ElecBill module is to compute bill payment of electrical consumption for
different users. In order to promote saving, TNB charge a lower rate to users with lower
consumption as shown in Table 1.

User Type First Rate Second Rate


[Jenis Pengguna] [Kadar Pertama] [Kadar Kedua]
Household 0.10 for first 500 unit 0.25 for the following
units
Office 0.25 for first 1000 unit 0.50 for the following
units
Factory 0.50 for first 1500 unit 0.75 for the following
units
Table 1: Rate

Write test-cases for testing the functionality of this module by using equivalence
partitioning technique. Use data from boundary values analysis for each of your test case.

Question 3 (15 marks)

#include <iostream>
Using Namespace std;
double total,hours;

int main()

{
cout << "Charges for the first 3 hours = RM2.00" << endl;
cout << "Additional charges for the next hours = RM1.50" << endl;
cout << "Maximum charges for any 24 hours = RM20.00" << endl;
cout << "\nPlease insert your hours = ";
cin >> hours;

if ((hours <=3) && (hours > 0))


cout << "\nYour total fee is RM2.00" << endl;
else
if ((hours>3) && (hours<=15))
{
total = 2.00+((hours-3)*1.50);
cout << "\nYour total fee is RM" << total << endl;
}
else
if (hours>15)
{
cout << "\nYour total fee is RM20.00" << endl;
}
else
cout << "\nError! Please insert a valid number of hours" <<
endl;

system(PAUSE);
return 0;

Based on Figure 2, answer the following questions:


Figure 2
i. Draw a Flow Graph for the procedure in Figure 2. (5 marks)
ii. Calculate the cyclomatic complexity of Figure 2 procedure. (1 mark)
iii. Identify and list down all independent paths based on your answer in (i) (4
marks)
iv. Design a test case to force execution down each independent path. Use a table
when designing your test cases. (5 marks)
Question 4 (20 marks)

Suppose a buy-online-ticket application for a theme park is selling tickets at prices as shown
in Table 2. The application will ask theb uyer for his/her age, and it will then identify the
required price for the ticket.
Table 2
Ticket Type Price
1-Day Child Ticket RM 80
(Age: 3-11)
1-Day Adult Ticket RM 140
(Age:12-59)
1-Day Senior Ticket RM 110
(Age: 60-75)

a) List all valid and invalid equivalence classes based on Table 2 (there should be 5
equivalence classes identified) (5 marks)

b) Design test case using the equivalence class you have identified in (a) by filling in the
data in Table 3. (5 marks)

Table 3
Equivalence Class # Age Expected Output
1
2
3
4
5
A

B
C

G
E

H I
F

Figure 3

c) What is the cyclomatic complexity of the flow graph in question c)?


d) List ALL the independent path based on the flow graph. (5 marks)

Вам также может понравиться