You are on page 1of 21

TEST CASE PRIORITIZATION USING IMPROVED GENETIC

ALGORITHM IN REGRESSION TESTING

Master of Technology
In
Computer Sciences and Engineering
Submitted By
Ramanjeet Kaur

Under Supervision of
Mrs. Jagpuneet Kaur Bajwa
( Department of Computer Science, Punjabi University, Patiala. )

Department of Computer Science,


Punjabi University, Patiala 147002
January, 2017
Contents
1. Introduction
2. Literature review
3. Problem formulation
4. Objectives
5. Methodology/Planning of work
6. Facilities required for proposed work
7. References
Introduction
Software Testing:
Software testing is one of the most important activities of SDLC.
Nearly 70% of the development effort is expended on testing
activities.
Software testing is to find as many errors or bugs in the software as
possible in order to ensure that the software being developed is of
good quality.
The following professionals are involved in a software testing
Software Tester
Software Developer
Project Lead/Manager
End User
Software Testing

There are different methods that can be used for software testing:
1. Black-Box Testing
The technique of testing without having any knowledge of the interior
workings of the application is called black-box testing.
The tester is oblivious to the system architecture and does not have
access to the source code.
Typically, while performing a black-box test, a tester will interact with
the system's user interface by providing inputs and examining outputs
without knowing how and where the inputs are worked upon.
2. White-Box Testing
White-box testing is the detailed investigation of internal logic and
structure of the code. White-box testing is also called glass testing or
open-box testing.
In order to perform white-box testing on an application, a tester needs
to know the internal workings of the code. The tester needs to have a
look inside the source code and find out which unit/chunk of the code
is behaving inappropriately.
Regression testing
It is a type of White-box testing.
Whenever a change in a software application is made, it is quite
possible that other areas within the application have been affected by
this change.
Regression testing is performed to verify that affixed bug hasn't resulted
in another functionality or business rule violation.
The intent of regression testing is to ensure that a change, such as a bug
fix should not result in another fault being uncovered in the application.
Regression testing can be a costly and time consuming process. This
may be the case when the test suite required to test the system is large,
there is some manual element in testing or test execution takes up
significant resources. So it becomes essential to reduce the cost and
time expenses involved in regression testing. Various research efforts
have been put together in the past for achieving this objective.
One way to reduce the cost of regression testing is to select a subset
of original test suite such that the selected subset achieves total
code coverage in minimum time.
Such methods that assist in this selection are known as regression
test suite optimization methods.
Common methods include test case prioritization, test case selection
and test suite minimization.
Test case prioritization
It is a method to prioritize and schedule test cases. The technique is
developed in order to run test cases of higher priority in order to
minimize time, cost and effort during software testing phase.
In order to find out the best test case execution sequence in test
case prioritization, all the possible permutations of the original test
suite are considered as candidates.
Genetic Algorithm
Genetic algorithms are the search heuristics which are widely used in test
case prioritization problems.
A genetic algorithm starts with guesses and attempts to improve the guess
by evolution.
The main benefit of using genetic algorithm is that it belongs to a wider
class of evolutionary algorithms which generate solutions to optimization
problems by using the techniques inspired by natural evolution.
A genetic algorithm will typically have five parts:
i. A representation of a guess called a chromosome.
ii. An initial pool of chromosomes.
iii.A fitness function.
iv.A selection function.
v. A crossover operator and a mutation operator.
Literature review
Yue jian Li et al. (1999) [1] in their paper presented a summary of
regression testing in the following areas: types of regression testing,
regression testing of global variables, regression testing of object-
oriented software, and comparison of selective regression
techniques and cost comparisons of the types of regression testing.
S. Yoo et al.(2010) [2] in their paper analyzed the areas of
regression test minimization, selection and prioritization. The
survey revealed an increasing trend in providing support for these
techniques, particularly prioritization. It also described the
challenges of providing an automated support for regression testing
practices in order to promote practical implementation.
Gregg Rothermel et al.(1999) [3] in their paper presented several
techniques for prioritization of test cases and reported empirical
results that measured the effectiveness of these techniques for
improving fault detection rate. The results provided an insight into
the tradeoffs among various techniques for test case prioritization.
Hema Srikanth et al. (2005) [4] in their paper proposed a Prioritization Of
Requirements for Test(PORT) technique which prioritized test cases on the
basis of four factors: requirements volatility, customer priority,
implementation complexity and fault proneness of the requirements. They
also conducted a PORT case study on four student developed projects in
advanced graduate software testing class. Results showed that PORT
prioritization at the system level improved the rate of severe fault detection.
Also, customer priority was found to be one of the most important
prioritization factors contributing to the improved rate of fault detection.

