November 2010, Volume 7, No.11 (Serial No.72)
Journal of Communication and Computer, ISSN 1548-7709, USA
Effective Generation of Test Cases Using Genetic
Algorithms and Optimization Theory
Izzat Alsmadi, Faisal Alkhateeb, Eslam Al Maghayreh, Samer Samarah and Iyad Abu Doush
Computer Science and Information Technology Faculty, Yarmouk University, Irbid 21163, Jordan
Received: July 22, 2010/ Accepted: September 16, 2010 / Published: November 25, 2010.
Abstract: In software projects, one of the main challenges and sources of success or failure is the effective use of available resources.
Using effective techniques in regression testing is important to reduce the amount of required resources. This is accomplished through
reducing the number of executed test cases without affecting coverage. In this research, genetic algorithms and optimization theory
concepts are applied on test case generation and reduction optimization. The methods start by generating an initial pool of test cases
through selecting valid paths in the GUI graph that is generated from the tested software dynamically using an in-house developed tool.
The selected test cases are then improved through measuring and evaluating fitness functions. The two fitness functions used in this
research were the test set generation speed and the test set coverage. Optimization theory is also used to find the best set, measured
according to a particular fitness function that can best represent the whole testing database while preserving all other constraints.
Key words: Test case generation, software testing, software engineering, genetic algorithms, optimization theory, GUI graph, and
An optimization algorithm tries to find the best
feasible solution that conforms to all problem
Such algorithm may usually begin with a random
process to create an initial population that consists of a
number of chromosomes where each chromosome
represents a possible solution for the problem being
solved. It then follows a process of continuous
Corresponding author: Izzat Alsmadi, assistant professor,
research interests: software, testing, and metrics. E-mail:
Faisal Alkhateeb: assistant professor, research interests:
knowledge-based systems, knowledge representation and
reasoning, intelligent systems, constraint satisfaction and
optimization problems. E-mail: email@example.com.
Eslam Al Maghayreh: assistant professor, research interests:
runtime verification of distributed programs, natural language
processing and information retrieval. E-mail: firstname.lastname@example.org.
Samer Samarah: assistant professor, research interests:
wireless sensor networks, mobile Ad hoc networks, data
mining, and software engineering. E-mail: email@example.com.
Iyad Abu Doush: assistant professor, research interests: HCI,
web semantic and evaluation, and virtual environments. E-mail:
selection and adjustment based on evaluating the
output of the initial population.
Artificial Intelligent (AI) algorithms such as Genetic
Algorithms (GAs) are used to find the best solution for
a particular problem. They were invented by John
Holland in 1975 and elaborated in his book “Adaption
in Natural and Artificial Systems” . Later, John
Koza used GAs in programming in what is then called
Genetic Programming (GP) to perform certain tasks
effectively. Since then, they were used in several
different applications and fields. In particular, they are
used to solve several types of optimization problems
. GAs are adaptive search techniques that imitate the
processes of evolution to solve optimization problems
when traditional methods are considered too costly in
terms of processing time and output effectiveness.
Testing usually takes a large portion of the software
project resources. Cost and time saving in this stage can
be a great help for the software development process.
Manual testing can be slow and expensive. Artificial
Intelligent (AI) algorithms (such as genetic algorithms)