You are on page 1of 6

A Strategy for Designing

and Executing an
Effective Regression
Test Program
1. Introduction that they cannot tolerate existing fea- new features or other code changes
This paper focuses on the area of tures not working on the new release. are being added.
regression testing. An industry-wide So, regression testing is recognised as
definition of regression test is “retest- being very important, yet it often • Although you may build up a library
ing of a previously tested program fol- remains the test phase given the least of regression tests over time, and this
lowing modification to ensure that attention in the planning of test activi- library can be quite extensive, they
faults have not been introduced or ties. Too often, organizations take the can also prove troublesome as they
uncovered as a result of the changes easy way out and regression test phases contain both redundant test suites &
made.” simply consist of reruns of existing test test cases which themselves contain
suites in the hope that these will catch errors. There can be a huge overhead
We have adapted this slightly for the all the problems. This approach has a in maintaining this library of regres-
type of testing we perform to give the number of potential flaws: sion suites and test cases.
following definition: “a test designed to
confirm that an existing feature still • If you are dealing with a large com- So, an unplanned approach to regres-
performs correctly after any software plex system, you can end up with sion testing can lead to inefficient use of
modifications.” thousands upon thousands of regres- resources. If you take the time to plan
sion tests as you continue to add fea- your regression test program, there are a
Both these definitions provide the read- ture test suites from previous releas- number of questions you need to ask:
er with a sense of the importance of es to the regression program for your
regression testing. It is of no benefit current release. This is all well and • What do I need to test?
providing your valued customer with good if you have a fully automated • How long is it going to take?
lots of new and exciting features if you and stable test environment, which • What resources are required?
manage to break features they have allows you to run all these tests • What tools are required?
been using successfully for the last quickly without using a lot of • Are there any other special
number of years. In fact, some feedback resources. requirements?
received from a customer several years
back indicated that they expect to have • You may not have the required cov- The first question on this list is the most
problems with new features when they erage with your existing test suites to important one to answer, as it will help
first get a new release of software, but find problems being introduced as answer the remaining questions. Apart

September/December 2001 http://www.testinginstitute.com Journal of Software Testing Professionals 1


from being the most impor- 100% sure that we have
tant question it is also the full coverage, as the
most difficult to answer. method of selecting the
regression tests was
2. Understanding Our purely to try and cover
Problem the basic functionality of
We are involved in sub-sys- the MSC.
tem and system testing of
software releases for a We have been perform-
Mobile Switching Centre ing Escaped Defect
(MSC). We test in both an Analysis & Root Cause
MSC-only configuration and Analysis on problems
also in a full cellular system that escape to our cus-
configuration with other net- tomers, and this showed
work elements. Over the past us a number of things in
3 years the complexity of the relation to our regression
features being developed for testing:
the MSC has increased
tremendously as we move away from allowing them to be fixed early. This • We were good at testing new feature
MSC-only features to features that span then reduces the risk of impacting and enhancements but problems
several network elements. Our regres- quality with fixes having to be made escaped in other areas that should
sion testing is a mixture of automated to the release late in the cycle prior to have been covered by our regression
(30%), semi-automated (30%) and customer deployment. testing.
manual (40%).
• We had an increasing number of • By simply re-running existing
On our current release of MSC soft- regression tests per release, as we regression suites, we could not hope
ware, we decided to spend some time simply added new tests to cover new to catch most of the problems that
analysing the way we approached our features developed on the previous were escaping. Regression suites
regression testing. In general we had release we had tested. This increas- often covered the basic functionality
been taking an ad-hoc approach to plan- ing number of tests had turned our of a particular feature, so if a code
ning our regression test program for regression cycle into a 12-week change resulted in an impact outside
previous releases and our analysis interval on average and this was of this basic functionality, we did not
uncovered the following facts: increasing with every release. In fact, have the required coverage to catch
over a 6-year period our regression the problem.
• We are dealing with a legacy system; cycle had increase from 6 weeks to
there has been a lack of consistency the current average of 12 weeks. • Quite often, the solution to the
in the way features developed over Escaped Defect Analysis was just to
the years have been documented and • There was a lot of frustration among add a test to provide coverage for the
controlled. This has led to a lack of test engineers, as they were simply problem that escaped, thus increas-
traceability from existing test running regression tests for no appar- ing the number of regression tests
cases/suites to old feature/functional ent reason except we did it on the last even further. Clearly it would be bet-
requirements. release so must do it again! More ter to try and detect the problem in
often or not, these tests would not the first place rather than adding a
• Consistently on all our releases, our even find any problems, so the frus- test just in case it re-occurred.
Problem Report (PR) arrival rate tration increased.
showed a straight-line increase with 3. A Time For Change
no levelling off towards the end of • Over the years we have built up an Once we had done the analysis, it was
our cycle as shown in Figure 1. A extensive library of regression tests time for some change. Quite simply we
‘normal’ PR arrival rate is one where through the addition of tests to cover could not continue the way we were
you are finding the majority of your new functionality. Even with this going.
problems early in your cycle, thus library of tests, we can never be

