generate test-cases using the binary code or the Java
Bytecodes, often with the assistance of the JVM
Debugger Interface. This framework extends
previous work, and specifically, it integrates
components which analyze the code and create the
control-flow, data-flow and dependence graphs
(Sofokleous and Andreou 2008b, Sofokleous and
Andreou 2008a). The proposed framework utilizes
genetic algorithms for generating test cases
according to the to edge/condition and the k-tuples
criteria (Zhu et al 1997, Ntafos 1984). Genetic
algorithms (GA) have gained their reputation in the
area of test data generation in the last ten years as
they are able to search a large search space of
possible program inputs and reach to a set of near to
optimal solutions, resulting in high code coverage.
This work studies and compares some of the
most popular software testing and analysis
frameworks currently available: Clover – CL
(Clover 2009), Java Quality Solution - JQS (Java
Quality Solution 1996), Parasoft Jtest – JT (Jtest
2007), Java Coverage Validator – JCV (Java
Coverage Validator 2002), Quilt – QU (Quilt 2001),
JCover – JC (JCover 2009), ispace – IS (ispace
2006) and Byecycle – BC (Byecycle 2008). Most of
these tools focus on test-case generation and code
coverage; ispace and Byecycle focus on creating
dependence graphs.
Clover (Clover 2009), Jtest (Jtest 2007) and Java
Coverage Validator (Java Coverage Validator 2002)
frameworks execute on the bytecode-level unlike
our framework which uses directly the source code.
Analyzing the source-code is more difficult
compared to bytecode-based analysis, which is
neither programming language-specific, nor is
associated with a certain programming style. Source
code based analysis, however, allows better
comprehension and maintenance of the program
under testing, as it is closer to the programmer’s
logic and the business level (e.g. requirements).
Many compilers offer graphs constructed on
intermediate, bytecode or low code. The framework
presented here works on the source code to create
the code graphs necessary for its operations.
Java Quality Solution (Java Quality Solution
1996) and Quilt (Quilt 2001) are capable of creating
data-flow and control-flow graphs, respectively. In
terms of testing coverage, most of the tools use
statement testing coverage; JCover and JTest use up
to branch coverage. The majority of these
frameworks present the coverage results in reports,
e.g. exercised code, in terms of LOC, and the
selected test cases. Some tools, such as Clover, JTest
and JCover produce reports in HTML/XML and/or
charts and diagrams. Our framework presents the
results using both reports and graphs created during
execution. Some of the presented frameworks utilize
built-in rules to minimize design mistakes,
regression testing, thread integrity testing, etc.
Byecycle (Byecycle 2008) is an Eclipse (Eclipse
2009) plug-in and can create a dependence graph
illustrating the dependencies between packages,
classes and interfaces. ispace (ispace 2006) creates
dependence graphs as well, but these graphs show
dependencies not only in an inter-package and inter-
class level but also in more depth, and specifically
between methods of a class. The proposed
framework offers an even more analytic dependence
graph; it can explore in more depth the methods of a
class and can how the dependencies among
statements, methods, inputs of methods,
constructors, classes, control structures and outputs.
3 THE FRAMEWORK
The framework uses a program analyzer that creates
and visualizes Control Flow Graphs (CFG), Data
Flow Graphs (DFG) and Program Dependence
Graphs (PDG) at the class level. The testing system
uses genetic algorithms in order to generate test
cases according to control flow or/and data flow
criteria. The test data generation uses a set of
adequacy criteria, e.g. the branch/condition coverage
criterion and the k-tuples data flow criterion.
The program analysis and test data generation
systems of the framework work closely together so
as to satisfy the coverage criterion selected as
follows:
The user invokes the Load Wizard (User Level,
Figure 1) to select the source code and the type of
graph(s) The Testing System Level of Figure 1
describes the testing layer. The option of testing is
enabled after the analysis of the source code and the
creation of the graph(s). Depending on the graph
created, different types of coverage criteria can be
used; the DF test-case Generation and the CF test-
case Generation Systems are currently supported.
The main difference between these two systems is
the form of the fitness function that evaluates the
generated test data, which, of course, as adapted to
reflect each time the criterion used.
The two systems search for the near to optimum test
cases and present the results to the user; apart from
the optimum set of test cases, the user may view the
coverage percentage, the evolutions and time needed
and the coverage achieved with direct mapping of
execution on the graphs . A test case/path may be
ICEIS 2010 - 12th International Conference on Enterprise Information Systems
408