Regression Testing
• We
all know - Regression testing is a type of software testing that seeks to
uncover new software bugs, or regressions, in existing functional and non-functional
areas of a system after changes such as enhancements, patches or configuration
changes, have been made to them
• A
regression test can be a manual test or a automated test at different layer of product – unit
test, functional test, api test or a web service test
• Continuous
evolving of product with new features, enhancements and technology change
contribute to regression test suite over product releases
• Regression
testing is time consuming effort given the multiple code lines , service packs and hot fixes
What happens?
The Traditional Way
• Traditional
SDLC brings regression down in testing phase, where we execute all the regression test suite both manual and automated
• Uncover
of bugs late in the game
• Costly
in terms of time and resource
• Quite
difficult with multiple code line , Service Packs and HOT fixes
• Is
there a better way to do this?
During Development
• Developer
writes code (new feature , enhancement or bug fix) and executes the
corresponding unit test cases and submits code to source control system
• Nightly
build or continuous integration are run to check the code fix however at unit
level , again all the unit tests are executed
• Can
we do something here?
Agile World
• User
stories are addressed in sprints , test case authoring , automation and
execution happens sprint wise however execution may happen in cumulative
fashion
• Does
the above guarantee shippable product after each or few sprints?
• Hardening
sprint to address regression testing
• Can
it be still better?
Regression Test Analyzer - A way to address questions above
• A
tool which will find the most bug prone areas in your product by establishing a
relation between product source code and functional areas or tests , we can
implement this tool in two ways
– Through
Source control system(SVN or Perforce)
– Through
code coverage(test execution on instrumented code)
• The
rationale behind this tool is simple as we all know that changes to code make
product bug prone and targeting those areas for testing will be fruitful
• Bring
regression early in cycle and more importantly be SELECTIVE about the areas of
concentration for testing your product for regression testing
Through Source Control System
• Product
source code is organized in logical packages in a structured manner which helps
to build this tool, below are steps involved
– Simple
diff command to get the changes for a give date range , extract the change
information into a log file(XML format), you will get the change log file with package
– Process
the log using any programming language (java) to get the package(module or functional area) level information like name and number of occurrences of a
package and create a report
• For
example the report will look like this
Module
name Occurrences
mod1
20
mod2
12
mod3
5
Likewise list
of modules with occurrences will become input for our regression testing which
will help us to be selectively target and improve the product quality as it
gives insights to the more bug prone areas due to code changes
Below is the flow diagram
Through code coverage
• In
this approach we will establish a relation between product source code and
tests through code coverage
• We
instrument code to a get metadata file
• We
execute all the test to get the coverage file , we get a coverage file for executed
tests once we exit JVM
• To
get a code coverage report we use metadata and coverage file as input, which
gives the report at package level and class level
• To
get the report for individual test or set of tests, get the coverage file for
each test or set of tests by exiting JVM using code coverage tool API.
• This
way we can simply establish the relation between test and package level to product
source code
Conclusion
• Regression
Test Analyzer is a tool to analyze the areas for performing regression testing.
• The
output from tool can be used to cut the traditional regression cycles
• Bringing
regression up in the cycle to perform regression in development phase
selectively to uncover bugs
• This
tool helps in getting quick feedback as we use selective approach, this is
useful in agile world
• Saves
time and resources
• Improves
product quality
Possible Enhancements
- A eclipse plugin
- Integration of automated tests suite to kick off based on report
Hi Rama Rao,
ReplyDeleteI have a question once I was put into regression project, but due to some security reasons SRS and other technical documents are not been shared with us. We only had a little Knowledge transfer on the application which did not help understanding the application. As a part of manual testing the bugs we posted were rejected mostly. So how could I handle this type of situations need your valuable suggestions thanks in advance!!!!!!!
Hi Pradeep,
DeleteThese kind of situations are quite difficult to handle , Ideally we can do the below things which can help us
1.Try to identify business use cases of application by understanding the domain
2.Play with the application, try to follow exploratory testing
3.Post questions to product owners/business analyst or if dev team is available you can talk to them
Thanks for reading this blog and posting a significant question.
Good Idea, this is very helpful to cut down the regression cycles and give us more co-ordination between dev and qa on the changes happening to the product.
ReplyDeleteAlso very helpful with agile methodology where we have frequent changes to code and less documentation we usually have here.
I have few questions/concerns here:
With the proposed way we always have risk of not identifying the areas which are indirectly affected as we do regression to the specific area recommended by the tool but we are not sure where all the code is using this particular functionality and may uncover those scenarios unless that part of code is executed.
Hi Karthik,
DeleteThank you for your comments!!
Answer to your question lies in second approach where we are trying to establish relation between tests executed and code touched through code coverage, however you should have a good test coverage to identify the areas.
Hi Rama,
ReplyDeleteVery useful article about the regression which some parts of it according to me should be automated.
Can't wait to read the other articles you write.
Hi Deyan,
DeleteGlad and thanks.
Hi,
ReplyDeleteI m not so familiar with regression.. This article seems to be very useful for me to have an idea about regression.
Looking forward to know more about regression.
Hi Vanitha,
DeleteThank you!