September/December 2001 http://www.testinginstitute.com Journal of Software Testing Professionals 29


Due to the effort involved Related impacts can be consid-
for older features and func- ered to be of lower priority and
tionality, we could not go tests for these features can be
back and resolve the prob- included in the Secondary
lem of poorly documented phase (refer to Section 4.).
and controlled requirements Where there are no impacts,
and the lack of traceability, the cell can be left blank.
so we had to work around
this in some way. 3.2 A Test Impacts Checklist
We used an existing Test
Why did our typical prob- Impacts Checklist. The devel-
lem arrival rate show a opment engineers are required
straight line for all our to complete this checklist for
releases? Some of it was every submission of code they
due to churn on the release, make to the software release.
i.e., features being added The checklist asks specific
late in our cycle causing questions that the developer
has to answer, and the test
new problems to be intro-
engineers can then use this
duced and found late in our
information to identify regres-
cycle or sometimes not at
sion impacts due to code
all. However, the major
changes not associated with a
finding was that we simply
the software, both for new features/ new feature or enhancement
had no strategy in terms of the way we (i.e. fixes, re-engineering). In our case,
executed our regression tests—engi- enhancements and any other changes
they were making (problem fixes, re- the checklist was broken down into sev-
neers simply took their suites, went into eral areas as follows:
our labs and started executing. We engineering work etc.).
decided that we needed a way of priori- Area of Impact: We were able to identi-
tising our tests and then to execute We used 2 ways of collecting this infor-
fy 8 main functional areas (including
based on the priority. mation:
call-processing, Billing, Fault Man-
agement & Statistics), and the develop-
While looking at the issue of the 3.1 A Regression Impacts Matrix.
er first has to indicate which area was
increasing number of tests per release, it We created a simple Regression
being impacted by their code change.
was clear that we had no regression Impacts Matrix that lists all existing This will then give the testers an idea of
selection criteria, except that we were features and areas of functionality. Each the type of regression test they might
trying to show that existing features and development team working on a new require.
functionality still worked. We decided feature or enhancement was then asked
we needed some way of reducing the to complete the matrix indicating the Description of Impact: They are then
amount of tests we were running by features and functionality both directly asked to describe the impact in their
identifying the tests that were actually and indirectly impacted by their code own words. This information helps fur-
necessary to run. When testing new fea- changes. Table 1 shows a sample ther define the regression test that might
tures you have requirements from Regression Impacts Matrix. be required.
which to work from in developing tests
and have a methodology that can be fol- It is quite simple in format and lists all Call Scenarios: Because a lot of our
lowed to create these tests. For regres- existing features and functionality testing involves call processing, devel-
sion we had nothing, so there was a along the top row with all new features opers are asked to identify specific call-
need to create some form of require- on the release being listed in the first scenarios that are impacted. Example
ments, which we could then use to iden- column. Where a new feature has an scenarios include: three-party confer-
tify the required regression testing. To explicit impact on an existing feature, encing, call forwarding, and hand-offs.
do this we needed specific information an ‘X’ is used to indicate the impact. Knowing the call-scenarios impacted
from the development organization on Where the impact is not explicit, an ‘R’ allows the tester to select these scenar-
the changes they were implementing in is used to indicate a related impact. ios from our existing suites of regres-

30 Journal of Software Testing Professionals http://www.testinginstitute.com September/December 2001


