SOFTWARE
TESTING:
PROCESS AND
LEVELS
Kieu Quoc Viet , [email protected]
Huynh Vinh Nam, [email protected]
1
REVIEW
Questions:
What is Software Testing (ST)? Why do we need it? Is it the end of the world
without ST?
Error? Bug? Fault? Failure?
Verification? Validation?
2
“I’ll write tests later. I just want to get this
working first,” is one of the greatest lies
in software development and it’s usually
one that we tell ourselves.
3
REVIEW
What:
A process used to seek for “perfections” –
correctness, completenes
Also, the quality of the software
Why:
Try to prevent errors as much as possible
Need correction before release the product to the
end user (or worst, customer) → gain their trust
No product → No release → Lose customer →
Massive paycut → Lose the job → End of your life ( ͡• ͜ʖ
͡• )
(In your case, you fail the course)
4
REVIEW
Error: Human action that causes the incorrect result → produces a fault
Bug:
The presence of the error at the time of execution of the software
Sometimes … it’s a “feature”
Fault: State of software caused by an error
Failure:
Deviation of the software from its expected result
More like an event (thanks to the features)
5
REVIEW
Verification: The software must fulfill its requirements.
“Are we building the product right?”
Validation: The software needs to accomplish what the user truly needs.
“Are we building the right product?”
6
REVIEW: WATERFALL MODEL
Standard model used world wide to develop
a software
A framework that describes the activities
performed at each stage of a software
development project
Necessary to ensure the quality of the
software
“One of the oldest but most widely used model in the field of software
development.”
7
SOFTWARE TESTING: PROCESS
8
SOFTWARE TESTING: LEVELS
9
UNIT TESTING
What:
The first level of testing
The process of testing each small module in the
system (function, class, method)
Inspect each component works according to the
design
2 types: automated and manual
Unit testing is performed by developers (Why?)
10
UNIT TESTING
Why:
Need to fix early as possible (easier to fix at the
beginning) (later on will be huge problem)
It's essential to save money for later (does not incur
costs for the project)
Who writes it, will fix it (sometimes, cooperation
with his true enemy tester is needed (with huge
experience, of course))
How:
Take smallest piece of testable software, isolate it,
determine whether it behaves exactly as expected.
Methods: White-box testing, Black-box testing
11
UNIT TESTING: EXAMPLE #1
def Printme(a, b):
result = a + b
if result > 0: • Test Case 1: a = 1, b = 1
print(“Positive”, • This would test the “Positive” branch of the if-else condition.
result) • Test Case 2: a = -1, b = -3
else: • This would test the “Negative” branch of the if-else condition.
print(“Negative”,
result)
12
UNIT TESTING: EXAMPLE #2
Typical unit test cases are:
• Credentials are valid
• Credentials are invalid
• Empty textboxes
13
WHITE BOX TESTING
Also called “Glass testing” or “Open box testing”
The tester needs to possess knowledge of the internal structure
→ Looks inside the source code
→ Finds out which unit of the code is behaving inappropriately
Test are based on coverage of code statements, branches, conditions, etc
14
BLACK BOX TESTING
The tester only knows the inputs and the expected outcomes
Has no idea how the program arrives at the outputs ¯\_( ツ )_/¯
No need to examine the code and further knowledge of the program other
than its specification
Test are based on requirements and functionality
15
INTEGRATION TESTING
The process of testing the interface between
two software units or modules
Focuses on verifying the interactions and data
exchange between different components or
modules
Integration testing is performed by developer
and tester
Example (balance transfer scenario):
Our current balance is $1000
User used transfer module to transfer $500
When transfer is done, the current balance is
$500 left
16
SYSTEM TESTING
System testing is used to check if the system meets the specified
requirements (functionality & performance)
System testing falls under the black box testing category
Testing is done by a professional testers to inspect if it is suitable for
delivery to the end-users
Example (Bank application):
17
SYSTEM TESTING
Types of system testing:
Performance Testing: test the speed, scalability, stability and reliability
Load Testing: determine the behavior of the software product under extreme load
Stress Testing: check the robustness of the system under the varying loads
Scalability Testing: check the performance of a software application or system in
terms of its capability to scale up or scale down the number of user request load.
Compatibility testing: check its compatibility (running capability) on different
platforms/environments
18
ACCEPTANCE TEST
Final boss of the testing process (before the release to the market)
Determine whether or not a system meets acceptance criteria and to test
the system for meeting customer requirements
Check the system behavior using real data
Acceptance testing is performed by end users to verify that the system is
built to suit the business requirements of the organization (Just like a trial
version before buying PREMIUM)
All the interfaces have been incorporated and the system is complete and
tested
→ End users also perform tests to check the usability of the system.
Example: League of Legends PBE (Man of culture)
19
WRITE A TEST CASE
Consider the previous “Check login functionality” test scenario
3 possibilities to check the scenario:
Check response on entering a valid user and password
Check response on entering an invalid user or password
Check response on entering empty values
These possibilities are called test cases
20
WRITE A TEST CASE
Consider the test case "Check response on entering a valid user and
password”
These test case needs input values:
Username: ipman
Password: 123456 (not the best password for an ICT)
The Expected Result is: Login successfully
We must specify test steps for each test cases:
1. Launch application
2. Enter agent name
3. Enter password
4. Click OK button (Or press Enter, obviously)
21
WRITE A TEST CASE
Each test case may have pre-conditions and post-conditions:
Pre: Application must be installed successfully
Post: Login Data must be stored in a database
When test steps are finished, Actual Result must be documented (next
slide)
If Actual Result is equal to Expected Result , then the test case is passed.
Else, test failed
22
WRITE A TEST CASE
23