Paolo Tonella et al. (2006) [5] in their paper proposed a TCP approach that
took advantage of user knowledge through a machine learning algorithm,
known as Case Based Ranking (CBR). The proposed approach worked by
integrating user knowledge with multiple prioritization indexes. The results
indicated that CBR overcomed the previous approaches and also provided a
near-to-optimal solution for moderate suite size.
Xiaofang Zhang et al. (2007) [6] in their paper proposed a new TCP
technique and an associated metric based on varying testing requirement
priorities and test case costs. The case study illustrated that the rate of
units-of-testing-requirement-priority-satisfied-per-unit-test-case-cost
could be increased, and then the testing quality and customer satisfaction
can be improved.

Yu-Chi Huang et al. (2010) [7]in their paper proposed a cost-cognizant


prioritization technique that ordered test cases according to their history
information by using genetic algorithm. The technique prioritized test
cases on the basis of their test costs and fault severities, without analyzing
the source code. It also improved the prioritization performance by
avoiding certain scenarios where the test cases with equivalent ability in
the previous regression testing were given the same rank. The efficiency of
the same was evaluated by using a UNIX utility program and the results
confirmed the usefulness of the proposed technique.
Dan Hao et al. (2013) [15] in their paper presented an adaptive
TCP approach, which works by determining the test case execution
order simultaneously during the execution of test cases on the
modified program. The proposed approach selected the test cases
on the basis of their fault detection capability, which was further
calculated from the output of selected test cases. The effectiveness
of the approach was evaluated by conducting an experimental study
on 8 C programs and 4 java programs. The results showed that the
proposed adaptive approach to be significantly better than the total
test case prioritization approach and comparable to additional
statement-coverage based test case prioritization approach. In fact,
the adaptive approach came out to be better than the additional
approach on some subjects.
Problem Formulation
Regression testing is a type of testing aimed at finding out new
errors after the modification of software. In other words, it assures
that no additional errors were introduced in the process of fixing
other problems and the software still works as it did before.
However, executing the entire test suite for this purpose can be
expensive in terms of cost and time. Therefore, it is essential to
reduce the expense involved in regression testing.
One way to achieve this is by test case prioritization. Test Case
Prioritization aims to order the test cases so as to maximize the rate
of fault detection.
This topic has been a major subject of research for many years and
many techniques have been proposed for achieving the same.
Popular among these are genetic algorithm, ant colony
optimization, bee colony optimization.
Problem Formulation
Although these techniques are able to efficiently prioritize the test
cases, but take significant amount of time to do so.
For example in case of genetic algorithm, a large population of
candidate solutions has to be repeatedly evolved in an iterative
manner for reaching the best solution. When the population is large
i.e. when there are some 100 or 1000 test cases, then genetic
algorithm may consume a large proportion of time to prioritize the
test cases.
To remove this drawback, a new hybrid technique has been
proposed which speeds up the time taken to prioritize the test cases.
This hybrid technique is a combination of adaptive approach and
genetic algorithm. The speedup is achieved by using an adaptive
approach which schedules the test cases simultaneously during the
execution of test cases.
Objectives
1. To study and analyze different soft computing techniques like
genetic algorithm, ant colony optimization and adaptive approach
for test case prioritization.
2. To collect different Test Cases using Apache Open source by
interfacing it in Eclipse and Testing with JUnit test toolkit.
3. To optimize the performance of prioritizing the test cases an
efficient Genetic approach is proposed.
4. To calculate and compare the APSC metric and execution time for
GA and proposed hybrid approach.
Methodology/Planning of work
Collect different test cases from Apache Open source by interfacing
it in Eclipse and testing with JUnit test toolkit.
Collect execution information of those test cases on the previous
program.
The initial population for the Genetic is the test suites that are
generated using Adaptive prioritize approach. Duplication is also
checked to make sure the final test suite meets the cost and time
objectives of regression testing
Initialize population by the result of Step 1
Evaluate each test suite on the basis of fitness function i.e. Average
percentage statement coverage APSC.
Repeat Until (termination condition occurs)
Select parents
Recombine pairs of parents
Mutate the resulting off springs
Evaluate new test suite
Select individuals for next generation
End
Facilities required for proposed work
Hardware Requirements:
Processor: Pentium IV of Higher
RAM: 256 MB or Higher
Hard Disk: 10GB or Higher