sion tests if they exist, or be in a posi- By using all the information provided will increase the possibility of detecting
tion to create new regression tests if by both the checklist and the matrix, problems due to those impacts. These
required. test engineers can then decide on the suites would also cover overall basic
regression testing required and allowed feature functionality thus giving a high
Area of Code Change: Developers are them to identify any required test envi- degree of confidence in the overall
asked whether the code change is in a ronment changes. This gives them a quality of the software release.
frequently executed leg of code, i.e., sense of ownership and purpose, and a
would every call-scenario be affected. chance to help design the regression 4.2 Secondary
This gives testers an idea of the likely program and make decisions them- The Secondary group consists of suites
complexity of the required regression selves rather than being simply told and test cases that are selected for exe-
test, as a code change in a less frequent- what regression suites to execute. cution based on the following criteria:
ly executed leg of code may require
additional effort to create the regression 4. The Regression Strategy • Suites that have repeatedly found
test. A strategy was needed to pull every- problems on previous releases – this
thing together so that: information was readily available
Recommended Regression Test: The from our Final Test Reports for pre-
developer is asked to recommend what a) We were consistent in our approach, vious releases.
regression testing would be required to b) It was repeatable, and
exercise both the code change itself and c) It led to focused regression testing • Suites that cover customer-sensitive
also functionality around the code taking place. functionality such as billing and sta-
change. Depending on the developer’s tistics.
experience, this information can again We came up with the following
be very useful to the tester. approach based on grouping our suites 4.3 Tertiary
into 3 main types and then executing The Tertiary group consists of suites
Features Impacted by Code Change: our regression tests in 3 phases: and test cases that are selected as fol-
Similar to the Regression Impacts lows:
Matrix, the developer must indicate 4.1 Primary
what features are impacted by the code The Primary group consists of suites • Hot-spot suites – these are selected
change. This will allow the tester to and test cases that are selected for exe- based on problems found by earlier
cross-check this with the Regression cution based on the following criteria: Primary and Secondary testing, i.e.
Impacts Matrix and they can determine you might wish to increase test cov-
if additional feature-specific regression • Providing coverage for areas directly erage due to large number of prob-
testing is required. impacted by new features and other lems found in specific areas.
known impacted code changes – all
External Message Changes: As we deal the information provided in the • Additional testing due to late code
with a product that interfaces to a large Regression Impacts Matrix and Test additions – once again we would use
number of other products, there can be Impacts Checklist is used to identify the information provided in the Test
external message changes involved in either the individual regression tests Impacts Checklist to identify the
the code change. If so, this can often or suites of regression tests required tests required.
add complexity to the regression testing to test the impacted areas.
required, as it can either mean that: • Clean-run/Sanity testing prior to
• A small subset of tests covering basic deployment of software release to
a) Another product will also need to be functionality for all features – here customers.
modified and we may need that prod- we simply select smaller subsets of
uct modification to fully regression suites from our regression library. It Primary and Secondary phase testing
test, or is much easier to then maintain this can be identified early in the release
b) We will need to make modifications smaller subset. cycle, and can therefore be planned for.
to our test tool in order to update it to Tertiary tests are more ad-hoc and
include the new external message The idea behind identifying Primary unplanned, but we allow time for them
change. test suites is that these will focus on the in the schedule when Primary and
impacted areas of the software and so Secondary testing is complete. We can

September/December 2001 http://www.testinginstitute.com Journal of Software Testing Professionals 31


then plan and report on their status on a
short-term basis.

5. The Benefits
This new approach to regression testing
has just been used on our current release
of software, and we have seen the fol-
lowing benefits:

• We have reduced the number of tests


