Software Testing Techniques and Strategies
Software Testing Techniques and Strategies
SOFTWARE AUTOMATION
AND
TESTING
UNIT II
Flow graphs and Path testing: Basics concepts of path testing, predicates, path
predicates and achievable paths, application of path testing.
Data Flow Testing: Basics of Data flow Testing Logic Based Testing : Decision
Tables
UNIT IV
• Software Testing Methodology, Defects hard to find, Verification and validation,
Functional and structural, Defects and Failures, Testing that parallels the software
Development process, Workbench concept, Eight Consideration of software
testing methodology, testing tactics checklist. Importance of Agility, Building an
Agile Testing Process ref boris beizer 3
• UNIT V
• Software Testing Techniques, Black-box, Boundary value, Branch coverage, Cause
Effect graphing, CRUD, Database, Histogram, Gray box, Inspections, JADs, Pareto
Analysis , Prototyping , Random Testing, Risk based testing , Regression Testing,
Structured walkthroughs, Thread testing , Performance testing, Stress Testing,
Accepting Testing, White box testing, Alpha and Beta Testing.
• UNIT VI
Graph matrices and application: Motivational overview, matrix of graph, relations,
power of a matrix, node reduction algorithm.
Need for Automated testing tools, Taxonomy of Testing Tools, Exposure to Software
Testing Tools: Load Runner, UFT and QTP.
• REFERENCES
• Software Testing Techniques ,by Bories Beizer, Second Edition,Dreamtech Press
• Testing and Quality Assurance for Component based software ,by Gao,Tsao and
Wu,Artech House Publishers
• Managing the Testing Process,by Rex Black,Wiley.
• Handbook of Software Quality Assurance, by [Link] Schulmeyer,James [Link],2 nd
Edition,International Thomson Computer Press
ref boris beizer 5
L1
Unit-1
Definitions:
The test engineers need to understand the application well, study the software
functionality in detail to find out where the bugs are likely to occur, study the code
to ensure that each and every line of code is tested, create test cases in such a way
that testing is done rigorously to uncover the hidden bugs and also ensure that the
software is usable and reliable.
Characteristics:
Learn about the development environment: Based on the application and the
end user needs, the development environment varies- the os may be windows or
unix or linux , the programming language may be c , C++ or java etc etc
ref boris beizer 8
Characteristics of Test Engineer L1
Learn how to use the application: The test engineer has to assume that he is
the end user and run the application to get feel of how the software works, only
then he will be in position to generate the test cases and also create automated test
procedures.
Study the source code: If the test engineer asked to validate the source code
also , he need to study the source code based on which the test case generation
has to be done.
Study the requirement specification document: The SRS document gives the
functional, performance and reliability requirements of the software.
the software has to be tested for all these requirements.
You need to be eagle eyed and look for detail while studying the
specifications and check whether the requirements can be tested or not.
If SRS document says, the transaction response should be very fast- it does
not mean anything? You should tell the person who wrote the specification to
indicate the value say 10 seconds. Then only you can test performance test.
Metrics are very important. ref boris beizer 9
Characteristics of Test Engineer L1
Study the acceptance test procedure: The ATP document gives the test plan
based on which the user will validate the software.
The test engineers need to carry out the testing as per the ATP document.
The ATP document has to be prepared by the development team and the
testing team in association with the customer representative.
Requirement Analysis:
During this phase, test team studies the requirements from a testing point of view to identify
the testable requirements.
The QA team may interact with various stakeholders (Client, Business Analyst, Technical
Leads, System Architects etc) to understand the requirements in detail.
Requirements could be either Functional (defining what the software must do) or Non
Functional (defining system performance /security availability ) .
Automation feasibility for the given testing project is also done in this stage .
Activities
Identify types of tests to be performed.
Gather details about testing priorities and focus.
Prepare Requirement Traceability Matrix (RTM).
Identify test environment details where testing is supposed to be carried out.
Automation feasibility analysis (if required).
Deliverables
RTM
Automation feasibility report. (if applicable)
Test Planning
Activities
Preparation of test plan/strategy document for various types of testing
Test tool selection
Test effort estimation
Resource planning and determining roles and responsibilities.
Training requirement
Deliverables
Test plan /strategy document.
Effort estimation document
This phase involves creation, verification and rework of test cases & test scripts.
Test data , is identified/created and is reviewed and then reworked as well.
Activities
Deliverables
Test cases/scripts
Test data
Activities
Understand the required architecture, environment set-up and prepare hardware and
software requirement list for the Test Environment.
Setup test Environment and test data
Perform smoke test on the build
Deliverables
Environment ready with test data set up
Smoke Test Results.
Test Execution
During this phase test team will carry out the testing based on the test plans and the test cases
prepared.
Bugs will be reported back to the development team for correction and retesting will be
performed.
Activities
Activities
Deliverables
Test Closure report
Test metrics
ref boris beizer 17
Levels of Testing
L1
During the design stage, the software is divided into modules and each module is
divided into units.
While testing it is no good if one combines all the units into modules and all the
modules into the system and then starts testing the entire system.
A practical approach is to divide the testing process into different levels. To start
with, each unit has to be tested separately and then the modules have to be built from
the units and the module are tested, then the modules are combined together and the
system is built and tested.
unit testing is done to test the source code , integration testing is done to test design
and system testing is to done to test SRS, and finally acceptance testing is done to test
the client/user requirements.
Unit Testing:
A unit is the smallest entity in the software
Every unit has to be tested seperately to check whether it is as per the
specifications
As it is not possible to test a unit individually, additional piece of code may need
to be written to test the units.
unit testing is normally done by the development engineers themselves.
Module Testing:
A Module is an independent entity in the software
The tested units are integrated into a module and each module is tested separately
for the specifications.
For instance, if the software is a database management system, the modules can be
data base(back end) and user interface (front end ).
The database can be tested seperately using the SQL commands to check the correct
data retrieval.
After testing the module, a module level test report has to be prepared. Once every
module is working as per requirements, the beizer
ref boris next phase of testing will start i.e 20
integration and system testing.
Levels of Testing L1
Acceptance Testing:
After the system testing is completed, the software is tested by the client/[Link]
is known as acceptance testing.
Acceptance testing can be done either at the developer’s premises or client
premises.
Module
Test
Plan
Combine
Inter Connect
Test Unit Units into Module Test
Modules
modules
Acceptance
System Test
Test
System Acceptan
Test ce Test
Plan Plan
Client
SRS Requirem
ent
ref boris beizer
22
Testing Approaches L1
In a large software project, it is impractical to integrate all the modules in one shot
and start testing the software as a whole.
The system has to be built in stages and the product has to be built incrementally
Such a systematic approch helps in easier debugging
Approches:
Test cases based on specifications and internals of modules are not considered.
This type of testing is known as Black box testing
Structural testing is used to test the implementation of the program, here the source
code is looked into for testing the software.
Structural testing involves (a) Statement coverage (b) branch coverage ( c) Path
coverage
Mutation Testing:
Mutation testing is required to ensure that the software does not fail.
It is a good debugging mechanism
After the software works correctly, mutation testing can be done to simulate
wrong inputs
in mutation testing, program is modified ( or logic is changed) slightly to obtain
mutants of the program
Different mutants are tested with the same test cases
if the mutants fails, and the actual program works correctly, confidence is gained
in the program and test cases are considered as good i.e different mutants should give
different results ref boris beizer 24
Testing Approaches L1
Input x;
y=x**2;
print y;
if(y==100)
print “Alarm: x value is 10”;
Initially, you wrote the program which takes a number as input, squares the number
and check whether the square of the number is 100 or not.
If it is 100, it prints an alarm.
Suppose late on, you change the logic and calculate the value of y as cube of x
instead of square of x
You may simply change the second line as y=x*x*x;
Suppose you now test your program by giving some inputs 2,6, and 8 and find
that program works, strictly it wont work.
Because you need to change the if statement
ref boris beizer 26
Test Case L1
Test cases can be defined as sets of inputs parameters for which the software
will be tested.
Below fig shows the Testing process using test cases
Test cases have to be designed based on two criteria : reliability and validity.
A set of test cases is considered to be reliable, if it detects all errors
A set of test cases is considered as valid if at least one test case reveals the
errors
Techniques used for selecting the Test Cases:
Equivalence class partitioning : In this technique all possible valid and valid
outputs are identified
The test cases consists of both valid inputs and invalid inputs
Boundary Value Analysis: Values that are on the boundary of the
equivalence classes are high yield test cases.
Cause Effect Graphing: In this approach for each cause(inputs) and effects
(outputs) is identified and a cause effect graph is drawn.
6. Test Environment: Required Hardware and Software to execute this test case
[Link] Effort (Person/Hour): Time required to execute this test case (E.g. 20
minutes on an average)
2) Introduction:
Describe the purpose of the plan, possibly identifying the level of the
plan(system test plan etc..).
This is essentially the executive summary part of the plan
3) Test items:
There are things you intend to test within the scope of this test plan
4)References:
List all documents that support this test plan. Refer to the actual
version/Release number of the document as stored in the configuration
management system ref boris beizer 34
Test Plan L1
5)Features to be tested:
This is a listing of what is to be tested from the users viewpoint of what the
system does.
This is not a technical description of the software, but a users view of the
functions
6) Features not to be Tested:
This is a listing of what is Not to be tested from both users viewpoint of
what the system does and a configuration management/version control view.
This is not a technical description of the software, but a users view of the
functions
7) Test Approach:
This is your overall test strategy for this test plan. It should be appropriate to
the level of the plan(master,acceptance,etc) and should be in agreement with
all higher and lower levels of plans. Overall rules and processes should be
identified.
8) Entry Criteria:
It describes when to start testing
9)Exit Criteria:
It describes when to stop testing
10) Suspension criteria
It describes when to stop testing temporarily
11)Roles and Responsibilities:
Team leader or test lead and team members roles and responsibilities
12) Schedule:
Schedule for all test activities in this software test process
13)Training:
Training on the application /system (DomainTesting)
Training for any test tools to be used
14) Test Environment/lab
It describes required hardware and software for setting –up test environment
or test lab
ref boris beizer 36
Test Plan L1
• Statistics:
• QA costs: 2% for consumer products
80% for critical software
• Quality Productivity
Bug prevented rework effort is saved [bug reporting, debugging, correction, retesting]
If it is not possible, Testing must reach its secondary goal of bud discovery.
Good test design & tests clear diagnosis easy bug correction
Phase 4: A state of mind regarding “What testing can do & cannot do. What makes
software testable”.
Applying this knowledge reduces amount of testing.
Testable software reduces effort
Testable software has less bugs than the code hard to test
Cumulative goal of all these phases:
Cumulative and complementary. One leads to the other.
Phase2 tests alone will not show software works
Use of statistical methods to test design to achieve good testing at acceptable risks.
Most testable software must be debugged, must work, must be hard to break.
Inspection is also called static testing.
Methods and Purposes of testing and inspection are different, but the objective is to
catch & prevent different kinds of bugs.
To prevent and catch most of the bugs, we must
Review
Inspect &
Read the code
Do walkthroughs on the code
Bug Prevention
Mix of various approaches, depending on factors
culture, development environment, application, project size, history, language
Inspection Methods
Design Style
Static Analysis
Pesticide paradox
Complexity Barrier
ref boris beizer 44
Dichotomies
Dichotomies
3. Designer vs Tester
6. Buyer vs Builder
Testing is to find bugs.
Debugging is to find the cause or misconception leading to the bug.
Their roles are confused to be the same. But, there are differences in goals, methods and
psychology applied to these
# Testing Debugging
1 Starts with known conditions. Uses predefined Starts with possibly unknown initial conditions.
procedure. Has predictable outcomes. End cannot be predicted.
2 Planned, Designed and Scheduled. Procedures & Duration are not constrained.
5 Should be predictable, dull, constrained, rigid & There are intuitive leaps, conjectures,
inhuman. experimentation & freedom.
# Testing Debugging
6 Much of testing can be without design knowledge. Impossible without a detailed design knowledge.
7 Can be done by outsider to the development team. Must be done by an insider (development team).
8 A theory establishes what testing can do or cannot There are only Rudimentary Results (on how much
do. can be done. Time, effort, how etc. depends on
human ability).
Functional Testing: Treats a program as a black box. Outputs are verified for conformance to specifications
from user’s point of view.
Structural Testing: Looks at the implementation details: programming style, control method, source
language, database & coding details.
Interleaving of functional & Structural testing:
A good program is built in layers from outside.
Outside layer is pure system function from user’s point of view.
Each layer is a structure with its outer layer being its function.
Examples:
Application2
Malloc()
Link block()
User Devices
O.S.
Application1
ref boris beizer 48
Dichotomies
Interleaving of functional & Structural testing: (contd..)
For a given model of programs, Structural tests may be done first and later the Functional, Or vice-
versa. Choice depends on which seems to be the natural choice.
Both are useful, have limitations and target different kind of bugs. Functional tests can detect all
bugs in principle, but would take infinite amount of time. Structural tests are inherently finite, but
cannot detect all bugs.
The Art of Testing is how much allocation % for structural vs how much % for functional.
3. Designer vs Tester
Completely separated in black box testing. Unit testing may be done by either.
Artistry of testing is to balance knowledge of design and its biases against ignorance & inefficiencies.
Tests are more efficient if the designer, programmer & tester are independent in all of unit, unit
integration, component, component integration, system, formal system feature testing.
The extent to which test designer & programmer are separated or linked depends on testing level and
the context.
3 Tries to do the job in simplest & cleanest way, Tester needs to suspicious, uncompromising, hostile and
trying to reduce the complexity. obsessed with destroying program.
ref boris beizer 50
Dichotomies
Dichotomies contd..
5. A module implies a size, an internal structure and an interface, Or, in other words.
6. A module (well defined discrete component of a system) consists of internal complexity & interface
complexity and has a size.
So:
Optimize the size & balance internal & interface complexity to increase efficiency
Optimize the test design by setting the scopes of tests & group of tests (modules) to minimize cost of test
design, debugging, execution & organizing – without compromising effectiveness.
# Small Big
1 More efficiently done by informal, intuitive A large # of programmers & large # of components.
means and lack of formality –
if it’s done by 1 or 2 persons for small &
intelligent user population.
2 Done for e.g., for oneself, for one’s office or for Program size implies non-linear effects (on complexity,
the institute. bugs, effort, rework quality).
3 Complete test coverage is easily done. Acceptance level could be: Test coverage of 100% for
unit tests and for overall tests ≥ 80%.
Buyer & Builder being the same (organization) clouds accountability.
Separate them to make the accountability clear, even if they are in the same organization.
The accountability increases motivation for quality.
The roles of all parties involved are:
Builder:
Designs for & is accountable to the Buyer.
Buyer
Buyer:
Pays for the system.
Hopes to get profits from the services to the User.
User
User:
User
Ultimate beneficiary of the system.
system
Interests are guarded by the Tester.
Tester
Tester:
Tester
Dedicated to the destruction of the s/w (builder)
Tests s/w in the interests of User/Operator.
Operator:
Lives with: Mistakes of the Builder Murky specs of Buyer
Oversights of Tester Complaints of User
ref boris beizer 54
Consequences of Bugs
Consequences: (how bugs may affect users)
• Mild
• Aesthetic bug such as misspelled output or mal-aligned print-out.
• Moderate
• Outputs are misleading or redundant impacting performance.
• Annoying
• Systems behavior is dehumanizing for e.g. names are truncated/modified arbitrarily, bills for
$0.0 are sent.
• Till the bugs are fixed operators must use unnatural command sequences to get proper
response.
• Disturbing
• Legitimate transactions refused.
• For e.g. ATM machine may malfunction with ATM card / credit card.
• Serious
• Losing track of transactions & transaction events. Hence accountability is lost.
ref boris beizer 55
Consequences of Bugs
Consequences contd …
• Very serious
System does another transaction instead of requested e.g. Credit another account,
convert withdrawals to deposits.
• Extreme
• Frequent & Arbitrary - not sporadic & unusual.
• Intolerable
• Long term unrecoverable corruption of the Data base.
(not easily discovered and may lead to system down.)
• Catastrophic
• System fails and shuts down.
• Infectious
• Corrupts other systems, even when it may not fail.
Assignment of severity
• Assign flexible & relative rather than absolute values to the bug (types).
• Number of bugs and their severity are factors in determining the quality quantitatively.
• Organizations design & use quantitative, quality metrics based on the above.
• Nightmares
• Define the nightmares – that could arise from bugs – for the context of the
organization/application.
1. List all nightmares in terms of the symptoms & reactions of the user to their consequences.
2. Convert the consequences of into a cost. There could be rework cost. (but if the scope extends to the public,
there could be the cost of lawsuits, lost business, nuclear reactor meltdowns.)
3. Order these from the costliest to the cheapest. Discard those with which you can live with.
4. Based on experience, measured data, intuition, and published statistics postulate the kind of bugs
causing each symptom. This is called ‘bug design process’. A bug type can cause multiple symptoms.
5. Order the causative bugs by decreasing probability (judged by intuition, experience, statistics etc.) . Calculate
the importance of a bug type as:
7. Design tests & QA inspection process with most effective against the most important
bugs.
8. If a test is passed or when correction is done for a failed test, some nightmares disappear.
As testing progresses, revise the probabilities & nightmares list as well as the test strategy.
• Designing a reasonable, finite # of tests with high probability of removing the nightmares.
• Test suites wear out.
• As programmers improve programming style, QA improves.
• Hence, know and update test suites as required.
ref boris beizer 59