ST - Module 4: Test Selection & Minimization For Regression Testing Regression Testing
ST - Module 4: Test Selection & Minimization For Regression Testing Regression Testing
ST - Module 4: Test Selection & Minimization For Regression Testing Regression Testing
Example:
• Assume that in a given release of a product, there were three defects—D1, D2, and
D3.
• When these defects are reported, the development team will fix these defects and
the testing team will perform tests to ensure that these defects are indeed fixed.
• When the customers start using the product (modified to fix defects D1, D2, and
D3), they may encounter new defects—D4 and D5.
• Again, the development and testing teams will fix and test these new defect fixes.
• But, in the process of fixing D4 and D5, as an unintended side-effect, D1 may
resurface.
• Thus, the testing team should not only ensure that the fixes take care of the
defects they are supposed to fix, but also that they do not break anything else
that was already working.
1. Avo Assure
• It is a technology agnostic (cross-compatible), no-code test automation solution
that helps test end-to-end business processes with a few clicks of the buttons.
This makes regression testing more straightforward and faster.
Features
• Autogenerate test cases with a 100% no-code approach.
• Test across the web, desktop, mobile, ERP applications, Mainframes, associated
emulators, and more with a single solution.
• Enable accessibility testing.
• Execute test cases in a single VM independently or in parallel with Smart
Scheduling
• Integrate with Jira, Jenkins, ALM, QTest, Salesforce, Sauce Labs, TFS, etc.
3. testRigor
• testRigor helps you to directly express tests as executable specifications in plain
English.
• Users of all technical abilities are able to build end-to-end tests of any
complexity covering mobile, web, and API steps in one test.
• Test steps are expressed on the end-user level instead of relying on details of
implementation like XPaths or CSS Selectors.
Features
• Free forever public version
• Test cases are in English
• Unlimited users & Unlimited tests
• The easiest way to learn automation
• Recorder for web steps
• Integrations with CI/CD and Test case management
• Email & SMS testing
• Web + Mobile + API steps in one test
4. Eggplant
• Eggplant’s AI-driven test automation streamlines regression testing through
prioritization of test cases and minimization of test maintenance.
Features
• A.I.-driven test execution enables Eggplant to test the most important areas of
each release.
• Reuse testing models and scripts to test multiple versions with one set of assets.
• Reduce the burden of test maintenance through self-healing functional tests.
• Discover bugs otherwise miss through automated exploratory testing.
• Understand and focus in on problematic areas of your application that put your
release at risk.
• Reduce the time required to test key functionality of applications after updates.
5. Selenium:
• This is an open-source tool used for automating web applications.
• Selenium can be used for browser-based regression testing.
6. Quick Test Professional (QTP):
• HP Quick Test Professional is automated software designed to automate
functional and regression test cases.
• It uses VBScript language for automation.
• It is a Data-driven, Keyword based tool.
7. Rational Functional Tester (RFT):
• IBM’s rational functional tester is a Java tool used to automate the test cases of
software applications.
• This is primarily used for automating regression test cases and it also integrates
with Rational Test Manager.
Execution Trace
• Let P be a program containing one or more functions. P has been tested against
tests in T as shown previously.
• P is modified to P' by adding new functionality and fixing some known errors.
• Our goal now is to test P' to ensure that the changes made do not affect the
functionality carried over from P.
• While this could be achieved by executing P' against all the non-obsolete tests in T,
we want to select only those that are necessary to check if the modifications made
do not affect functionality common to P and P'
• Our first technique for selecting a subset of T is based on the use of execution slice
obtained from the execution trace of P. The technique can be split into two phases:
o In the first phase, P is executed and the execution slice recorded for each test
case in Tno = Tu ∪ Tr
o Tno contains non-obsolete test cases and hence is a candidate for full
regression test.
o In the second phase, the modified program P' is compared with P and Tr is
isolated from Tno by an analysis of the execution slice obtained in the first
phase.
• Let 𝐺 = (𝑁, 𝐸) denote the CFG of program P.
• N is a finite set of nodes and E a finite set of edges connecting the nodes.
• Suppose that nodes in N are numbered 1, 2, and so on and that Start and End are
two special nodes.
• Tno is the set of all valid tests for P’. It is obtained by discarding all tests that have
become obsolete for some reason.
• An execution trace of program P for some test t in Tno is the sequence of nodes in
G traversed when P is executed against t.
• As an example, consider the following program:
• Let test(n) denote the set of tests such that each test in test(n) traversed node n at
least once.
• Given the execution trace for each test in 𝑇𝑛𝑜 (set of non-obsolete tests), it is easy
to find 𝑡𝑒𝑠𝑡(𝑛) for each 𝑛 ∈ 𝑁. 𝑡𝑒𝑠𝑡(𝑛) is also known as test vector
corresponding to node n.
• Test vectors for each node in the CFGs shown previously:
1 2
• Next, node 3 is added. This node is data dependent on node 1. Hence an edge is
added from node 3 to node 1.
1 2 3
• Node 3 is also control dependent on node 2 and hence an edge, indicated as a
dotted line, is added from node 3 to node 2.
• Node 4 is added next and data and control dependence edges are added,
respectively, from node 4 to node 1 and to node 3.
• The process continues as described until the node corresponding to the last
statement in the trace, i.e., at line 8, is added. The final DDG is as shown:
Slicing
• Slicing or program slicing is a technique used in software testing which takes a slice
or a group of program statements in the program for testing particular test
conditions or cases and that may affect a value at a particular point of interest.
• It can also be used for the purpose of debugging in order to find the bugs more
easily and quickly.
• There are 2 types of slicing: static slicing and dynamic slicing
Static Slicing Dynamic Slicing
A static slicing of a program contains all A dynamic slice of a program contains
statements that may affect the value only the statements that actually affect
of a variable at any point for any the value of a variable at any point for a
execution of the program. particular execution of the program.
Static slices are generally larger. Dynamic slices are generally smaller.
Results are generally not useful Results are useful for applications like
debugging and testing
• From the example shown in the next page, we observe that static slice takes all the
possible execution of the program which may affect the value of the variable sum.
• Whereas in case of dynamic slicing, it considers only a particular execution (when n
= 22) of the program which may affect the value of the variable sum.
Hence, dynamic slice is always smaller than a static slice.
o Method 2
▪ Prior to planned testing.
▪ This will enable gaining better clarity on requirements and assessing the
quality of the product upfront.
• The following figure shows the various steps of ad hoc testing and illustrates the
basic differences between ad hoc testing and planned testing.
• One of the most fundamental differences between planned testing and ad hoc
testing is that test execution and test report generation takes place before
test case design in ad hoc testing.
• This testing gets its name by virtue of the fact that execution precedes design.
• Drawbacks of Ad-Hoc Testing and their Resolution
Difficult to ensure that the learnings • Document ad hoc tests after test
gained in ad hoc testing are used in future. completion.
• Schedule a meeting to discuss
Large number of defects found in ad hoc defect impacts
testing • Improve the test cases for planned
testing
• When producing test reports
combine planned test and ad hoc
Lack of comfort on coverage of ad hoc
test
testing
• Plan for additional planned test
and ad hoc test cycles
• Write detailed defect reports in a
step-by-step manner
Difficult to track the exact steps
• Document ad hoc tests after test
execution
• Plan the metrics collection for both
Lack of data for metrics analysis
planned tests and ad hoc tests
Pair Testing
• Here, 2 testers pair up to test a product's feature on the same machine.
• The objective of this exercise is to maximize the exchange of ideas between the
two testers.
• When one person is executing the tests, the other person takes notes.
• The other person suggests an idea or helps in providing additional perspectives.
• Example: two people traveling in a car in a new area to find a place, with one
person driving the car and another person navigating with the help of a map.
Exploratory Testing
• Exploratory testing tries to
o explore the product,
o covering more depth and breadth
o with specific objectives, tasks, and plans.
• Exploring can happen not only for functionality but also for different
environments, configuration parameters, test data, and so on.
• Since there is large creative element to exploratory testing, similar test cases may
result in different kinds of defects when done by two different individuals.
• Example: The person driving a car will use various common techniques to reach a
new place, such as:
o Getting a map of the area
o Traveling in some random direction to figure out the place
o Calling up and asking a friend for the route
o Asking for directions by going to a nearby gas station
• Several ways to perform exploratory testing:
o Guesses:
▪ These are used to find the part of the program that is likely to have
more errors.
▪ Previous experience on working with a similar product or software or
technology helps in guessing.
o Discussions:
▪ Exploration may be planned based on the understanding of the system
during project discussions or meetings.
▪ It brings various presentations of the product implementation such as
architecture and design presentations, or even presentations made to
customers.
Iterative Testing
• The iterative (or spiral) model is where the requirements keep coming and the
product is developed iteratively for each requirement.
• The testing associated for this process is called iterative testing.
• Biggest challenge in this model is in ensuring that all the requirements that are
tested continue to work when a new requirement is given.
• Hence, iterative testing requires repetitive testing.
• As the new requirements may involve a large number of changes at the product
level, the majority of these tests are executed manually because automation in
this case is very difficult.
• Iterative testing aims at testing the product for all requirements, irrespective of
the phase they belong to in the spiral model.
• Customers have a usable product at the end of every iteration.
• Product undergoes all the phases of the life cycle each time.
• Errors due to omission and misunderstanding can be corrected at regular intervals.
• Customers and the management can notice the impact of defects and the product
functionality at the end of each iteration.
• A test plan is created at the beginning of the first iteration and updated for every
subsequent iteration.
• This can broadly define the type and scope of testing to be done for each of the
iterations.
• Some type of tests that are performed in later iterations may not be possible to
perform during earlier iterations.
• For example, performance or load testing may come under the scope of testing
only during the last few iterations when the product becomes complete.
• Hence test plan preparation becomes an important activity during the beginning
phase.
• This document gets updated after each iteration since the scope of testing, type
of testing, and the effort involved vary.
• After each iteration, unit test cases are added, edited, or deleted to keep up with
the revised requirement for the current phase.
• Regression tests may be repeated at least every alternate iteration (if not every
iteration) so that the current functionality is preserved.
• Since iterative testing involves repetitive test execution, it becomes a tiresome
exercise for the testers.
• In order to increase test efficiency, tests may be automated, wherever possible.
Defect Seeding
• Defect seeding is also known as Bebugging.
• It acts as a reliability measure for the release of the product.
• Usually, one group of members in the project injects the defects while another
group tests to remove them.
• While finding the known seeded defects, the unseeded/unearthed defects may
also be uncovered.
• Known bugs are randomly added to a program source code and the software
tester is tasked to find them.
• The percentage of the known bugs not found gives an indication of the real bugs
that remain.
• Defects that are seeded are similar to real defects. Therefore, they are not very
obvious and easy to detect.
• Defects that can be seeded may vary from severe or critical defects to cosmetic
errors.
• Defect seeding may act as a guide to check the efficiency of the inspection or
testing process.
• It serves as a confidence measure to know the percentage of defect removal rates.
• It acts as a measure to estimate the number of defects yet to be discovered.
For example
• Assume that 20 defects that range from critical to cosmetic errors are seeded on a
product.
• Suppose when the test team completes testing, it has found 12 seeded defects and
25 original (not seeded) defects.
• The total number of defects that may be latent (hidden) in the product is
calculated as follows.
𝐷𝑒𝑓𝑒𝑐𝑡𝑠 𝑠𝑒𝑒𝑑𝑒𝑑
𝑻𝒐𝒕𝒂𝒍 𝒍𝒂𝒕𝒆𝒏𝒕 𝒅𝒆𝒇𝒆𝒄𝒕𝒔 = ∗ 𝑂𝑟𝑖𝑔𝑖𝑛𝑎𝑙 𝑑𝑒𝑓𝑒𝑐𝑡𝑠 𝑓𝑜𝑢𝑛𝑑
𝑆𝑒𝑒𝑑𝑒𝑑 𝑑𝑒𝑓𝑒𝑐𝑡𝑠 𝑓𝑜𝑢𝑛𝑑
The following are the issues to be looked into while using defect seeding:
1. Care should be taken during the defect seeding process to ensure that all the
seeded defects are removed before the release of the product.
2. The code should be written in such a way that the errors introduced can be
identified easily.
Minimum number of lines should be added to seed defects so that the effort
involved in removal becomes reduced.