Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
116 views11 pages

SWT301 Sample Final PE

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views11 pages

SWT301 Sample Final PE

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

SWT301 - The Sample final PE

Your company will develop a web application for an English Center to help the managers
manage their staff and students, such as individual information, class schedule, and syllabus.
When the product fully develops, students and teachers can access the system with their account
to do homework, class assignments, and quiz tests and see the training material, scores, and so
on.
The interface is also very user-friendly, so things are easy to find, and teachers will have no
problems pulling up material and taking classes. This system's class and course management
modules require some attention because they are critical.
The web application will have some Major Features:
- A dashboard full of helpful, informative charts
- Manage user information, including student, teacher, and staff
- Manage course information
- Manage class information
- Monitor class performance with attendance system and test result
The project will use incremental development and delivery process. The schedule will have three
iterations. Each iteration will develop significant functions based on their priority and value to
the customer from high to low and deliver the web application to the customer to give the value
added to them.
Question 1: The project applies test first driven approach to doing the component test. Then you
are assigned to design and create the component test cases to test a Register method.
The method Register(strUserName, strPassword, strPhone) had three input parameters with some
business rules.
- Username has the string type; 7 chars < Username <= 12 chars; the first character isn't a
number; the remaining characters are not special chars. Username
- Password has more than 12 characters: one special character, one up case character, and
one number character.
- The cellphone is a number type; had ten digits and the first digit with zero.
The method will return those results
- Return TRUE and show the message "Register success."
- Return FALSE and show the message "User name already exist."
- Return FALSE and show the message "Username is invalid."
- Return FALSE and show the message "Password is invalid."
- Return FALSE and show the message "Cellphone number is invalid."

Question 2: Assume you are assigned to do the Integration Test between the front-end and back-
end of the Create Class function.
Function description:
o Actor/Role: Staff (Manager, Coordinator)
o Purpose: Create a new class in the center
o Function Interface:
- Six text fields to insert information about class
- Two buttons (Save, Cancel)
Function Detail:
- The actor selects the course and then fills in information about the class.
- The system will verify all data that the actor fills in. If one of the data is not correct, the
system will
- Show notification and change color to red, which field is not correct.
- If the actor clicks back will return to the list class page, and all data in create page will
not save

1. Design the function test cases to test the above function using the “decision and extend
the decision table” test design technique.
2. Create the high-level test-test-case with the test data for your test case designed above.

Question 3: Assume that you are assigned to do the System Test of the "Create class schedule"
feature. The business process will include the following steps
Step 1: The Admin creates a new English class.
Step 2: The Manager approves the new class schedule.
Step 3: The teacher receives a notification email about the new class.
Step 4: The teacher makes a confirmation about the assignment.
Step 5: The system shows the new class information to students.
It would be best if you designed the test cases for normal flow and alternative flow for the above
feature.

* Notes:
- Please feel free to add any assumptions needed for your answer to be more exact and clear.

Q. 1: Given the following state transition table Which of the test cases below will
cover
the following series of state transitions? S1 SO S1 S2 SO
Exhibit:
A. D, A, B, C.
B. A, B, C, D.
C. D, A, B.
D. A, B, C.

Q. 2: Given the following state transition diagram Which of the following series of
state transitions contains an INVALID transition which may indicate a fault in
the system
design?
Exhibit:
A. Login Browse Basket Checkout Basket Checkout Pay Logout.
B. Login Browse Basket Checkout Pay Logout.
C. Login Browse Basket Checkout Basket Logout.
D. Login Browse Basket Browse Basket Checkout Pay Logout

Q. 3: Given the following fragment of code, how many tests are required for 100%
decision coverage?
if width > length
then
biggest_dimension = width
if height > width
then
biggest_dimension = height
end_if
else
biggest_dimension = length
if height > length
then
biggest_dimension = height
end_if
end_if
A. 3
B. 4
C. 2
D. 1
Q. 4: You have designed test cases to provide 100% statement and 100%
decision
coverage for the following fragment of code.
if width > length
then
biggest_dimension = width
else
biggest_dimension = length
end_if
The following has been added to the bottom of the code fragment above.
print "Biggest dimension is " & biggest_dimension
print "Width: " & width
print "Length: " & length
How many more test cases are required?
A. One more test case will be required for 100 % decision coverage.
B. Two more test cases will be required for 100 % statement coverage, one of
which will be
used to provide 100% decision coverage.
C. None, existing test cases can be used.
D. One more test case will be required for 100" statement coverage.

Q. 5: The above diagram represents the following paths through the code.
A. vwy
B. vwz
C. vxy
D. vxz
What is the MINIMUM combination of paths required to provide full statement
coverage?
Exhibit:
A. A
B. ABD
C. ABCD
D. ACD

Q. 6: Given the Following program


IF X <>= Z
THEN Statement 2;
END
McCabe’s Cyclomatic Complexity is :
A. 2
B. 3
C. 4
D. 5

Q. 7: How many test cases are necessary to cover all the possible sequences of
statements (paths) for the following program fragment? Assume that the two
conditions
are independent of each other:
if (Condition 1)
then statement 1
else statement 2
fi
if (Condition 2)
then statement 3
fi
A. 2 Test Cases
B. 3 Test Cases
C. 4 Test Cases
D. Not achievable