in our regression program to 2000
from a figure of approximately 6000
on previous releases. While this is a
large decrease in the number of tests
being executed, we were confident
that there would not be an impact to
quality as the strategy allowed us to
focus on covering all basic function- • We are focusing on high-risk areas taken place on this release earlier in the
ality, plus the areas where changes earlier, increasing the chances of lifecycle. These activities focused on
were being made. This was clearly a finding the more serious problems improvements to the formal inspection
big improvement on simply rerun- earlier in the cycle. process including: improved inspection
ning tests from previous releases checklists and training, along with reg-
without any sound reason. • The strategy is flexible and there is ular analysis of inspection data, leading
scope for additional testing if to reinspection of out-of-bound inspec-
• Our problem arrival rate was less lin- required. tions.
ear - Figure 2 shows our Current
Release Problem Report Arrival • There is an increased level of aware- 6. Issues
Rate. For this release we had a total ness from the development commu- While we have seen many benefits of
regression test interval of 28 weeks, nity with regards to the impacts their this new strategy, there are some issues
and the graph shows that we opened code changes can have. We have also we have noted:
30 PRs during the first half of this increased their interaction with
interval. This is 65% of the total testers in helping to define the • Depending on the number of test
number of PRs we opened during regression program. engineers available, it can be difficult
regression test. This compares to to schedule execution of the test
approximately 30% of PRs being • It had led to improved maintenance suites in each phase so that each
opened during the first half of our of existing regression suites given phase completes fully before the
interval on previous releases. This that impacts and feature interactions other begins. It is recommended that
difference can be attributed to testing are identified earlier and changes/ test managers aim to complete a cer-
of impacted areas earlier in our cycle. updates to suites can then be planned tain percentage of the Primary phase
during the test development phase of before beginning the Secondary
• Test engineers have increased satis- the release. phase and similarly with the
faction because they see a purpose to Secondary phase before moving onto
what they are doing as they are The current release has just been the Tertiary phase. It is suggested
actively involved in designing the deployed on a customer site for the first that between 80 and 90% of testing
regression program. They also get a time. When we compare the level of in each phase should be completed
chance to learn more about the fea- escaped defects during this deployment before starting the next phase.
ture and functionality they are test- phase to the previous release, we see a
ing, as they are not executing a suite reduction in the amount of problems • There is effort involved in planning
simply because they were told to do found, from 21 to 8. This reduction can- and executing this regression strate-
it. not however be directly attributed to gy, and this effort needs to be esti-
our new regression strategy as other mated, resourced and scheduled in
defect reduction activities have also the project plan accordingly. It needs

32 Journal of Software Testing Professionals http://www.testinginstitute.com September/December 2001


to be seen as an integral part of the not provide for 100% coverage of the this strategy for our low-level function-
project. system being tested. What it does is al area regression testing. We have seen
identify what regression tests need to be several benefits on the first release
• The benefits of this strategy do need executed based on the ‘requirements’ where we used this strategy to design
to be explained clearly to the devel- we have defined using the strategy, i.e., our regression program and feel it can
opment community so that they can the tests in the Primary, Secondary and be adapted to suit different applications
see the importance of their contribu- Tertiary Phases. Given the complexity and products.
tions. We have been moving to an of the system we are testing, we don’t
organizational structure where devel- know for sure that we have exact cover- About the Author
opers and testers belong to the same age but we are sure that we are covering Martin Gilleran graduated with a B.Sc.
team. For those organizations where all basic feature functionality, plus in Electrical/Electronic Engineering
an independent test team exists, there focusing on areas where changes are from Trinity College, Dublin in 1986
may be some friendly persuasion being made. and has spent the last 13 years working
required! in industry. He spent 4.5 years with
For operational reasons, my organiza- Measurex, Inc. as a software develop-
7. Summary & Conclusion tion is moving towards a combined ment engineer responsible for develop-
Regression suites can often contain development/test team. As a result of ing, testing and installing measurement
thousands and thousands of tests as they this we are going through some ‘test re- and control systems for the paper
are built up over releases of software, invention’ at the moment. As we have industry. Mr. Gilleran has spent 8.5
especially when dealing with a legacy successfully reduced the amount of sub- years working with Motorola in differ-
product. When looking to focus regres- system & system regression testing we ent test roles. He has 4 years experience
sion testing, requirements are needed need by using this strategy, increased working as a test project. He then spent
along with a strategy that is consistent, focus is now being placed on lower 2 years as a Test Manager responsible
repeatable and flexible. Development level testing such as unit & integration for testing a range of Motorola's
and Test Engineers need to be actively testing, and the idea of regression test- Network Products including Mobile
involved in defining the requirements ing is now being applied to our integra- Switching Centre (MSC) and Home
for the regression program and then tion testing, where we will now regres- Location Register/Visitor Location
designing the program that will test sion test individual low-level functional Register (HLR/VLR).
these requirements. This strategy does areas of the MSC. We will now be using

September/December 2001 http://www.testinginstitute.com Journal of Software Testing Professionals 33

You might also like