0% found this document useful (0 votes)
13 views

Module8_-_Software_Testing_-_Hands_on_Student

Uploaded by

lmelody206
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Module8_-_Software_Testing_-_Hands_on_Student

Uploaded by

lmelody206
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Module 8:

Software Verification, Validation


and Testing

Hands On
Testing Process 1: Test Case Design
• Involves designing the test cases (inputs and
outputs) used to test the system
• The goal of test case design is to create a set of tests
that are effective in validation and defect testing
• Test case design approaches:
1. Requirements-based testing
2. Black-Box testing
3. White-Box testing

2021 2
Software Testing Process

3. Test 4. Test
1. Test Cases 2. Test Data
Results Reports

a) Requirement-
b) Black-box c) White-box
based

i) Equivalence ii) Boundary Value ii) Control


i) Basis Path
Partitioning Analysis Structure

Step 2 : calculate Step 4: Generate


Step 1: draw Step 3: identify
Cyclomatic Test cases
Flow Graph Independent Path
2021 Complexity 3
Activity 1. Identify functional test requirements
Café System

Login

Customer
Sign up

Figure 1. Use case diagram of Café System

Identify ONE (1) functional test requirements (TR) from Sign Up use case as illustrated in Figure 1.
Specify the TR with ID and its related statements in the Table 1.

Table 1. Example of Functional Test Requirements


Use Case (UC) TR ID Test Requirements
UC001Ali TRUC0011Ali Validate customer successful login.
UC002Lily TR ….
Activity 2. Design Test Case

Choose Sign Up test requirements from Table 1, then propose TWO test cases (TC). Specify the TC
with ID, data entered and expected results in the Table 2.
Table 2. Example of Functional Test Cases

TR ID TC ID Data Entered Expected Result


TRUC0011Ali TCTRUC0011Ali_01 User ID: rohayanti Customer successfully login.
Password: roha11
TCTRUC0011Ali_02 User ID: roha Customer fail login.
Password: 9911
TR
Activity 3. Identify equivalence classes and
boundary values
Register
User
- UserID: String
- firstName: String - UserID: String
1 1
- lastName: String - password: Integer
- password: String
- Age: Integer + verifyLogin() : bool

+ registerUser()
+ Login()

Figure 2. Class diagram of Café System

Next, propose the relevant equivalence classes and boundary values for each attribute of the
Register object in Figure 2. Continue write your answer in Table 3.
Table 3. Equivalence Partition and Input Range
Object class Attributes Equivalence Partition and Input Range
Register UserID 1. Valid: UserID must be character [a-z] only with length between 8-12
characters
2. Invalid 1: UserID not character [a-z] with length between 8-12
characters
3. Invalid 2: UserID is character [a-z] with length not between 8-12
characters
Password
firstName
Activity 4. Design Test Case from selected object

Choose TWO (2) attributes in RegisterUser() method in Figure 2. Propose suitable test cases, then
illustrate the equivalence class and representative boundary values (note for the valid range, split
the test case accordingly) in Table 4.

Table 4. Object Class Based Test Cases


Object name: Register.
Method name: RegisterUser
Attributes: UserID
Case No. Equivalence Class Pass/Fail? Representative (BVA) Expected Result
TC01 UserID is character [a-z] & 8 Pass rohayanti Valid userID
<= UserID length <=12
TC02 UserID in not character [a-z] Fail roha1234 Invalid userID
& 8 <= UserID length <=12
TC03 UserID in not character [a-z] Fail roha Invalid userID
& 8 <= UserID length <=12

Object name: Register


Method name: RegisterUser
Attributes: ??
Activity 5. Draw Flow Graph
Table 5a. Methods verifyLogin for User Class
Entity Name User
Method Name verifyLogin
Input UserID, password
Output Success/Fail login
Algorithm get UserID and password
If (both match with the ones in the database)
Then return true
Else
Return false

Draw the flow graph 1


Enter
corresponding to algorithm
written in Table 5a. Next,
demonstrate on how to quantify
the cyclomatic complexity for the If
2
flow graph. False
False True
True
4
Cyclomatic complexity, V(G) S2 3
S1
= #Edges - #Nodes + 2
=5–5+2
=2

5
Exit
Activity 5. Draw Flow Graph
Table 5b. Methods registerUser for Register Class
Entity Name Register
Method Name registerUser
Input
Output
Algorithm

1. Write the relevant input, output and algorithm for methods in Table 5b.
2. Draw the flow graph corresponding to algorithm written in Table 5b.
3. Next, demonstrate on how to quantify the cyclomatic complexity for the
flow graph.
Activity 6. Design Test Case using Basis Path
Testing

Propose test cases based on independent path for the flow graph in Activity 5(a) and
write in Table 6. The number of test cases are depends on the number of independent
path that you obtained.
Table 6. Independent Path Based Test Cases
Case No. Independent Path Pass/Fail? Data* for Test Cases Expected Result
TC01 1-2-3-5 Pass UserID = rohayanti True
Password = roha11
TC02 1-2-4-5 Fail UserID = roha False
Password = 9911
Activity 6. Design Test Case using Basis Path
Testing

Propose test cases based on independent path for the flow graph in Activity 5(b) and
write in Table 6. The number of test cases are depends on the number of independent
path that you obtained.
Table 6. Independent Path Based Test Cases
Case No. Independent Path Pass/Fail? Data* for Test Cases Expected Result

You might also like