Software Requirements:
Platform: Microsoft windows 7 or higher.
JAVA Runtime Environment
JAVA Development Kit
Netbeans Integrated Development Environment
JAVA Object Oriented Programming Language
References
[1]Y. Li,Nancy JWahl: An Overview of Regression Testing.ACM
SIGSOFT Software Engineering Notes, vol. 24, no. 1, (1999)

[2] S. Yoo,M. Harman: Regression testing minimization, selection and


prioritization: a survey.Software Testing, Verification and Reliability
(2010)

[3] G. Rothermel, Roland H. Untch,C. Chu,M. Harrold: Test Case


Prioritization: An Empirical Study.In: Proceedings of IEEE
International Conference on Software Maintenance (ICSM), (1999)

[4] H. Srikanth, L. Williams, J. Osborne: System test case prioritization


of new and regression test cases. In: Proceedings of IEEE International
Symposium on Empirical Software Engineering, (2005)
References
[5] P. Tonella, P. Avesani,A. Susi: Using the Case-Based Ranking
Methodology for Test Case Prioritization.In: Proceedings of
22ndIEEE International Conference on Software Maintenance,
(2006)

[6] X. Zhang,C. Nie,B. Xu, B. Qu: Test Case Prioritization based


on Varying Testing Requirement Priorities and Test Case Costs.In:
Proceedings of 7th IEEE International Conference on Quality
Software, (2007)

[7] Y. Huang,C. Huang,J. Chang, T. Chen: Design and Analysis of


Cost-Cognizant Test Case Prioritization Using Genetic Algorithm
with Test History.In: Proceedings of34thIEEE Annual Computer
Software and Applications Conference, (2010)
References
[8]R.Kavitha,V.R.Kavitha,
Dr. N. S. Kumar: Requirement Based Test Case
Prioritization.In: Proceedings of IEEEInternational Conference on
Communication Control and Computing Technologies (ICCCCT), (2010)

[9]
Y. Singh,A. Kaur,B. Suri: Test Case Prioritization using Ant Colony
Optimization.ACM SIGSOFT Software Engineering Notes, vol. 35, no. 4,
(2010)

[10]Md.Kayes: Test Case Prioritization for Regression Testing Based on


Fault Dependency.In: Proceedings of3rd IEEE International Conference on
Electronics Computer Technology (ICECT), (2011)

[11]
D. Marijan,A. Gotlieb, S.Sen: Test Case Prioritization for Continuous
Regression Testing: An Industrial Case Study.In: Proceedings of IEEE
International Conference on Software Maintenance, (2013)

THANK YOU

You might also like