Software Testing Fundamentals
Introduction
TESTING& TECHNIQUES
Programming with The program is executed with desired input(s) and the output(s) is/are
observed accordingly.
ESP8266 The observed output(s) is/are compared with expected output(s). If both are
same, then the program is said to be correct as per specifications
is the process of executing a program with the intent of finding
Who should test the software?
Role of developer, tester, customer etc in testing process
Verification and Validation
Assistant Professor Test, Test Case and Test Suite
Kusum Lata Dhiman Acceptance Testing: customer is involved during acceptance testing
Computer Science & Engineering Alpha Testing: conducted at the site by the customer.
Image source : Google
Beta Testing: conducted by potential customers at their sites
Software Testing Fundamentals Software Testing Fundamentals
Analyzing the requirement from the client
Participating in preparing the test plan
Preparing test scenario, test cases.
Defect tracking
Preparing suggestions to improve the quality
Communication with test lead/Test manager
Conducting review meeting with the team
Image source : Google
Software Tester Roles Software Tester Roles
A Software tester (software test engineer) should be capable of He may have to interact with the clients to better understand the
designing test suites and should have the ability to understand usability product requirements or in case the design requires any kind of
issues. modifications.
Such a tester is expected to have sound knowledge of software test Software Testers are often responsible for creating test-product
design and test execution methodologies. documentation and also has to participate in testing related walk
It is very important for a software tester to have great communication through.
skills so that he can interact with the development team efficiently. Creation of test designs, test processes, test cases and test data.
A Software Tester is responsible for designing testing scenarios for Carry out testing as per the defined procedures.
usability testing. Participate in walkthroughs of testing procedures.
He is responsible for conducting the testing, thereafter analyze the Prepare all reports related to software testing carried out.
results and then submit his observations to the development team.
Image source : Google
Ensure that all tested related work is carried out as per the defined
Image source : Google
standards and procedures
White Box Testing and Black Box White Box Testing - BASIS PATH TESTING
White-box testing, sometimes called glass-box testing, is a test case design The basis path method enables the test case designer to derive a logical
method that uses the control structure of the procedural design to derive test complexity measure of a procedural design and use this measure as a guide
cases for defining a basis set of execution paths.
Guarantee that all independent paths within a module have been exercised at This method is used to select values for test cases
least once Whatever methods & techniques we are going to see will help us to select
exercise all logical decisions on their true and false sides data/test cases for testing software
execute all loops at their boundaries and within their operational bounds The quality of test cases selected helps testers to ensure that the software
exercise internal data structures to ensure their validity. is working according to specifications given
Basis path testing is a white-box testing technique , in which Test cases derived
to exercise the basis set are guaranteed to execute every statement in the
program at least one time during testing.
Image source : Google Image source : Google
White Box Testing - flow graph notation White Box Testing - Cyclomatic Complexity
Cyclomatic complexity is a software metric that provides a quantitative
measure of the logical complexity of a program.
When used in the basis path testing method, the value computed for
cyclomatic complexity defines the number of independent paths in the basis
set of a program
Cyclomatic complexity provides us with an upper bound for the number of
tests that must be conducted to ensure that all statements have been
executed at least once.
An independent path is any path through the program that introduces at least
one new set of processing statements or a new condition.
Image source : Google
Image source : Roger Pressman, Software engineering- -Hill International Editions
White Box Testing - Cyclomatic Complexity White Box Testing
Cyclomatic complexity, V(G), for a flow graph, G, is defined as V(G) = E - N + 2 ,
where E is the number of flow graph edges, N is the number of flow graph
nodes.
Cyclomatic complexity, V(G), for a flow graph, G, is also defined as
V(G) = P + 1 , where P is the number of predicate nodes contained in the flow
graph G
The flow graph has four regions.
V(G) = 11 edges - 9 nodes + 2 = 4.
V(G) = 3 predicate nodes + 1 = 4.
Image source : Google
Image source : Roger Pressman, Software engineering- -Hill International Editions
White Box Testing - Cyclomatic Complexity White Box Testing - CONTROL STRUCTURE TESTING
Condition Testing: Condition testing is a test case design method that
exercises the logical conditions contained in a program module.
Branch testing: compound condition C, the true and false branches of C and
every simple condition in C need to be executed at least once
True False
Condition
Boolean expression with n variables, all of 2^n possible tests are required
(where n>0)
Image source : Google
Image source : Roger Pressman, Software engineering- -Hill International Editions
White Box Testing - CONTROL STRUCTURE TESTING White Box Testing - CONTROL STRUCTURE TESTING
Data Flow Testing: The data flow testing method selects test paths of a Loop Testing: Loop testing is a white-box testing technique that focuses
program according to the locations of definitions and uses of variables in exclusively on the validity of loop constructs.
the program. Simple loops:
Data Flow Testing is a type of structural testing. 1. Skip the loop entirely.
It has nothing to do with data flow diagrams. 2. Only one pass through the loop.
It is concerned with: 3. Two passes through the loop.
Statements where variables receive values 4. m passes through the loop where m < n.
Statements where these values are used or referenced 5. n - 1, n, n + 1 passes through the loop
Nested loops
It can be to find out : Concatenated loops
- A variable is defined but not used or referenced Unstructured loops
- A variable is used but never defined
Image source : Google Image source : Google
- A variable is defined twice before it is used
Black Box Graph: Nodes and Edges
Black-box testing/behavioral testing/Functional testing, focuses on the Node represents : statement, State, Method,, Basic block
functional requirements of the software. Edge represents: Branch, Transition, Method call
Black-box testing is not an alternative to white-box techniques. Rather, it is a
complementary approach that is likely to uncover a different class of errors
than white-box methods.
Black-box testing attempts to find errors in the following categories:
Incorrect or missing functions
interface errors
errors in data structures or external database access
behavior or performance errors
initialization and termination errors.
Image source : Google Image source : Google
Graph: Nodes and Edges Equivalence Partitioning
A test path represents the execution test cases: Equivalence partitioning is a black-box testing method that divides the input
- Some test paths can be executed by many test cases domain of a program into classes of data from which test cases can be
- Some test paths cannot be executed by any test cases derived.
- Some test paths cannot be executed because they are infeasible An equivalence class represents a set of valid or invalid states for input
conditions.
- Minimal set of test paths = the fewest test paths that will satisfy test Typically, an input condition is either a specific numeric value, a range of
requirements values, a set of related values, or a Boolean condition.
For example , if a system accepts names with character ength between 6 to 12
characters then input data will be divided into 3 classes
1. strings having length less than 6 i.e. invalid range
2. strings having length between 6 to 12 i.e. valid range
Image source : Google
3. string having length greater than 12 i.e. invalid range Image source : Google
Boundary Value Analysis
Boundary value analysis leads to a selection of test cases that exercise
bounding values.
Boundary value analysis is a test case design technique that complements
equivalence partitioning.
Rather than selecting any element of an equivalence class, BVA leads to the
selection of test cases at the "edges" of the class.
If an input condition specifies a range bounded by values a and b, test cases
should be designed with values a and b and just above and just below a and b.
For example, if a system expected to works fine for 5000 users then it will be
tested for 4999 users and performance will be checked.
Image source : Google