Software Testing Unit 1
Software Testing Unit 1
Software Testing Unit 1
UNIT 1
Basics of Software Testing and Testing
Methods
Presented by
M S RATHOD
LIF, GPA
COURSE OUTCOMES (COs)
At the end of this course, student will be able to:
1) Apply various software testing methods.
2) Prepare test cases for different types and levels
of testing.
3) Prepare test plan for an application.
4) Identify bugs to create defect report of given
application.
5) Test software for performance measures using
automated testing tools.
6) Apply different testing tools for a given
application.
Basics of Software Testing and
Testing Methods
Identify errors and bugs in the given
program.
Prepare test case for the given application.
Describe the Entry and Exit Criteria for
the given test application.
Validate the given application using V
model in relation with quality assurance.
Describe features of the given testing
method.
What is Software Testing?
Definition It is an informal The Defect is the An Error is a The Fault is a If the software
name specified to difference mistake made in state that causes has lots of
the defect. between the the code; that's the software to defects, it leads
actual outcomes why we cannot fail to to failure or
and expected execute or accomplish its causes failure.
outputs. compile code. essential
function.
Raised by The Test The Testers identi The Developers Human The failure finds
Engineers submit fy the defect. And and automation mistakes cause by the manual
the bug. it was also solved test fault. test engineer
by the developer engineers raise through
in the the error. the developmen
development t cycle.
phase or stage.
Test, Test Case and Test Suite
Test and test case terms are synonyms and may be used
interchangeably.
A test case consists of inputs given to the program and
its expected outputs.
Every test case will have a unique identification number.
The set of test cases is called a test suite.
All test suites should be preserved as we preserve source
code and other documents.
Software Testing Life cycle
For the planning of test Prepare the list of all requirements and List of all the
plan queries, and get resolved from necessary
requirement specification, Technical Manager/Lead, System tests for the
application architecture Architecture, Business Analyst and testable
document and well-defined Client. requirements
acceptance criteria should Make a list of all types of tests and Test
be available. (Performance, Functional and security) environment
to be performed. details
Make a list of test environment details,
which should contain all the necessary
tools to execute test cases.
Software Testing Life cycle
Test plan creation :- Tester determines the estimated effort and cost
of the entire project. Test case execution can be started after the
successful completion of Test Plan Creation.
Entry Criteria Activities Exit Criteria
Test strategy and test plan Prepare the list of software and Successful
document. hardware by analyzing requirement smoke test,
Test case document. specification. Environment
Testing data. After the setup of the test environment, setup must
execute the smoke test cases to check work as per
the readiness of the test environment. plan and
checklist.
Software Testing Life cycle
Test case Execution:- the testing team starts case development and
execution activity. The testing team writes down the detailed test
cases, also prepares the test data if required.
It
follows a sequential design process same as the
waterfall model.
Easy to Understand.
This saves a lot of time. Hence a higher chance of success over the
waterfall model.
Static Testing may complete 100% statement While dynamic testing only achieves less than 50%
coverage in comparably less time. statement coverage.
Black Box Testing
a method in which the functionalities of software
applications are tested without having knowledge of
internal code structure, implementation details and
internal paths.
mainly focuses on input and output of software
applications
it is entirely based on software requirements and
specifications.
also known as Behavioral Testing.
Black Box Testing
Initially, the requirements and specifications of the system
are examined.
Tester chooses valid inputs (positive test scenario) to check
whether SUT processes them correctly. Also, some invalid
inputs (negative test scenario) are chosen to verify that the
SUT is able to detect them.
Tester determines expected outputs for all those inputs.
Software tester constructs test cases with the selected inputs.
The test cases are executed.
Software tester compares the actual outputs with the
expected outputs.
Defects if any are fixed and re-tested.
Black Box Testing/Methods
Equivalence Partitioning and Boundary
Value Analysis.
Boundary Value Analysis.
the process of testing between extreme ends or
boundaries between partitions of the input values.
So these extreme ends like Start- End, Lower- Upper,
Maximum-Minimum, Just Inside-Just Outside values
are called boundary values and the testing is called
“boundary testing”.
Boundary Analysis
The basic idea in normal boundary value testing is to
select input variable values at their:
Minimum
Just above the minimum
A nominal value
Just below the maximum
Maximum
Equivalence Partitioning
Equivalence Class Partitioning is type of black box
testing technique which can be applied to all levels
of software testing like unit, integration, system, etc.
In this technique, input data units are divided into
equivalent partitions that can be used to derive test
cases which reduces time required for testing
because of small number of test cases.
It divides the input data of software into different
equivalence data classes.
You can apply this technique, where there is a range
in the input field.
Example 1: Equivalence and
Boundary Value
Let’s consider the behavior of Order Pizza Text Box Below
Pizza values 1 to 10 is considered valid. A success message is
shown.
While value 11 to 99 are considered invalid for order and an
error message will appear, “Only 10 Pizza can be ordered”
Here is the test condition
Any Number greater than 10 entered in the Order Pizza
field(let say 11) is considered invalid.
Any Number less than 1 that is 0 or below, then it is
considered invalid.
Numbers 1 to 10 are considered valid
Any 3 Digit Number say -100 is invalid.
Example 1: Equivalence and
Boundary Value
we divide the possible values of tickets into groups or
sets as shown below where the system behavior can be
considered the same.
Example 1: Equivalence and
Boundary Value
The divided sets are called Equivalence Partitions or
Equivalence Classes.
Then we pick only one value from each partition for testing.
The hypothesis behind this technique is that if one
condition/value in a partition passes all others will also
pass. Likewise, if one condition in a partition fails, all
other conditions in that partition will fail.
Example 1: Equivalence and
Boundary Value
Boundary Value Analysis- in Boundary Value Analysis, you test
boundaries between equivalence partitions
In our earlier equivalence partitioning example, instead of checking
one value for each partition, you will check the values at the
partitions like 0, 1, 10, 11 and so on. As you may observe, you test
values at both valid and invalid boundaries. Boundary Value
Analysis is also called range checking.
Equivalence partitioning and boundary value analysis(BVA) are
closely related and can be used together at all levels of testing.
Example 2: Equivalence Partitioning
Following password field accepts
minimum 6 characters and maximum 10
characters
That means results for values in partitions
0-5, 6-10, 11-14 should be equivalent
Test Scenario
Test Scenario Description Expected Outcome
#
Enter 0 to 5 characters in password
1 System should not accept
field
Enter 6 to 10 characters in password
2 System should accept
field
Enter 11 to 14 character in password
3 System should not accept
field
Examples 3: Input Box should accept
the Number 1 to 10
Here we will see the Boundary Value Test Cases
M = E – N + 2P
where,
E = the number of edges in the control flow graph
N = the number of nodes in the control flow graph
P = the number of connected components
Example
The cyclomatic complexity calculated for
above code will be from control flow
graph. The graph shows seven
shapes(nodes), seven lines(edges), hence
cyclomatic complexity is 7-7+2 = 2.
Use of Cyclomatic Complexity
Determining the independent path executions
thus proven to be very helpful for Developers
and Testers.
It can make sure that every path have been
tested at least once.
Thus help to focus more on uncovered paths.
Code coverage can be improved.
Risk associated with program can be evaluated.
These metrics being used earlier in the program
helps in reducing the risks.