Q. 8: Given the following:


Switch PC on
Start "outlook"
IF outlook appears THEN
Send an email
Close outlook
A. 1 test for statement coverage, 1 for branch coverage
B. 1 test for statement coverage, 2 for branch coverage
C. 1 test for statement coverage. 3 for branch coverage
D. 2 tests for statement coverage, 2 for branch coverage
E. 2 tests for statement coverage, 3 for branch coverage

Q. 9: Given the following code, which is true:


IF A > B THEN
C=A–B
ELSE
C=A+B
ENDIF
Read D
IF C = D Then
Print "Error"
ENDIF
A. 1 test for statement coverage, 3 for branch coverage
B. 2 tests for statement coverage, 2 for branch coverage
C. 2 tests for statement coverage. 3 for branch coverage
D. 3 tests for statement coverage, 3 for branch coverage
E. 3 tests for statement coverage, 2 for branch coverage

Q. 10: Consider the following:


Pick up and read the newspaper
Look at what is on television
If there is a program that you are interested in watching then switch the the
television on
and watch the program
Otherwise
Continue reading the newspaper
If there is a crossword in the newspaper then try and complete the crossword
A. SC = 1 and DC = 1
B. SC = 1 and DC = 2
C. SC = 1 and DC = 3
D. SC = 2 and DC = 2
E. SC = 2 and DC = 3

Q. 11: Given the following code, which is true about the minimum number of test
cases required for full statement and branch coverage:
Read P
Read Q
IF P+Q > 100 THEN
Print "Large"
ENDIF
If P > 50 THEN
Print "P Large"
ENDIF
A. 1 test for statement coverage, 3 for branch coverage
B. 1 test for statement coverage, 2 for branch coverage
C. 1 test for statement coverage, 1 for branch coverage
D. 2 tests for statement coverage, 3 for branch coverage
E. 2 tests for statement coverage, 2 for branch coverage

Q. 12: Minimum Test Required for Statement Coverage:


Disc = 0
Order-qty = 0
Read Order-qty
If Order-qty >=20 then
Disc = 0.05
If Order-qty >=100 then
Disc =0.1
End if
End if
A. Statement coverage is 4
B. Statement coverage is 1
C. Statement coverage is 3
D. Statement Coverage is 2

Q. 13: Minimum Tests Required for Statement Coverage and Branch Coverage:
Read P
Read Q
If p+q > 100 then
Print "Large"
End if
If p > 50 then
Print "pLarge"
End if
A. Statement coverage is 2, Branch Coverage is 2
B. Statement coverage is 3 and branch coverage is 2
C. Statement coverage is 1 and branch coverage is 2
D. Statement Coverage is 4 and Branch coverage is 2

Q. 14: What is the smallest number of test cases required to Provide 100%
branch
coverage?
If(x>y) x=x+1;
else y=y+1;
while(x>y)
{
y=x*y; x=x+1;
}
A. 1
B. 2
C. 3
D. 4

Q. 15: If the pseudo code below were a programming language ,how many tests
are
required to achieve 100% statement coverage?
1. If x=3 then
2. Display_messageX;
3. If y=2 then
4. Display_messageY;
5. Else
6. Display_messageZ;
7. Else
8. Display_messageZ;
A. 1
B. 2
C. 3
D. 4

Q. 16: This part of a program is given:


WHILE (condition A) Do B
END WHILE
How many decisions should be tested in this code in order to achieve 100%
decision
coverage?
A. 2
B. Indefinite
C. 1
D. 4

Q. 17: Analyze the following highly simplified procedure:


Ask: "What type of ticket do you require, single or return?"
IF the customer wants ‘return’
Ask: "What rate, Standard or Cheap-day?"
IF the customer replies ‘Cheap-day’
Say: "That will be £11:20"
ELSE
Say: "That will be £19:50"
ENDIF
ELSE
Say: "That will be £9:75"
ENDIF
Now decide the minimum number of tests that are needed to ensure that all the
questions
have been asked, all combinations have occurred and all replies given.
A. 3
B. 4
C. 5
D. 6

Question 18 If you are flying with an economy


ticket, there is a possibility that you may get
upgraded to business class, especially if you hold a
gold card in the airline's frequent flier program. If
you don't hold a gold card, there is a possibility
that you will get 'bumped' off the flight if it is full
and you check in late. This is shown in Figure 4.5.
Note that each box (i.e. statement) has been
numbered.
Three tests have been run:
Test 1: Gold card holder who gets upgraded to
business class
Test 2: Non-gold card holder who stays in economy
Test 3: A person who is bumped from the flight
What is the statement coverage of these three tests?
a. 60%
b. 70%
c. 80%
d. 90%

Question 19 Given the state diagram in Figure


4.6, which test case is the minimum series of valid
transitions to cover every state?
a. SS-S1-S2-S4-S1-S3-ES
b. SS-S1-S2-S3-S4-ES

c. SS-S1-S2-S4-S1-S3-S4-S1-S3-ES
d. SS-S1-S4-S2-S1-S3-ES

You might also like