Professional Documents
Culture Documents
Submitted by
Aye Myat Thin
2009/2010
I hereby certified that the content of this dissertation is the result of work done
by me and has not been submitted for education used purpose in any other
university or institution.
--------------------------- -------------------------------
Date AYE MYAT THIN
(072218H03)
ii
Development of Software Testing and Analysis Tools –Part E
Table of Contents
TABLE OF CONTENTS
STATEMENT OF ORIGINALITY…………………………………………….ii
TABLE OF CONTENTS……………………………………………….……..iii
APPENDIX………………………………………………………………..……v
LIST OF FIGURES……………………………………………………..…….vi
ABSTRACT………………………………………………………………..….vii
ACKNOWLEDGEMENT………………………………………………...….viii
CHAPTER 1 INTRODUCTION
1.1 Background…………………………………………………………………………….1
1.1.1 IPathDectcor2……………………………………………………………….….1
1.1.2 Other tools…………………………………………………………………...2
1.1.3 Difficulties of tracing the source code and IR code manually…………......2
1.2 Objective of this project ………………………………………………………………3
1. 3 Report Organization………………………………………………………………….4
3.1Purpose of program…………………………………………………………………..13
3.2 Program Functionalities and diagrammatic explanation………………..……..…13
iii
Development of Software Testing and Analysis Tools –Part E
Table of Contents
iv
Development of Software Testing and Analysis Tools –Part E
Table of Contents
CHAPTER 6 CONCULSION
REFERENCES………………..……………………………………………..70
v
Development of Software Testing and Analysis Tools –Part E
Table of Contents
APPENDIX
vi
Development of Software Testing and Analysis Tools –Part E
List of Figures
LIST OF FIGURES
vii
Development of Software Testing and Analysis Tools –Part E
Abstract
ABSTRACT
If tool can correctly detect all major infeasible paths in the tested system, the
precision of static analysis will be greatly enhanced, and therefore improves its use
in many areas, particularly in structural testing [9] and code optimization. Thus, the
most key place where infeasibility rise is identified based on two patterns of the code
statements. These two patterns will be described detail later in this report. So,
basically, the developing tool, IPathDetector2 is designed to test the infeasibility of
the paths using these two patterns. By using this tool, larger portion of infeasible
paths were identified and the precision and coverage of the earlier method is much
more improved.
But, it still not completely robust for automated testing as there are theoretically
invisible causes of the inability to detect some forms of infeasibility. Thus, some
infeasible paths will not be identified Compared to different automated analysis tools;
which are Simplified, Z3, although some of the previously unidentified paths are
solved, there variations between the results obtained using 3 different tools are
found.
This report will comprise of ways of finding weakness and cause of those
variations by mean of manual analysis, so that to carry on actions improve the
performance quality and reliability of IPathDetecotr 2.
viii
Development of Software Testing and Analysis Tools –Part E
Acknowledgement
ACKNOWLEDGEMENT
I would like to express my sincere appreciation to the two persons, who have
given me great guidance throughout my project development.
First and foremost, I would like to give my deep thanks to Dr . Tan Hee Beng
Kuan, my FYP supervisor, for directing the whole concept of the project and sharing
knowledge of software testing. His encouragement and structural instructions has
helped me to get over the difficulties along the ways and keep me dedicated.
And also I would like to show my gratitude to Mr Ding Sun, final year PHD
student from Electrical and Electronic Engineering. He has helped me widen the
knowledge about Programming and enforce my critical thinking skills in developing
functions for project. Moreover, he has patiently and willing explained the ambiguity
and doubts throughout my project developments.
Their kind guidance and help motivated me to continue trying and finally get
the targets of the project on time. Thus, I would like to show my heartfelt thanks to
those people with sincerity.
ix
Development of Software Testing and Analysis Tools –Part E
Chapter 1 Introduction
CHAPTER 1 INTRODUCTION
1.1 Background
1.1.1 IPathDectcor2
1
Development of Software Testing and Analysis Tools –Part E
Chapter 1 Introduction
Simplify:
Can test 50% of the total paths in the tested program because of the
methodological wrong assumption that when testing some predicate node, it testing
for all values of same variable as in predicate node
The major weakness of Simplified tool is that it only support int and does not
support other primitive data types.
Z3:
Can test nearly 100% of paths in the tested program
It supports all primitive data types.
It is methodologically better than Simplified because it test for existing variable
in the predicate node
If there are variations among tools’ results, manual analysis checking needs to be
done. The study of either or both of relevant IR or source code is essential to find out
the source of variations. And have to locate the correct code of the list of varied path
id. So it is very time consuming and unreliable to correlate back the class name back
to path id and match the converted IR and extracted original java source code. The
disadvantages of tracing the codes manually based on path id.
is not timesaving
is unreliable
May involve many human errors
May involve wrong interpretation where matching the class name back to path
id
Might copy the wrong source and IR files from wrong class name
2
Development of Software Testing and Analysis Tools –Part E
Chapter 1 Introduction
Thu, it is very inconvenient for manual analysis and evaluation of checking the
infeasibility and feasibility of paths without having being able to directly retrieve
source code and converted IR representations from the desired path id.
Next is to do manual checking for the variations among the results of the
paths analyzed by tools using the developed subsystem for infeasible path detection
and decide the feasibility or infeasibility. Moreover, objective is to identify the correct
feasibility or infeasibility of the unsolvable path.
Last objective but not the least, is that to compare the results obtained from
Manual Analysis and Tools results and find the actual cause of the infeasibility
before carrying out improvements and amendments to IPathDetector2.
3
Development of Software Testing and Analysis Tools –Part E
Chapter 1 Introduction
4
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
The software testing technology used in testing tools are white box testing.
Since, all the intra-path, inter-path tool testing and manual analysis falls under the
white box testing. The tool testing and manual analysis checks the functions and
results of internal data structure, code and algorithms and data operation. Because
of this, tool testing and manual analysis went through during IPathDetector2
construction stage is classified as white-box testing.
Thus, by the nature of white box testing is not like black box testing nature,
which only looking at the input and output and ignore the inter-operations and data
flow. White-box testing purpose is to make the internal system is transparent and
viewable to user. So, white box testing is suitable tesing methodology to be used in
IPath detector2 automatic and manual path analysis.
Figure 1 represents the white box-testing strategy. So, all the system’s
executable program parts are visible using white box-testing strategy. And those
were being focus in review and reliability checking. Means the feasibility checking,
validation, error finding, correction of data flow, path flow, structure , control flow ,
and all other internal program is functions that White box testing allows to testers.
Inputs and outputs are taken as causes and effects in white-box testing.
Consequently, to check the internal data operations and path flow, this
usually requires writing code or a minimally sub-system program to do analysis .It
also requires technical knowledge on both the specific software and tools pending for
testing.
The test cases which apply white box testing are to be built on the structure instead
of functions. So, since the structure of IPathDetector2 ‘s path detection program is
based on the Control Flow Graph, the automatic and manual analysis should follow
the Control Flow Graph based structure.[21]
Path coverage (all the possible combinations of true and false condition
predicate nodes), branch coverage (traverse every branch statements), or statement
coverage (executing line by line at least once) can be exhaustive using white-box
testing. So, test case which use white box testing are design based on whether the
basic , random , or all nodes or paths will be covered or traversed at least once.
Problems of intractability within the internal system are overcome using white
box testing. Thus, I path detector 2 is designed to use white box testing and
structured to cover all the possible paths in the test system to detect the
infeasibilities within the whole system.
5
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
2.2 Soot
The diagrammatic view of how the the code conversion of from the source
code to relevant tools input IR for different tools is as shown in the Figure 1 below.
6
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
Source Code
Soot
Intermediate
Representation
(IR) statement
lines of the path
7
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
Source Code
Epression
Linear
tool Using
of IR for each
specific form
from IR to
Conversion
8
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
framework, for analyzing and transforming Java byte code (which supports more
than 200 different operations) by providing four intermediate representations
(IR)shown below.
1. Baf:
2. Jimple:
3. Shimple:
4. Grimp:
IPathdector2 use Jimple form Soot to convert the source code to IR code during
configuration.
-p jb use-original-names:true
Thus, the following is the detail procedure of how the Jimple works in source
code conversion. Soot’s execution is done in a set of different jp (jimple body) packs
which of each pack contains different phases.
When conversion from source code to IR code, jimple IR is obtained and used
in IPathDetector2.Jimple is an IR of JAVA program which was in the form of three
address code which is an alternative to stack-based bytecode.Jimple is also the
heart of soot optimization framework. That is why; it is believed to be more effective
in optimization by designers. The main purpose of converting stack-based bytecode
to three address code(“simplifying”) is to see each position in stack has own
variables and assigning values to those variables. It is to check that the operations
on variables are done only after certain values are assignment to variable.
9
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
Three-address code:
stack1 = x1 // iload 1
stack2 = x2 // iload 2
stack1 = stack1 + stack2 // iadd
x1 = stack1 // istore 1
Firstl, Soot applies the jb pack to every single method body, or in other
terms to every method that has a body. Native methods such as
System.currentTimeMillis() have no body. The jb pack is fixed and it is
concerned with the creation of the Jimple representation. It cannot be changed!
The diagram belown shows you the different pack that exist in Soot.
Secondly, Soot applies four whole-program packs to the body which are
as shown below:
10
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
Fourthly and as the diagram shown above, Soot lastly applied the packs bb and
tag to each body. The bb pack converts the (optimized and tagged) Jimple bodies
into Baf bodies. Baf is Soot’s stack based intermediate representation from
which Soot creates bytecode. The tag pack last but not least aggregates certain
tags. For instance, if multiple Jimple (or Baf) statements share the same line number
tag then Soot will retain this tag only on the first instruction that carries this tag, to
gain uniqueness.
11
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
Although Jimple IR form is much simpler than original java source code, it is not
directly be able to use as input into other tools and Simplify and Z3. Moreover for the
purpose of manual analysis, Jimple IR still looks complicated to read and coding of
each predicate node may be written lengthy and looks complicate.
Thus, input for Simplify and Z3 system is created using three address code ,
which is Statistic Single Assignment Form (SSA) form as elaborated below.
x:= y op z
e.g x : = y + z
a := b + c x d
e := c x d
a := b + e
The term three-address code is still used even if some instructions use
(more or fewer than two operands).
Abbreviation notation
The naming of all the variables, method or functions in short form and
declare the begin letter followed by numeric identification as follows:
V0: Variable
V1: another different /unique name of variable and so on.
F 0: a complicated call or simple call of a function
12
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
F1: another unique /different path of complicated call or simple call of a function
and so on.
N 0: a number which have float data type
N 1: another different number which have float data type and so on.
O 0: object of the class of constructor
O 1: another unique different representation of the class of constructor and so
on.
The conversion is start from the very beginning of the line until the path is
finished sequentially. The steps of code transformation form source to IR code for
the paths are as follow:
Step 1:First of all, if line is definition statement, then the variable, or object or
returned variable from called function or number ,it will be given a name that
identify the first Capital letter of its type and the defined name and value will be
pushed into hash map.
Step 2: On moving on to the next lines, and as long as the line is statement or
definition, the new variable, or object or returned variable will be checked
whether already in the hash map.
Step 2.1: If yes, then the current value will overwrite the previous value
Step 3: Follow the same procedure as in step for all the definition statements
Step 4: When s predicate node is reached, then check whether the then the
variable, or object or returned variable from called function or number used in
the node is inside hash map
Step 4.1: If yes, then take out the value of them from hash map and write in the
expression of IR statement by substituting the value of them in the expression.
Step 4.2: If no, then give a name that identify the first Capital letter of its type
and the defined name and write the IR statement by substituting the name in
the place of them.
Step 6: After all the lines under a path is finished conversion, all the converted IR of
the statement is stored in the a vector.
Note: have used four different types of hash maps for the storage of variable, objects,
returns of the called functions, and String.
13
Development of Software Testing and Analysis Tools –Part E
Chapter 2 Related Tools Technology
But, it is not 100% reliable since there might be the programming error during
conversion .Thus original source code and Jimple IR are still necessary as a first
step in manual analysis. Only if some IR and source code looks very lengthy and
complicated the input IR to Simplify is better to use.
14
Development of Software Testing and Analysis Tools –Part E
Chapter 3 Development of Test System
The purpose of creating this program is used in the analyzing of the detect
ability of infeasible paths by different tools, which are Simplified + Z3 and
IPathDetector 2.List of purpose is as below:
Reliability of IPath detector 2 has been tested using 9 different java source
codes with different size and levels of standards of complexity and different total
number of paths involved. Some of those above mentioned program are written by
different levels of programmers and having different performance and functionalities.
So, the more number of the different source programs with different characteristics
or functions or size or level of complexity, the more it can be assured to reliability of
the performance of the IPathDetector2.
It is implemented be tested using IPathDetecor 2, Z3 and Simplified Tools and
to look out if there any difference between results after analyzed and to continue
manual analysis if there is a variation between results.
Inputs used to created test system are Predicate nodes involved codes Flag based
nodes involved codes (which will satisfy IPathDectector2 patterns) .
13
Development of Software Testing and Analysis Tools –Part E
Chapter 3 Development of Test System
The following Figure 3 is figure of the main page, when the program is run
and user is allowed to create new file or open file as desired.
User can create new file, student mark database by clicking the new button
under the File menu as shown in Figure 4 below.
Once click the new icon, new data sheet page will be created as in the
diagram below. Data sheet is where the students’ data and assessment marks can
14
Development of Software Testing and Analysis Tools –Part E
Chapter 3 Development of Test System
be keyed in. The empty data sheet will contain the columns of students’ info and
assessments marks and total mark columns as shown in Figure 5 below.
When entering the student’s data, if Alphabetic letters is entered for the
student marks, the system will not accept and prompt the error message as shown in
Figure 6 below.
Once all the five columns for data is keyed in , the system will do the
computation of marks based on the percentage count of each of the filled in marks
and sum the results to get the total mark for each individual student and the result
will be displayed under the ‘total’ column as shown in Figure 7 below
15
Development of Software Testing and Analysis Tools –Part E
Chapter 3 Development of Test System
After the data are filled in user and total marks of the students are computed,
then the datasheet can be saved under the user desired folder. Save dialogue box
as shown in Figure 8 below will appear once the save as button was pressed and
user can select the folder to be saved. Data sheet can be saved as Excel or txt file.
Next after it is saved, the message dialogue box will be shown as shown in
Figure 9 below.
16
Development of Software Testing and Analysis Tools –Part E
Chapter 3 Development of Test System
For opening of the saved file, click on the open button after the new data
sheet is created and the drop down list of the files saved will appear as shown in
figure 10 below and user can choose the particular file under the folder where file is
saved before.
17
Development of Software Testing and Analysis Tools –Part E
Chapter 3 Development of Test System
Constraint: before opening the saved data sheet, user has to open the empty data
sheet and try to press open so that the saved file will appear without error. The
saved file can be reopened in txt file or Excel file. The sample of the opened file in
Excel is as shown in figure 11 below.
When u press the select all button, all the cells under the data sheet will be
selected. Thus this will help in deleting all the data in the file as shown in figure 12
below.
The Master Mark Calculation Program is being analyzed using IPath Detector 2
and Z3 and Simplified methods and the results are as follows:
Total: 99
feasible: 81
Infeasible: 18
infeasible by P1: 0
infeasible by P2: 18
By Z3+Simplify:
total path: 99
total method: 59
Total Stmt is: 975
feasible: 81
infeasible: 18
The results are same, so there is no need to do manually checking.
19
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
Even though the previous system is capable of displaying the source code
and IR of tested software, the function is only possible through the selection of each
class name and not by path id.
Thus, after the analysis using different tools is done, the data we have is the
path id and status of each of the path id.
Thus, the method that will be able to retrieve relevant source code and IR
based on the analyzer selected path id is vital for relationship between tool analysis
and required manual analysis need to be done for unevaluated paths or to find the
variations between the results of the paths.
20
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
The main call of the class that can perform the printing of IR statement is
done under the class named Analyzor and the methods and calls which are able to
perform the printing of the source code is amended under the Analyzor class itself.
Thus, Analyzor class is where instantiated the functioning of print of both source and
IR code of the requested unsolvable Path ID.
1 new classes are added named Printstmt, which contains the functionalities
and process to get the IR statements of and print the IR code of the unsolved path ID
requested by the user.
Whereas for the retrieving and printing the relevant source code lines of the paths of
the unsolved path ID’s requested by the user, the methods and functions are created
under the existing class named Analyzor .
Both prinstmt class and Analyzor class are created under the following URL
:ICISSootRenewed/ICISSootRenewed/IPathDetector2/infeasibleDectector
Simply activate or call the constructor without parameters, which located in the
above class using the object instances created, passing the appropriate arguments.
ps.test(path, intrapathnum);
21
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
List of Variable declaration and object declaration before the methods and call
functions of different classes and variables of different data types and objects of
different types are being added and used for the operation of printing of both Source
Code and IR statements under the Analyzor Class.
First method named test will be called by passing path and intrapathnum
arguments.
Data type of variable path –Intrapath data type, where referential data type.
Path is the variable equal to the intrapath of the system.
Data type of variable intrapathnum is int data type, where primitive data type.
Intrapathnum is the variable equal to the current path, where the system is
running.
22
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
.test(path, intrapathnum);
Under this prinstmt class, the major calling of functions required for printing IR
statements are written.First of all empty vector<Integer> is created where objects of
Integer data type can be stored inside. This vector is for storing the unsolvable path
ID that will be read from the Doc file input by the user.
Next , The below line will create the object r of the readfirst class.
Then, under the constructor of the printstmt class which is public printstmt()
Path ID int number input inside the doc file are read and then stored into the vector
as objects.
Here before action the reading of path ID from the user input file, for effective
usage of the memory and efficient reading performance with un-repetitive reading
from the file and un-iterate writing into the vector , the codes is written in the ways
that:
And as the Boolean checking is done before the vector and read method is
performed .Thus, even though every time the new instance of printstmt is created for
some purpose, the new vector won’t be created again and again and the exiting
single vector will be recalled and used due to static constraint written before the
vector name.
And similarly, the reading of path ID from file and adding into vector won’t be
repeated again if the Boolean statement is triggered into true once the first reading
from file and creation of vector is done before.
23
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
if (idvector.contains(pathID)){
In detail, WriteFile method will write IR statements (stmt lines) of each path from the
beginning of the path to the end to the .txt file under the folder and file name
specified.
Note:
24
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
In retrieving the vector that contains the list, the user would have already input
path IDs that want to extract the java soure code into the file named idFile.txt under
the specified URL metioned in the program URL(eg:C:/myexperiment/idFile.txt)
and .So, there is a .txt file under the specified folder .
25
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
Then after that back to the next following lines under the ProveIntraPath
method under Analyzor class which are:
sootmethod = path.sm;
methodsignature = sootmethod.getSignature();
classname = this.classname();
try {
javaFile =getsourcfile();
b = Global.sceneDS.methodSig_gBody.get(methodsignature);
units = b.getUnits();
if (units.size() != 0) {
/** identify the first position */
u = (Unit) units.getFirst();
tag = u.getTag("LineNumberTag");
String tagstr = tag.toString();
if (u.getTag("LineNumberTag") != null) {
first = Integer.parseInt(u.getTag("LineNumberTag")
.toString());
/** get the last position */
u = (Unit) units.getLast();
last = Integer.parseInt(u.getTag("LineNumberTag")
.toString());
javaFileName = javaFile.getAbsolutePath();
int mindex = Global.sceneDS.sootMethods.indexOf(sootmethod);
}
}
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
vector= ps.idvector;
if(vector.contains(intrapathnum)){
javaFile=getsourcfile();
BufferedReader javareader = null;
try {
javareader = new BufferedReader(new
FileReader(javaFile));
} catch (FileNotFoundException e) {
System.out.println("ex:\t"+e);
}
int count_line=0;
line=javareader.readLine();
while(line!=null){
count_line++;
if(count_line==first){
26
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
write("/myexp/unsolveSRC.txt","Path
ID:\t"+intrapathnum+"\n");
}
if (count_line>= first && count_line<=last){
write("/myexp/unsolveSRC.txt",line);
}else if(count_line>last){
write("/myexp/unsolveSRC.txt","\nEnd of
Path-----------------------------------------------------------\n");
break;
}
line=javareader.readLine();
}
}
First of all and most importantly before getting the correct statements of the
perspective paths, IR statement of the current path id that system is currently
running is retrieved and put into the variable named sootmethod.
sootmethod = path.sm;
methodsignature = sootmethod.getSignature();
classname = this.classname();
b = Global.sceneDS.methodSig_gBody.get(methodsignature);
units = b.geUnits();
if (units.size() != 0) {
first = Integer.parseInt(u.getTag("LineNumberTag")
27
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
.toString());
javaFileName = javaFile.getAbsolutePath();
}
}
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
As a next, the vector where contain unsolvable path IDs, under printstmt class
is being called.
Then, check whether current path id ,intrapathnum contains within the vector.
vector= ps.idvector;
if(vector.contains(intrapathnum))
If yes, then the source file of pathid where obtained classname involved is
acquired by calling the getsourcefile()method as follows.
try {
javaFile =getsourcfile();
javaFinder = new
ClassSourceFileFinder(Global.argumentsDS.getSrcFolderPath())
;
javaFile = this.javaFinder.getJavaFile(classname);
After getting the java source file where contains the method that path forms,
here comes to the steps of reading the lines form the source file and writing into the
28
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
text file ,retrieving the correct java source code lines and writing them out on the .txt
file under the specified folder.
} catch (FileNotFoundException e) {
System.out.println("ex:\t"+e);
}
int count_line=0;
line=javareader.readLine();
Then, the lines in the file will be read from the beginning line to end line cause
the source file contains not only the method that path go through , but also the full
class coding .The following coding does these operations.
Check for first line
When first line is met, it will print the header indicating the path id
When the reading is equal to and between the first and last line, it will call the
write function to perform the writing on the specified folder and file which are
passed as arguments “/myexp/unsolvedSRC.txt”.
while(line!=null)
{
count_line++;
if(count_line==first)
{
write("/myexp/unsolveSRC.txt","Path ID:\t"+intrapathnum+"\n");
}
if (count_line>= first && count_line<=last)
{
write("/myexp/unsolveSRC.txt",line);
}
else if(count_line>last)
{
write("/myexp/unsolveSRC.txt","\nEnd of
Path-----------------------------------------------------------\n");
break;
}
line=javareader.readLine();
29
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
SO, this is basically how the implementation of the coding of printing the IR and
source codes of the user selected paths.
Note:
For complete coding of each of the methods and classes, please refer to
appendix A for your information. Here, I have separated the coding to explain their
performance upon their call of those calls and methods to write function of source
code and IR of the tested java program into the .txt file.
Now, IPathDetector2 have function capable of getting the source code and IR
of any paths of the tested program after analysis. This function was never
implemented for IPathdetector2 before and yet it is very helpful in many ways for the
analyzer in doing manual checking and also it is one of the best ways to locate the
errors in evaluation of the paths and do the review of analysis and also coding.
IT is the most reliable way to check the infeasibility in coding and it will help
analyzer to locate to the area where could the infeasibility have aroused.
Thus, to check the actual reason of the occurrence of path infeasibility , have
to manually compare and find out which kind of java source code generate the
(e.g.& symbols) in IR and Simplified IR expression .& symbol is the symbol founds
on majority of the unsolvable path id and thus comparison of source code and IR
coding is done to differentiate and assure that infeasibility is caused by actual
irregular symbols where computation can’t be done by the testing tools or testing
30
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
Previously, the source code and analysis of the analysed paths are only able
to be viewed by selecting the correct class name on HTML frame
The source code and IR representations are only viewable once at a time and
shown by HTML frame work and it’s not saveable in txt or word file
Have difficulty in printing out all the source code and IR representation
Have difficulty in location which class name or which source code and IR are
meant for which path id
Due to the time constraint, and focus on getting the manual analysis done
over a short time correctly, I have not done much decoration to this function to be
more visible which is immediate display of the source code and IR after the program
run in the form of HTML display.
Since , the current function written is able to successfully get the source code
and IR form of the any requested pathid of the tested java program in .txt file and
the file would be able to directly saved and print out. Thus, the anomalies would help
to do the user to complete many checking effectively and efficiently, the matter of
immediate display in HTML is like a part of not much difference in doing manual
31
Development of Software Testing and Analysis Tools –Part E
Chapter 4 Sub-system for infeasible path detection
analysis for analyzer and actually won’t be as useful and the current .txt file .Thus,
the function is not implemented in HTML display format.
Since there is a way to do in HTML display and if the writer would need to
make a display of source code and IR of selected paths only in future, I would like to
say the exact functions written for getting source and IR by path id could be simply
reuses without any modification. Additionally, the writer need is the functions to
convert to HTM file, and actually this conversion methods java2htmal and
convert2htmal file could be found under
ICISSootRenewed/ICISSootRenewed/IPathDetector2/src/emframe/emviewer.java2H
TML. So, by simply combing the codes of “attain the source and IR by path id
“combine together with “conver2htmal” and “java2htmal”, actually, it makes easier for
future writer in the following ways:
On one HTML frame, the classes and methods that appended in the appendix
A could be easily reused in conversion to HTML form directly without even needing
to do much modification and try to display to HTML frame.
The line number of the statements would be able to printed together easily by
just printing out the retrieved line number of the source code as request upon by the
user.
32
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
The main objective of doing manual analysis is due to the following reasons:
In detail, most of the infeasible paths in real code by just two properties
regardless of the programming languages used and program complexity. Based on
33
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
the two properties, we have developed a method to detect infeasible paths from a
given set of paths in CFG.
Any path P in a CFG that passes through a flag-based predicate node N such
that through propagating backward from N along only to nodes that involve
assignment of values to variables that may influence variables in (without
considering any assertions by conditions of branches encountered), symbolic
evaluation can evaluate that Q always holds regardless of values of external
variables, is infeasible, where Q is the condition of the branch at N in P.
Any path P in a CFG that passes through two e-correlated predicate nodes
N1 and N2 such that the following two conditions hold is infeasible:
34
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
From the given condition, it implies directly that there are no input values that
can exercise P. Therefore, P is infeasible. We can identify e-correlated predicate
nodes in a CFG solely based on checking the variables defined at and referenced by
nodes in CFG. Once the e-correlated predicate nodes in a CFG are identified, from
Property 2, we can infer the infeasibility of any path that passes through two e-
corrected predicate nodes such that the sub-path between the two e-correlated
predicate nodes is definition-clear with respect to the set of external variables that
are transitivity referenced at both e-correlated predicate nodes by applying symbolic
evaluation.[13]
The properties of the predicate nodes could possibly be the source of the
infeasibilities. Thus we have defined these two patterns to be used to test the
infeasible paths in our proposed tool (IPathDetector2).
1) Property1 :Flag-based
2) Property2:E-correlated
But there could be other possible source or form of statements that is unaware
or un-discovered by either Simplified or Z3 or IPathDetecotor2.Thus, thus the
manual analysis for comparing and confirm of the variations between the results of
the paths analyzed by different tool is done with the following purpose:
1)To find out the forms of infeasibility are causing the paths infeasible
35
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
2)To find out those source are whether from the two patterns defined in
IPathDetector 2 or new forms
Case 1:
If infeasibilities are from the two patterns defined in IPathDetector 2, this
could be due to human error in conversion of IR to IPthDetector2 input.
Case 2:
If infeasibilities are of new form un-included in the IPathDetector 2
program, then IPathDetector 2 is still not efficient tool for software testing
and need to edit the core functionality of the tool to detect all forms of
infeasibility.
The purpose is to compare how the result of analysis is achieved using different
IR forms and which is more reliable and easier and less time saving and trustworthy
and easy to understand and support visible result.
Since each path id might have 1 or 2 or more of the predicate nodes, it will be
quite troublesome for analyzer in manual analysis to use Jimple IR or Source code to
evaluate every path. Coding could be quite lengthy because sometimes the method
that is called is under different package of the different class or sometimes under the
directory of until package which is necessary to by name of the classes.
It could be quite difficult or takes longer time for analyzer to reach to the
conclusion and get the meaning of the operation of the predicate node using Jimple
IR or Souce code. Thus, most of manual analysis is done using Input IR to Simplify.
Total numbers of 106 paths are done for intrapath debug under the JCM for
manual analysis using Input IR to Simplify. Total numbers of 25 paths are done for
intrapath debug under the Jtopass for manual analysis. 4 paths out of 25 paths are
36
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
done manual analysis using JImple IR and 21 Paths out of 25 is done manual
analysis using Input IR to Simplify.
Using which IR is better for when and how and the advantages of using of each
of IR statements or Simple IR expression will be shown with the explanation of each
patterns under the manual analysis 1,2 and 3.Classification of manual analysis done
is as follows:
Using Jimple IR :
Results of Manual Analysis: F stands for feasible and I stands for Infeasibler1:
IPathDetector 2 , r2: Simplify + Z3, 0 means feasible , 1 means infeasible -1
means unsolvable/ unknown
37
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Under the evaluation using Input IR to Simplify, it can be sub grouped into 3
different groups based on the number of expression lines included under each path.
1) Pattern 1
Result of Manual
Path ID Analysis
100 F
101 F
113 F
114 F
119 F
120 F
242 F
245 F
358 F
362 F
367 F
855 F
2) Pattern 2
Result of Manual
Path ID Analysis
237 F
238 F
239 F
240 F
241 F
243 F
244 F
852 F
3) Pattern 3
Result of Manual
Path ID Analysis
38
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
488 F
5.3.1 Path Evaluation
#end
As simple as it looks, the analysis is also short and simple, since there is only
one line of expression involved.
Line 1: varible0 (V0) is bit-and with integer 2, which is represented in 2L and
tested whether the result is equal to 0.Since value of V0 is not defined
within the path, it is assumed as an external variable where any value or
number could be possible and thus the result of bit-and of V0 with 2 may
also be any value.
Thus, the result may be equal to zero and this expression is feasible. Thus,
path id 100 is feasible.
#end
The manual analysis for this kind of path is still short and simple, since there is
only two lines of expression involved.
Line 1: varible0 (V0) is bit-and with integer 2, which is represented in 2L and
tested whether the result is equal to 0. Since value of V0 is not defined
within the path, it is assumed as an external variable where any value or
number could be possible and thus the result of bit-and of V0 with 2 may
also be any value. Thus, the result may be equal to zero and this
expression is feasible.
39
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
#end
Line 1: variable named flagMask is bit-and with integer 3, and tested whether
the result is equal to 3. Since value of flagMask is not defined within the
path, it is assumed as an external variable where any value or number
could be possible and thus the result of bit-and of flagMask with 3 may
also be any value. So this expression is feasible.
Line 2: variable named flags is bit-and with integer 3, and tested whether the
result is not equal to 0.Since value of flags is not defined within the path,
it is assumed as an external variable where any value or number could
be possible and thus the result of bit-and of flags with 3 may also be any
value. So this expression is feasible.
Line 3: variable named flags is bit-and with integer 2, and tested whether the
result is equal to 0. Since value of flags is not defined within the path, it is
assumed as an external variable where any value or number could be
possible and thus the result of bit-and of flags with 3 may also be any
value. Additionally, we know flags bit-and 3 are not equal to zero. But
how can we assure flags bit-and 2 is equal to 0 in contrast to line
no2.See the diagrammatic explanation for clearer view of result.
40
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
After the manual analysis done, there are 7 different groups of patterns of
coding a 4 out of them are major different courses of infeasibility of the paths.
Actually, the source of the infeasibility is found out to be due to majorly of infeasible
coding in e-correlated nodes. So 7different patterns of coding could be groups
according to the path id.
Possible values of flag when flags bit-and 3 results not equal to 0. So this
expression is feasible. And thus, this path 488 is feasible overall.
For the rest of the other path id which has been done the manual analysis1 are
feasible although found involvement of & operator on at least one of the predicate
nodes under each of the path that have done manual analysis.
Which falls under which pattern of IR is show in the diagrams as above. Thus,
which kind of operation or symbol or calculation in source code would give this &
symbol representation in the IR predicate nodes.
V.4Manual Analysis 2
Manual evaluation is done for 106 paths and there are 7 patterns of IR under this
manual analysis are as follows:
1)pattern 1
Result of Manual
Path ID Analysis
938 F
940 I
941 I
943 I
947 I
2)pattern 2
Result of Manual
Path ID Analysis
948 F
1012 F
1092 F
1093 I
1094 I
1098 I
1099 F
1109 F
1112 F
1113 F
1137 I
1138 I
1144 I
1145 I
1146 I
1147 I
3)pattern 3
42
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Result of Manual
Path ID Analysis
1322 I
1327 I
4)pattern 4
Path
ID Result of Manual Analysis
1461 F
1462 F
1463 F
1469 F
1470 F
1471 F
1545 I
1991 F
1993 F
1994 F
5) pattern 5
Result of Manual
Path ID Analysis
2074 I
2076 I
2077 I
2078 I
2079 I
2081 I
2082 I
2083 I
2084 I
6) pattern 6
Result of Manual
Path ID Analysis
2102 F
2103 I
43
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
2104 I
2105 I
2106 I
2107 F
2108 I
2109 I
2110 F
2111 I
2112 I
2113 I
2114 I
2115 F
2116 I
2117 I
2118 F
2119 I
2120 I
2121 I
2122 I
2123 F
2124 I
2125 I
7) pattern 7
Result of Manual
Path ID Analysis
2271 F
2292 F
2294 F
2295 F
2559 F
2561 F
2562 F
2685 F
2687 F
2688 F
2689 F
2729 F
44
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Method 1:
First of all, spot if there any variable or function or number or object that is
used in the predicate nodes under a path more than one time. If yes, mark the
lines they are used and check the statements written for each line agree to
another line.
Method 2:
While looking for the usage of variables or numbers or any other item
more than once in predicate nodes, if the node coding is complex and lengthy,
look for most identical form of statement line that used the most number of
identical items more than once from the very first line to the last line under the
path.
Method 3:
Next after the first method is used, and still found not infeasibility, go
through line by line checking the tested value of the variable is feasible for the
45
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Pattern1
1(EQ N1 0)
2(EQ N3 0)
#end
Line no 1: Unique float Number1 is equal to zero, if yes, continue to next line
Line no 2: Line 1 is true, thus test whether Unique float Number3 is equal to
zero and move to next line
Line 3: Unique float Number5 is equal to external variable 5.Here x is external
variable and can be equal to any value. And also N5 value is not defined
under the path, so assumed as coming from outside of the path and thus
it is feasible for N5 to be equal to x.
Line 4: line no 3 is correct, thus, continue to test whether Unique Float Number7
is equal to F0.Same logic as in line 3, since both N7 and F0 valued are
not defined within the path, they both are assumed as external variable
and thus N7 (any number)not greater than or equal to F0 is feasible and
move to last line.
Line 5: test whether zeros is not greater than adding the external variable width
plus 2.This is feasible too.
46
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
1 (EQ N1 0)
2 (EQ N3 0)
6 (> 0 width)
#end
Variable width is tested in both line no 5 and 6.so line no 5 and 6 should
possibly be having e-correlate infeasibility.
Line no 7, 8, 9 have also used the same variable x for predicate nodes. Thus the
infeasibility might be there too.
Line 1: (EQ N1 0): Consider number1 (N1) as external value, so any number
could be possible for the value of it. Thus, testing whether number1 is
equal to 0 is feasible. So proceed to line no2.
Line 2: (EQ N3 0): Same logic applied as in line 1 and thus go to next line.
Line 3: (NOT (NOT (EQ N5 x))): Consider number5 (N5) as external value, so
any number could be possible for the value of it. Thus, testing whether
47
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
48
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Pattern2
1(EQ N1 0)
2(EQ N3 0)
4(>= N7 F0)
#end
Line 1: unique number N1 has not predefined value under the path. So, it is
assumed as external variable, thus any value could be possible.
So testing whether N1 is equal to 0 is feasible and move to line 2.
Line 2: same logic is applied as line1, so it is feasible too.
Line 3: both N5 and x has not predefined value within the path, so both are
assumed as external variable and thus the expression is feasible too.
Line 4: same as line 1, 2, 3, here external variable N7 will be of any value .And,
the function0 F0 is also undefined, thus assumed to give any value, so
N7 greater than or equal to F0 is feasible too.
Line 5: width could be assumed as external variable and thus 0 not greater than
or width is feasible.
As went through line by line and explained above ,there are no variable or
function or Number has been used more than once in predicate nodes and clearly
49
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
thus there is not conflict between flag- based pattern or e-correlated pattern of the
predicate nodes under path id 948, thus path id 948 is concluded as feasible.
4 (EQ tok 4)
5 (EQ F0 0)
7 (EQ (& V3 8) 0)
#end
Path id 1093 is infeasible due to the infeasibility of nodes in line number7, 9 and
11.
But, let me do the analysis line by line for clearer view of the process of manual
analysis and better understanding of finding the source of infeasibility.
Here aware that line no 1 to 4 is using same variable to test predicate node again
and again, so there might be infeasibility due to e-correlated nodes in any two or
more than two of them.
50
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Also in line no 7, 9 and 11, the same variable3 (V3) is used to test the predicate
node again and again, so there might be infeasibility due to e-correlated nodes
infeasibility.
So, look for that line carefully.
Line 1 :( NOT (EQ tok 2)): consider variable tok as external value, so any
number could be possible for the value of variable tok. Thus, testing
whether tok is not equal to 2 is feasible. So proceed to line no2
Line 2: (NOT (EQ tok 3)): Same logic applied as in line 1 and thus go to next line
Line 3: (NOT (EQ tok 1)): Same logic applied as in line 1 and thus go to next
line
Line 4: (EQ tok 4): Since consider variable tok as external value, so any number
could be possible for the value of variable tok. Thus, testing whether tok
is equal to 4 and since according to line 1 ,2 and 3 ,variable tok is not
equal to 1 or 2 or 3 .Hence there is not confliction of values for tok
variable, line no 4 is feasible. So proceed to line no5
Line 5 :( EQ F0 0): consider function0 as unknown function, so any number
could be possible. Thus, testing whether function0 is equal to 0 is
feasible. So proceed to next line.
Line 6 :( NOT (EQ F1 0)): consider function0 as unknown function, so any
number could be possible. Thus, testing whether function0 is not equal to
0 is feasible. So proceed to next line.
Line 7 :( EQ (& V3 8) 0): Test Variable3 bit-and constant number 8 is not equal
to 0. So hence variable3 is considered as external value, so any number
could be possible for the value of variable3 as in line 9. There is a bit-and
operation between Variable3 and 8, so if any no bit-and 8 could be any
no. Thus, testing whether the result of (0 bit-and a constant) would not
be equal to 0 is infeasible.
Line 8 :( NOT (EQ F2 0)): Same logic applied as in line 6 and thus go to next line
Line 9: (EQ (& V3 16) 0): Same logic applied as in line 7 and thus go to next line
Line no 10: (NOT (EQ F3 0)): test function3 is not equal to 0. So hence function3
is considered as unknown function, so any number could be possible for
51
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Pattern3
In this pattern, each predicate node has multiple phases of mathematical and
relational operators. But, the same basic logic of math calculation is applied in
solving the complex mathematical form .So, the ones inside the inner most cal
brackets are solved first before going out of the cal bracket.
But, it will take longer time to go through line by line for every path and yet there
are many paths to do manual analysis for each tested project.
Thus, the method to do manual analysis is specified for the below purpose:
Here, pattern 3 example will show how method 1 is useful in manual analysis
of the infeasibility of the predicate nodes. You can see identical cases in the path id
1093 to see how this method1 could be applicable in doing manual analysis. You
can see identical cases in path id 940 to see how this method1 could be applicable
in doing manual analysis.
52
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
26(>= y ymin)
#end
So, if we check the above coding, we can see that variables named labelCt,
left,width, top, gap, x, I, V6,V8,V9,V7 are the variables and N2,N6 are the numbers
that has been used more than once in the predicate nodes under the same path.
Start off with any variable or Number that you would like to check. So, let me
follow the sequence of the variable that written on the program. Thus, since the
Simplified Expression of IR are lengthy and involve steps of mathematical calculation
for each of predicate node, it better to use 3 methods to scan through the
Expressions before doing analyzing line by line.
Line no 1 :( NOT (EQ V0 null)) the identical statement in line no 1 is used again
in line no 9, 13.There is no infeasibility found. So move to next or other
line.
Line no 2: has not been used more than once and its expression alone itself is
feasible. Identical statement as in line no 1 is used in line 4 and 19.
There is no infeasibility found. So move to other lines.
Line no 3: has not been used more than once and its expression alone itself is
feasible. So move to next or other lines.
Line no 4: has been tested before so move to line 5.
Line no 6: has not been used more than once and its expression alone itself is
feasible. So move to next or other lines.
54
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
For line 7: variable labelCt is used in line no 7, 11, 15, 17, 18, 21, 25,28and 29 in
logical operation with other external variables and constants. So,iIn line
7(NOT (> labelCt 2)) is feasible since labelCt is external variable and any
value could be possible. So labelCt could be not larger than 2 but the
rest of the expressions coming upfront would agree line 7.so line 11,
labelCt not greater than or equal to 50 is also feasible. Thus, line 11, 15,
17, 18, 21, 25,28and 29 are all feasible.
Line no 8: has not been used more than once and its expression alone itself.
For line 10 and 14 and 20 and 24: are the expression that been totally identical
to each other. But if you see in line 10, the result of left plus width minus
gap and then minus N2 is smaller than or equal to V6.but in line 14 is
testing whether ,the result of left plus width minus gap and then minus
N2 is greater than V6.So, this two predicate nodes are infeasible by e-
correlated pattern. The same logic applies to line 20 and 24.
So, this path id is infeasible due to line 10 and 14 and 20 and 24.
Pattern4
(EQ N1 0)
#end
Line1: since there is no predefined value for Unique Number 1 within the path,
the testing of whether N1 equal to 0 is feasible.
Line 2: Same logic as line 1, there is no predefined value for result of function0
F0, the testing of whether N3 is not greater than F0 is feasible.
Line 2: Same logic as line 1, there is no predefined value for result of function0
F0, and here we do not know the exact value of both N3 and N5,the
testing of whether N5 is not less than or equal to F0 still not violate the
line no 2, so is feasible.
55
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
So even though F0 is used more than once under this path, the strong evidence
of e-correlated pattern of infeasible cannot be seen. It is concluded as
feasible.
6(< i F0)
#end
For this path ‘s expression, the expressions are rather short and simple but still
found repetitive use of some variables in more than one predicate nodes. They are i,
and F0 and V1.
Variable i is used in line 1 and 5 and F0 is used in line 3 and 6 and V1 is used
in line 2 and 4. If start analyzing with i, in line 1, I is equal to 0,so in line 5 I is not less
than zero means I is greater than or equal to zero so, thus line 1 and 5 are feasible.
But in line 6 I is in logical operation with F0. Here it is tested whether i is less than
F0.
But under this path, F0 values are not external. F0 is actually defined in line 3
that F0 is equal to zero. So in above according to line 1 and 5, I is greater than or
equal to 0.Thus, testing i is less than F0 (which is equal to zero) in line 6 makes
infeasible due to line 3 and 5.
This infeasibility is the e-correlated feasibility.
Pattern5
56
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
#end
In path id 2074, the expressions are not so long and complicated but you can
see there are some identical expressions from line 9, 10, and 11 and also 14, 15 and
16.
Other than those lines, there are no other predicate nodes where variables or
numbers or functions are used more than once.
57
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Let start the analysis from those typical lines first and then only after finished
those lines, to other lines. If we see line no 9, the expression said that variable is not
greater the result of the variable named pixwidth and Number0 .So since both
variable x and pixwidth have not been defined under this path, they are assumed as
external variable and thus any value could be possible for them. So, N9 which is a
unique float no is multiplied with pixwidth, result could be possible of any number.
So, line 9 is feasible that x could be not greater than pixwidth * N9 is feasible.
The same logic applied to line 10 and it is also feasible. But in line 11, the
exactly same variables are used as in line 9 but the logical operator is opposite and
here is testing x is less than or equal to the result of pixwidth * N9.Sine assumed that
line 9 and 10 is feasible and moved on to line 11, how can it be feasible to say that
the current expression which the opposite expression of previously feasible is
feasible.
Thus line 11 is infeasible due to line 9 and 10 and it is an e-correlated pattern of
infeasibility.
Pattern6
58
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
#end
Under this path, it is seen that variabl1 (V1) and variable named buttonSet is
tested with different constand numbers in each predicate node.So, although there
are a few numbers of lines of expressions, they are just typically testing the value of
variable1 and buttonSet with constant numbers one line alternately.Thus, buttonSet
in involved in odd line numbers such as 1, 3, 5 and so on and V1 is involved in even
line no 2, 4,6 and so on.
59
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
So, using the same logic as in line 2, line 4, 6,8,10, 12 are feasible too.
But obviously, on the line 14 and 16 :the expression of the relational operator is
totally opposite of line 10 and 12.Since assumed line expression in line 10 and 12
are feasible and thus continued to line 12 and 14 , the expression in line 12 and 14
should match to what is it is like 10 and 12.Since both of each are not in contrast to
each other, line 14 is infeasible in contrast to line 10 and 16 is infeasible in contrast
to line 12.
Pattern7
1(EQ N1 0)
#end
60
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
In line 1: the expression (EQ N1 0) means a unique float number1 (N1) is equal
to 1.It is feasible.
Line 2: the expression (NOT (EQ N3 0)) means a unique float number3 is not
equal to 0. It is feasible and move to next line.
Line 3: the expression (NOT (EQ V0 null)) means variable0 is not equal to null. It
is feasible and move to next line.
Line 4: the expression (NOT (EQ V2 null))means variable2 is not equal to null. It
is feasible and move to next line.
Line 5: the expression ((NOT (EQ (& N5 V3) V3)) means bit-and of N5 and V3
which are both are external variable is not equal to V3.It is feasible to.
So, it is sure that there is not flag-based pattern of infeasibility. If you review,
there is not repetitive usage of the variables or numbers under this path and thus
there is no e-correlated infeasibility. From this path onwards, the other paths having
the same pattern of expression are all feasible and thus this path is concluded as
feasible.
The rest of the paths are classified into these 7 different forms of groups as in
aboved 7 patterns. It is found that 35 paths out of all the total paths that done manual
analyses are feasible. The rest of 71 paths out of 106 paths are infeasible.
All the infeasibilities aroused are due to either of the flag-based or e-correlated
pattern of infeasibility. All the infeasibilities aroused are due to either of the flag-
based or e-correlated pattern of infeasibility
Result of Manual
Path ID Analysis
192 I
61
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
194 I
195 I
196 I
62
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
In line 7: the IR expression is testing whether start less than add the Substring
from String of the image into the Linked list named line as an object.
But since due to line no 6,it is concluded that int type length of the
String of image is 0 or negative value. That means there is not length in
the String of the image. How is it feasible to get the substring of the
non-exist String and put them in Linked list?
Thus line 6 and 7 are infeasible due to e-correlated pattern.
So the follow up IR representations under this node is the predicate nodes and
continual operations with relate to image and built Linked List. Thus, since node 6
and 7 are infeasible, the rest of the nodes under 7 are considerably inoperable.
Found no typical use of any of the symbols like %( Mod) , or & (bitwise and) , or |
(bitwise or).
The infeasibility occurs for each of the rest of the path id under Manual analysis
3 is also due exactly the same source of e-correlated pattern, which are flag-bases
and e-correlated patterns of predicate nodes.
JToPass:
Result of Manual
Path ID IPathdetector 2 Simplifeid + Z3 Analysis
100 F U F
101 F U F
113 F U F
114 F U F
119 F U F
120 F U F
237 F U F
238 F U F
239 F U F
240 F U F
241 F U F
242 F U F
243 F U F
63
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
244 F U F
245 F U F
358 F U F
362 F U F
367 F U F
488 F U F
852 F U F
855 F U F
JCM:
Result of Manual
Path ID IPathdetector 2 Simplifeid + Z3 Analysis
938 F U F
940 F U I
941 F U I
943 F U I
947 F U I
948 F U F
1012 F I F
1092 F I F
1093 F I I
1094 F I I
1098 F I I
1099 F I F
1109 F I F
1112 F I F
1113 F I F
1137 F I I
1138 F I I
1144 F I I
1145 F I I
1146 F I I
1147 F I I
1322 F I I
1327 F I I
1461 F U F
1462 F U F
1463 F U F
1469 F U F
Result of Manual
Path ID IPathdetector 2 Simplifeid + Z3 Analysis
1470 F U F
64
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
1471 F U F
1545 F U I
1991 F U F
1993 F U F
1994 F U F
2074 F I I
2076 F I I
2077 F I I
2078 F I I
2079 F I I
2081 F I I
2082 F I I
2083 F I I
2084 F I I
2102 F I F
2103 F I I
2104 F I I
2105 F I I
2106 F I I
2107 F I F
2108 F I I
2109 F I I
2110 F I F
2111 F I I
2112 F I I
2113 F I I
2114 F I I
2115 F I F
Result of Manual
Path ID IPathdetector 2 Simplifeid + Z3 Analysis
2116 F I I
2117 F I I
2118 F I F
2119 F I I
2120 F I I
2121 F I I
2122 F I I
2123 F I F
2124 F I I
2125 F I I
2271 F U F
2292 F U F
2294 F U F
2295 F U F
65
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
2559 F U F
2561 F U F
2562 F U F
2685 F I F
2687 F I F
2688 F I F
2689 F I F
2729 F I F
CHAPTER 6 CONCLUSION
66
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
67
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
2) Rare operations: %, &, |, which are not well supported by Simplify, ahough Z3
supports them. However the bit size is required by Z3. But it is hard to get the
bit size for one external variable. In another word, Z3 is treated as “not
support” these operations.
This would result as unsolvable path in Z3 because the input pattern of &
operation predicate nodes require the input the exact total number of bits of
the variables using & operator, only then bit-wise and will do the operation. It
is not possible to know and define the exact number of bits for the
complicated external variables or call functions involved in & operation for
each predicate node.
3) High degree: After manually checking for several times, there are certain
cases in which the degree is larger than 1. For example:
If( x*(y+3)>5)
NOT(<= (- (- (+ left width) gap)N2) V6))
68
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
Above cases are causing the differences between the proposed method and
actual infeasible paths .Since Z3 also doesn’t support such cases, the result
will be “unknown”. I have asked this question on its forum, but I haven’t got
answers. Both of the above two cases are rare but they does exist.
In Conclusion, the real cause of variations in tools results and reasons for not
detecting correctly by certain tools are not due to logic error in programming and
probably due to coding encapsulation error.
Z3 (exact number of bits for the complicated external variables or call functions
involved in & operation for each predicate node.)
Simplify (supports only the int data type), this would be the reason for some
unsolved paths involving many variables of different types.
I path detector 2 does not fully covering the detection of predicate nodes which
include the high degree calculation and unusual symbols usage. Thus, the
improvements of the IPathdetector 2 would be achieved by inserting the function
what capable of detections of the above symptoms occurrence .Other than that,
there is no logical error found on detection of 2 patterns of infeasibility on predicates
nodes. Only conflicts occurred, when predicate nodes involve the unusual symbols
and high degree calculation
69
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
REFERENCES
70
Development of Software Testing and Analysis Tools –Part E
Chapter 5 Manual Evaluation of Path Feasibility
[8]Arni Einarsson and Janus Dam Nielsen, BRICS,” A Survivor’s Guide toJava
Program Analysis with Soot” , Department of Computer Science, University of
Aarhus, Denmark, Version 1.1,July 2008
[9]Kuan ,T, Hui, L., “Extracting Cause-Effect from Code to Aid Software Testing”,
Working Paper,2007
[11] Laurie Hendren, Patrick Lam, Jennifer Lhotak, Ondrej Lhotak, , and Feng Qian.
Soot, a tool for analyzing and transforming java bytecode.
[12] Waston A., Error Detection with Basis Path Testing,” McCabe & Associates
Outlook, Winter 1995-1996
[13] Hee Beng Kuan Tan, Minh Ngoc Ngo, Hongyu Zhang, and Lwin Khin Sha,”
Detecting Infeasible Paths from Their Properties in Real Code”, School of Electrical
and Electronic Engineering, Nanyang Technological University
[14] Goldberg, A., Wang, T.C. and Zimmerman, D., “Applications of feasible path
analysis to program testing”. In proceeding of the 1994 International Symposium on
Software Testing and Analysis (ISSTA), 17-19 Aug. Seattle,
WA, USA, 1994
[15] Korel, B, “Automated Software Test Data Generation,IEEE Transactions on
Software Engineering”,1990
[17] Frank M.Carrano Janet J. Prichard,”Data Abstraction and Problem Solving with
Java, Walls and Mirrors”,First Edition,Univrsity of Rhode Island, 2001
[18] Zhu, H., Hall, P.A.V. and May, J.H.R. 1997. Software unit test coverage and
adequacy. ACM Computing Surveys, 29 (4). 366-427.
[20] Kaner,C. Bach, J. and Pettichord, B., “Lessons Learned in Software Testing”,
John Wiley & Sons, 2002.
72
Development of Software Testing and Analysis Tools –Part E
Appendix 1: Master Student Mark Calculation Program with GUI
A1.1.1 MasterStudentDatabase.java
/*
* MasterStudentDtabase.java
*
* Created on September 11, 2009, 3:26 PM
*/
package PackageGUI;
/**
*
* @author WINXP
*/
public class MasterStudentDatabase extends javax.swing.JFrame {
int SheetCount = 0;
String Status = "";
boolean AfterSaving = false;
PackageUtil.Table_Sheet sTable = new PackageUtil.Table_Sheet();
/** Creates new form MasterStudentDtabase */
public MasterStudentDatabase() {
initComponents();
}
jMenu3.setText("File");
jMenuBar2.add(jMenu3);
jMenu4.setText("Edit");
jMenuBar2.add(jMenu4);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Master Student Database");
pnContainer.setAutoscrolls(true);
pnContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment
.LEADING)
.addGap(0, 942, Short.MAX_VALUE)
);
pnContainerLayout.setVerticalGroup(
pnContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment
.LEADING)
.addGap(0, 545, Short.MAX_VALUE)
);
mnuNew.setText("File");
mnuNew.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuNewActionPerformed(evt);
}
});
mnuNew.add(jSeparator1);
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.e
vent.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Blank.png")))
; // NOI18N
jMenuItem1.setText("New");
jMenuItem1.addActionListener(new
java.awt.event.ActionListener() {
Development of Software Testing and Analysis Tools –Part E
A-2
Appendix 1: Master Student Mark Calculation Program with GUI
mnuOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.even
t.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
mnuOpen.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Open.png")));
// NOI18N
mnuOpen.setText("Open");
mnuOpen.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuOpenActionPerformed(evt);
}
});
mnuNew.add(mnuOpen);
mnuNew.add(jSeparator2);
mnuSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.even
t.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
mnuSave.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Save.png")));
// NOI18N
mnuSave.setText("Save");
mnuSave.setEnabled(false);
mnuSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuSaveActionPerformed(evt);
}
});
mnuNew.add(mnuSave);
mnuSaveAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.ev
ent.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK |
java.awt.event.InputEvent.CTRL_MASK));
mnuSaveAs.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Save
As.png"))); // NOI18N
mnuSaveAs.setText("Save As");
mnuSaveAs.setEnabled(false);
mnuSaveAs.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuSaveAsActionPerformed(evt);
}
});
mnuNew.add(mnuSaveAs);
mnuNew.add(jSeparator3);
Development of Software Testing and Analysis Tools –Part E
A-3
Appendix 1: Master Student Mark Calculation Program with GUI
mnuPrint.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.eve
nt.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
mnuPrint.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Print.png")))
; // NOI18N
mnuPrint.setText("Print");
mnuPrint.setEnabled(false);
mnuPrint.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuPrintActionPerformed(evt);
}
});
mnuNew.add(mnuPrint);
mnuNew.add(jSeparator4);
mnuClose.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.eve
nt.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));
mnuClose.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Close.png")))
; // NOI18N
mnuClose.setText("Close");
mnuClose.setEnabled(false);
mnuClose.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuCloseActionPerformed(evt);
}
});
mnuNew.add(mnuClose);
mnuNew.add(jSeparator6);
mnuExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.even
t.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
mnuExit.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Exit.png")));
// NOI18N
mnuExit.setText("Exit");
mnuExit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuExitActionPerformed(evt);
}
});
mnuNew.add(mnuExit);
jMenuBar1.add(mnuNew);
jMenu2.setText("Edit");
mnuAddRow.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.ev
ent.KeyEvent.VK_R, java.awt.event.InputEvent.ALT_MASK));
mnuAddRow.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/AddRow.png"))
); // NOI18N
mnuAddRow.setText("Add New Row");
mnuAddRow.setEnabled(false);
mnuAddRow.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuAddRowActionPerformed(evt);
}
});
jMenu2.add(mnuAddRow);
mnuDeleteRow.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt
.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK));
mnuDeleteRow.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Delete
Row.png"))); // NOI18N
mnuDeleteRow.setText("Delete Row");
mnuDeleteRow.setEnabled(false);
mnuDeleteRow.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuDeleteRowActionPerformed(evt);
}
});
jMenu2.add(mnuDeleteRow);
jMenuBar1.add(jMenu2);
jMenu5.setText("View");
mnuSelectAll.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt
.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
mnuSelectAll.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/PackageGUI/Select
All.png"))); // NOI18N
mnuSelectAll.setText("Select All");
mnuSelectAll.setEnabled(false);
mnuSelectAll.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{
mnuSelectAllActionPerformed(evt);
}
});
jMenu5.add(mnuSelectAll);
jMenuBar1.add(jMenu5);
setJMenuBar(jMenuBar1);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnContainer,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnContainer,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
}//GEN-LAST:event_mnuNewActionPerformed
SheetName = sTable.Open();
if(SheetCount == 0)
{
sTable.setBounds(0,0,945, 450);
sTable.setTitle(SheetName);
sTable.setVisible(true);
sTable.setResizable(true);
pnContainer.add(sTable);
mnuClose.setEnabled(true);
}
}//GEN-LAST:event_mnuOpenActionPerformed
mnuSaveAs.setEnabled(true);
mnuPrint.setEnabled(true);
}//GEN-LAST:event_jMenuItem1ActionPerformed
int responseType;
responseType = javax.swing.JOptionPane.showConfirmDialog(null,
"Would You Like To Save Student Marks Information.",
"Saving Confirmation",1);
if(responseType==0)
{
if(AfterSaving == true)
{
sTable.DirectSaving();
}
else
{
sTable.Save();
}
}
else if(responseType==1)
{
SheetCount = 0;
sTable.dispose();
mnuClose.setEnabled(false);
mnuDeleteRow.setEnabled(false);
mnuAddRow.setEnabled(false);
mnuSelectAll.setEnabled(false);
mnuSave.setEnabled(false);
mnuSaveAs.setEnabled(false);
mnuPrint.setEnabled(false);
}
}//GEN-LAST:event_mnuCloseActionPerformed
}//GEN-LAST:event_mnuSaveActionPerformed
if(SheetCount > 0)
{
int responseType;
responseType =
javax.swing.JOptionPane.showConfirmDialog(null, "Would You Like To Save
Student Marks Information.",
"Saving Confirmation",1);
if(responseType==0)
{
if(AfterSaving)
{
sTable.DirectSaving();
}
else
{
sTable.Save();
}
}
else if(responseType==1)
{
System.exit(0);
}
}
}//GEN-LAST:event_mnuExitActionPerformed
sTable.spDeleteRow() ;
}//GEN-LAST:event_mnuDeleteRowActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MasterStudentDatabase().setVisible(true);
}
});
}
A1.2.1Data ValuesTable.java
package PackageUtil;
import javax.swing.table.*;
import javax.swing.JOptionPane;
import javax.swing.JFileChooser;
//if Checking Ok
if (valid == true)
{
if (CheckFullyEntered(row)==true)
Development of Software Testing and Analysis Tools –Part E
A-11
Appendix 1: Master Student Mark Calculation Program with GUI
{
Object objTotal = new Object();
objTotal = (Object)CalculateTotal(row);
data.set(row,7,objTotal);
fireTableDataChanged();
}
else
{
}
else
{
//if Checking Not Ok, Clear Data and Not set
data.set(row,col,null);
JOptionPane.showMessageDialog(null,"Please, Enter Only
Number For Student Marks.","Invalid
Input",JOptionPane.INFORMATION_MESSAGE);
}
}
return Total;
for(int i=0;i<=6;i++)
{
if(getValueAt(row,i) == null)
{
entered = false;
break;
}
else
{
entered = true;
}
}
return entered;
}
filename =
jFileChoose.getSelectedFile().getCanonicalFile().getCanonicalPath() +
".srl";
CurrentPath =
jFileChoose.getSelectedFile().getCanonicalFile().getCanonicalPath() +
".srl";
java.io.ObjectOutputStream writer = new
java.io.ObjectOutputStream(new java.io.FileOutputStream(filename));
writer.writeObject(this.data);
writer.close();
JOptionPane.showMessageDialog(null,"Student Marks
Information Successfully Saved.",
"Successfully
Saved",JOptionPane.INFORMATION_MESSAGE);
}
catch (java.io.IOException e)
{
JOptionPane.showMessageDialog(null,"Error Occurs
While Saving Student Marks Information.",
"Failed To Save",JOptionPane.ERROR_MESSAGE);
}
return SheetName;
if(jFileChoose.showOpenDialog(null) ==
JFileChooser.APPROVE_OPTION)
{
if(jFileChoose.getSelectedFile().getName().toLowerCase().endsWith(".srl
") )
{
try
{
java.io.ObjectInputStream reader = new
java.io.ObjectInputStream(
new
java.io.FileInputStream(jFileChoose.getSelectedFile().getCanonicalPath(
)));
SheetName =
jFileChoose.getSelectedFile().getName().toString();
obj = (Object)reader.readObject();
this.data = (Vector2D)obj;
}
catch(java.io.IOException ex )
{
Development of Software Testing and Analysis Tools –Part E
A-14
Appendix 1: Master Student Mark Calculation Program with GUI
JOptionPane.showMessageDialog(null,"Error
Occurs While Opening Student Marks Information.",
"Failed To
Open",JOptionPane.ERROR_MESSAGE);
}
catch(ClassNotFoundException ex )
{
JOptionPane.showMessageDialog(null,"Error
Occurs While Opening Student Marks Information.",
"Failed To
Open",JOptionPane.ERROR_MESSAGE);
}
}
}
return SheetName;
}
if(obj==null)
{
data.set(j,i,null);
fireTableDataChanged();
}
else
{
data.set(j,i,obj);
fireTableDataChanged();
}
}
}
}
A1.2.2 RowHeader.java
package PackageUtil;
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
this.setListData(liste);
this.setFixedCellWidth(25);
this.setFixedCellHeight(table.getRowHeight());
this.setCellRenderer(new RowHeaderRenderer(table));
}
}
A1.2.3 Table_Sheet.java
package PackageUtil;
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.JTable;
import java.io.*;
public Table_Sheet()
{
Container pane = getContentPane();
pane.setLayout(new BorderLayout());
tv = new DataValuesTable(15,8);
initTable();
packColumns(tblMain,0);
tblMain.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
tblMain.setColumnSelectionAllowed(true);
tblMain.setRowSelectionAllowed(true);
tblMain.getColumnModel().getColumn(0).setHeaderValue("Matric
Number");
tblMain.getColumnModel().getColumn(1).setHeaderValue("Project/Student
Name");
tblMain.getColumnModel().getColumn(2).setHeaderValue("1st
Asessment (10%)");
tblMain.getColumnModel().getColumn(3).setHeaderValue("2nd
Asessment (10%)");
tblMain.getColumnModel().getColumn(4).setHeaderValue("Final
Assessment (50%)");
tblMain.getColumnModel().getColumn(5).setHeaderValue("Indep Sd
(20%)");
tblMain.getColumnModel().getColumn(6).setHeaderValue("PM Tr
(10%)");
tblMain.getColumnModel().getColumn(7).setHeaderValue("Total");
tblMain.getColumnModel().setColumnSelectionAllowed(false);
packColumns(tblMain,0);
}
jspContainer.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWA
YS);
jspContainer.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_
ALWAYS);
jspContainer.setRowHeaderView(new RowHeader(tblMain));
}
width += 2*margin;
col.setPreferredWidth(width);
}
if(jFileChoose.showSaveDialog(null) == JFileChooser.APPROVE_OPTION)
{
try
{
filename =
jFileChoose.getSelectedFile().getCanonicalFile().getCanonicalPath() +
".xls";
TableModel tblModel = tblMain.getModel();
FileWriter objWriter = new FileWriter(filename);
objWriter.write("\n");
objWriter.write(tblModel.getValueAt(i,j).toString()+"\t");
}
}
objWriter.write("\n");
}
objWriter.close();
JOptionPane.showMessageDialog(null,"Student Marks
Information Successfully Saved to Excel File.",
"Successfully Saved",JOptionPane.INFORMATION_MESSAGE);
}
catch(FileNotFoundException fnf)
{
JOptionPane.showMessageDialog(null,"Excel File Cannont
Create. Failed To Save.",
"File Cannot Create",JOptionPane.INFORMATION_MESSAGE);
}
catch(IOException ioe)
{
JOptionPane.showMessageDialog(null,"Error Occur While
Saving Excel File.",
"Output Error",JOptionPane.ERROR_MESSAGE);
}
}
}
Development of Software Testing and Analysis Tools –Part E
A-19
Appendix 1: Master Student Mark Calculation Program with GUI
A 1.2.4 Vector2D.java
package PackageUtil;
import java.util.*;
data=new Vector();
for (i=0;i<rows;i++)
{
temp = new Vector();
for (j=0;j<cols;j++)
{
temp.add(null);
}
data.add(temp);
}
}
A2.1.1 Analyzor.java
package emframe.codeanalyzor;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.Set;
import java.util.Stack;
import java.util.Iterator;
import java.util.Vector;
import javax.swing.UIManager;
import soot.Body;
import soot.SootClass;
import soot.SootMethod;
import soot.Unit;
import soot.Value;
import soot.jimple.BinopExpr;
import soot.jimple.IfStmt;
import soot.jimple.InvokeStmt;
import soot.jimple.Stmt;
import soot.jimple.internal.AbstractDefinitionStmt;
import soot.tagkit.Tag;
import soot.util.Chain;
import emframe.Global;
import emframe.infeasibleDetector.IPGlobal;
import emframe.infeasibleDetector.dataTypes.AbstractData;
import emframe.infeasibleDetector.dataTypes.Data_Container;
import emframe.infeasibleDetector.dataTypes.Data_Number_NormalType;
import emframe.infeasibleDetector.dataTypes.Data_Number_SystemType;
import emframe.infeasibleDetector.dataTypes.Data_OtherTypes;
import emframe.infeasibleDetector.dataTypes.Data_Path;
import emframe.infeasibleDetector.dataTypes.Data_Simplify;
import emframe.infeasibleDetector.dataTypes.Data_String;
A-23
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
import emframe.infeasibleDetector.dataTypes.ValueTree;
import emframe.pathgen.IntraPath;
import emframe.pathgen.getsrcmethods;
import emframe.pathgen.hashstore;
import emframe.theoremProver.ProverSimplify;
import emframe.theoremProver.ProverZ3;
import emframe.utils.ClassSourceFileFinder;
import escjava.sortedProver.simplify.ProverError;
import escjava.sortedProver.simplify.SimplifyProcess;
/**
* Prover using Simplify in ESC/JAVA2
*
* @author DING SUN please import the following jar files into project: 1.
* javafe2.0.5b.jar 2. bcel-5.2.jar 3. escspecs.jar 4. esctools.jar
*/
A-24
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
int cur_stmt_index = 0;
int curNID = 0;
Set s;
public Stack<String> SubpathName = new Stack<String>();
// static final int pathtype=1; // 1: inter path; 0: intra path
public int count = 0;
public Analyzor() {
A-25
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
try {
javaFile =getsourcfile();
b = Global.sceneDS.methodSig_gBody.get(methodsignature);//
assumed
// b.
// b.getMethod().g
// Java
units = b.getUnits();
if (units.size() != 0) {
/** identify the first position */
u = (Unit) units.getFirst();
tag = u.getTag("LineNumberTag");
A-26
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
first = Integer.parseInt(u.getTag("LineNumberTag")
.toString());// take first line and convert to
// string
// ,
// default
// current
// user
// diectory
// ,user.
// dir
int mindex =
Global.sceneDS.sootMethods.indexOf(sootmethod);// get
// index
// of
// methods//
}
}
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
vector= ps.idvector;
if(vector.contains(intrapathnum)){
javaFile=getsourcfile();
BufferedReader javareader = null;
try {
javareader = new BufferedReader(new FileReader(javaFile));
} catch (FileNotFoundException e) {
System.out.println("ex:\t"+e);
}
int count_line=0;
line=javareader.readLine();
A-27
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
while(line!=null){
count_line++;
if(count_line==first){
write("/myexp/unsolveSRC.txt","Path
ID:\t"+intrapathnum+"\n");
}
if (count_line>= first && count_line<=last){
write("/myexp/unsolveSRC.txt",line);
}else if(count_line>last){
write("/myexp/unsolveSRC.txt","\nEnd of
Path-----------------------------------------------------------\n");
break;
}
line=javareader.readLine();
}
intrapathnum++;
// System.out.println("method.getSignature() is"+method.getSignature()
// );
// hashstore
//************* this.calljavfile(this.sm,pathid);
int result = 0;
Stmt stmt = null;
Data_Container DC = new Data_Container();
cur_path = path;
Refresh();// new Data_path,new stack
// if(check(intrapathnum)==true){
// writepath(path);
// }
System.out.println("--------Begin--path:");
AbstractData.Refresh();// for runtime, function call, interger variable
// such as SID,VID,FID to zero
int ifnum = 0;
int flag_curpath = -1;
//Michelle part
// this.set=hsp.passsetofmap();
//s=hashstore.passsetofmap(intrapathnum);
A-28
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
}
}
if (stmt instanceof InvokeStmt) {
InvokeStmt js = (InvokeStmt) stmt;
boolean regcognizable = DC.Simulate_ContainerFunction(js
.getInvokeExpr().toString(), this);
}
if (stmt instanceof IfStmt) {
ifnum++;
IfStmt ifstmt = (IfStmt) stmt;
GetEcorrealted(ifstmt, ifnum);
boolean branch = false;
Stmt next = (Stmt) path.get(i + 1);
if (!next.toString().equals(target.toString())) {
branch = false;
} else {
branch = true;
}
// System.out.println("We at " + branch + " branch");
if (ifstmt.getCondition() instanceof BinopExpr) {
BinopExpr cond = (BinopExpr) ifstmt.getCondition();
try {
boolean feasible = false;
A-29
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
SimplifyEXPs.add(SimplifyEXP);
// flag_curpath = -1;// -1:undefined
// break;
}
// System.out.println("The original if
is"+ifstmt.toString());
// System.out.println("The simplifyEXP
is"+SimplifyEXP);
// System.out.println("The result is"+feasible);
} catch (Exception e) {
jumptimes++;
flag_curpath = -1;
System.out
.println("We cannot prove this at
this predicate:");
// System.out.println(ifstmt.toString());
break;
}
} else {
// System.out.println("Not BinopExpr:
"+ifstmt.getCondition());
}
}
}
if (ifnum == 0) {
result = 0;
} else {
result = flag_curpath;
}
switch (result) {
case 0:
feasible++;
break;
case 1:
infeasible++;
break;
case -1:
unknown++;
WriteToFile(intrapathnum);
break;
}
/*
* Iterator i = tempIF.entrySet().iterator(); while (i.hasNext()) {
* Object name = i.next(); String pairs = tempIF.get(name).toString();
* System.out.println(name.toString()+": "+pairs); }
*/
if (intrapathnum > 909) {
A-30
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
System.out.println("*******************************************");
System.out.println("currentpathID:" + intrapathnum);
System.out.println("*******************************************");
return result;
}
public void WriteToFile(int pathID) {
// String begin = "(benchmark tst :extrafuns (";
String variables = "";
if (Z3Exps.size() == 0) {
return;
} else {
fh.WriteLine("#begin" + pathID + ":");
for (Iterator iter = Z3Variables.keySet().iterator(); iter
.hasNext();) {
Object key = iter.next();
Object val = Z3Variables.get(key);
variables += "(" + key.toString() + " " + val.toString() + ")";
}
// variables += ")";
fh.WriteLine(variables);
for (int i = 0; i < Z3Exps.size(); i++) {
String exp = Z3Exps.get(i);
fh.WriteLine(" :formula " + exp); // entireEXP +=
}
fh.WriteLine("#end");
}
fh.Flush();
}
/*
* public void WriteToFile(int pathID) { extracount++;
* System.out.println(extracount + ", " + fh.count + " ," + fh.count1 +
* " , " + unknown); String result = "(benchmark tst "; String variables =
* " :extrafuns ("; String entireEXP = ""; if (Z3Exps.size() == 0) {
* jumptimes++; System.out.println("jump out times" + jumptimes); return; }
* else { entireEXP = ""; for (int i = 0; i < Z3Exps.size(); i++) { String
* exp = Z3Exps.get(i); entireEXP += " :formula" + exp; } }
*
* for (Iterator iter = Z3Variables.keySet().iterator(); iter.hasNext();) {
*
* Object key = iter.next();
*
* Object val = Z3Variables.get(key); variables += "(" + key.toString() +
* " " + val.toString() + ")";
*
* } variables += ")"; result += variables + entireEXP + ")"; // char * //
* f1=
* "(benchmark tst :extrafuns ((x Real) (y Real) (z Int) (dasda Real)) :formula (and (=
(- (* x 2) 1) 0.0)) "
* ; fh.WriteLine("#" + pathID + ":");
*
A-31
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
Data_Number_NormalType.UpdateDefinition(defstmt, this);
} else if (left.getType().toString().contains("Integer")
|| left.getType().toString().contains("Double")
|| left.getType().toString().contains("Long")
|| left.getType().toString().contains("Byte")
|| left.getType().toString().contains("Float")
|| left.getType().toString().contains("Short")) {
Data_Number_SystemType.UpdateDefinition(defstmt, this);
} else if (left.getType().toString().contains("Vector")
|| left.getType().toString().contains("HashMap")
|| left.getType().toString().contains("Hashtable")
|| left.getType().toString().contains("ArrayList")
|| left.getType().toString().contains("LinkedList")
|| left.getType().toString().contains("TreeSet")
|| left.getType().toString().contains("Stack")) {
DC.UpdateDefinition(defstmt, this);
} else {
Data_OtherTypes.UpdateDefinition(defstmt, this);
}
}
A-32
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
if (// IPGlobal.influenceDDA.doesInfluenceesContainFuncCall(defstmt,
// cur_path.getSm())
IPGlobal.influenceDDA.doesInfluenceesContainFieldRefs(defstmt, cur_path
.getSm())
|| IPGlobal.influenceDDA.doesInfluenceesContainParameters(
defstmt, cur_path.getSm())) {
flag = false;
}
return flag;
}
public void updateStatitics(String functionname) {
if (ContainerFunction.containsKey(name)) {
Integer num = Integer.valueOf(ContainerFunction.get(name));
num++;
ContainerFunction.put(name, num);
// System.out.println(name.toString() + " , " + num);
} else {
ContainerFunction.put(name, new Integer(1));
}
}
A-33
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
try {
// for(int k=ft;k<=lt;k++){
e.printStackTrace();
}catch(IOException e){
System.out.println("IO Exception is: "+e);
}catch(Exception e){
System.out.println("Exception is:"+e);
}
}
} else {
ValueStr = "N" + ad.NID;
ad.NID++;
Alias.put(vt.currentNode + "", ValueStr);
}
}
} else {
String leftStr = ShowValue_Simplify(vt.leftSub, ad);
String rightStr = ShowValue_Simplify(vt.rightSub, ad);
if (Alias.containsKey(reverse + "")) {
aliasname = Alias.get(reverse + "");
} else {
aliasname = "N" + ad.NID;
A-34
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
ad.NID++;
Alias.put(reverse + "", aliasname);
}
} catch (Exception e) {
if (Alias.containsKey("1/" + rightStr)) {
aliasname = Alias.get("1/" + rightStr);
} else {
aliasname = "S" + ad.SID;
ad.SID++;
Alias.put("1/" + rightStr, aliasname);
}
}
vt.op = "*";
rightStr = aliasname;
}
if (vt.op.equals("==")) {
ValueStr += "(EQ " + leftStr + " " + rightStr + ")";
} else if (vt.op.equals("!=")) {
ValueStr += "(NOT (EQ " + leftStr + " " + rightStr + "))";
} else {
ValueStr += "(" + vt.op + " " + leftStr + " " + rightStr + ")";
}
}
return ValueStr;
}
} else {
String leftStr = ShowValue_Z3(vt.leftSub, ad);
A-35
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
/**
*
* @return -1: undefined ; 0:feasible; 1:infeasible;
*/
public int ProvePath() {
int proveresult = -1;
boolean result = true;
boolean unknown = false;
String entireEXP = "";
if (SimplifyEXPs.size() == 0) {
return 0;
} else {
for (int i = 0; i < SimplifyEXPs.size(); i++) {
String exp = SimplifyEXPs.get(i);
if (exp.equals("unknown")) {
// result = -1;
unknown = true;
continue;
}
if (i == 0) {
entireEXP = exp;
} else {
entireEXP = "(AND " + exp + " " + entireEXP + ")";
}
}
boolean a = true;
if (entireEXP.trim().equals("")) {
a = false;
} else {
a = Simplify.Prove(entireEXP);
if (a == false) {
a = Simplify.Prove("(NOT " + entireEXP + ")");
if (a == false) {
unknown = true;
} else {
result = false;
}
} else {
A-36
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
result = true;
}
}
if (result == false) {
proveresult = 1;
} else {
if (unknown == true) {
proveresult = -1;
} else {
proveresult = 0;
}
}
return proveresult;
}
/**
* @param Exp
* =//(NOT (AND (> a 4) (< a 0)))
* @return boolean, true--> infeasible; false-->feasible
*/
/*
* TRUE : (1) (X + Y > 0) and (X ?Y < 0)
*
* (2) (2X + Y > 4) and (2X <= 1 –Y)
*
* (3) (2X ?Y = 4) and (3X ?Y = 5)
*
* (4) (2XX ?X + 1 = 0)
*/
public static void main(String[] args) {
Analyzor t = new Analyzor();
char a = 'a';
System.out.println(Integer.valueOf(a));
System.out.println(t.Simplify.Prove("(EQ prop null)"));
// t.Prove("(NOT (AND (< (+ (+ x z) f(y)) 2) (> (+ (+ x z) f(y)) 5)))");
// t.Prove("(NOT (AND (< x 3) (> x 2)))");
// t.Prove("(NOT (AND (< (+ (* a f(x))(* b f(y))) c) (> (+ (* a f(x))(* b f(y))) c)))");
// t.Prove("(NOT (AND ( > (+ (* 2 x) y) 4) (<= (* 2 x) (- 1 y))))");
// t.Prove("(NOT (AND ( EQ (- (* 2 x) y) 4) (EQ (- (* 3 x) y) 5)))");
// t.Prove("(NOT (NOT (NOT (EQ (+ (- (* (* 2 x) x) x) 1) 0))))");
// t.Prove("(NOT (NOT (EQ (- (* 2 x) 1) 0)))");
// t.Prove(" (NOT (EQ (* (* 2 x) x) -10))");
// t.Prove(" (NOT (EQ (- x 1) 0))");
// t.Prove("(NOT (NOT (EQ (/ x y) (/ (+ 2 x) y))))");
// t.Prove("(NOT (NOT (EQ (! x) 0)))");
// t.Prove("(NOT (NOT (EQ (- x 1) 0)))");
// t.SendCommand();
int b = -10;
A-37
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
System.out.println(Math.sqrt(b));
String a5 = "55";
int i = 2 ^ 2;
System.out.println(i);
}
// (+ (- (* (* 2 x) x) x) 1)
}
/**
* 1. Send command to simplify , how to use it ? 2. def: type var= EXP 3.
* predicate : EXP1 logicOP EXP2 4. EXP ::= var ::= constant ::= var ((op var)
* |(op constant) | (op fun()) ) 5. a hashmap : <var, value>
*
*/
A2.2.1 Printstmt.java
package emframe.codeanalyzor;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Vector;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.filechooser.FileNameExtensionFilter;
import soot.jimple.Stmt;
import emframe.pathgen.IntraPath;
A-38
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
}
rw.writefile("/myexp/statements.txt",
"\n-----------------------------------------------------------------------");
}
}
A2.2.2 RWmethod.java
package emframe.codeanalyzor;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter;
public class RWmethods {
long unsolve;
public void writefile(String stmtFileName, String line)throws IOException{
BufferedWriter out;
try {
out = new BufferedWriter(new FileWriter(stmtFileName,true));
out.write(line+"\n");
out.flush();//it will be flused with all in value
} catch (FileNotFoundException e) {//if
no file created by user for writing stmt, the system will create automatically
A-39
Appendix 2: Attaining of Java Source & Intermediate Representation (IR)
A-40
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
#end
#end
#end
A-41
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
#end
The result of manual analysis falls under the group of the pattern 1 and refer to the example
under manual analysis 1 to get the idea of how the conclusion for the result of manual
analysis is done.
#end
The result of manual analysis falls under the group of Pattern 1 as in explained above.
Please refer the pattern 1 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
#end
The result of manual analysis falls under the group of Pattern 1 as in explanation above.
Please refer the pattern 1 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
A-42
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
The result of manual analysis falls under the group of Pattern 1 as in explanation above.
Please refer the pattern 1 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
#end
The result of manual analysis falls under the group of Pattern 1 as in explanation above.
Please refer the pattern 1 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
#end
The result of manual analysis falls under the group of Pattern 1 as in explanation above.
Please refer the pattern 1 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
2(EQ F1 0)
#end
The result of manual analysis falls under the group of Pattern 2 as in explanation above.
Please refer the pattern 2 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
A-43
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
The result of manual analysis falls under the group of Pattern 2 as in explanation above.
Please refer the pattern 2 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
2(EQ F1 0)
#end
The result of manual analysis falls under the group of Pattern 2 as in explanation above.
Please refer the pattern 2 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
#end
The result of manual analysis falls under the group of Pattern 2 as in explanation above.
Please refer the pattern 2 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
2(EQ F1 0)
#end
The result of manual analysis falls under the group of Pattern 2 as in explanation above.
Please refer the pattern 2 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
A-44
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
The result of manual analysis falls under the group of Pattern 2 as in explanation above.
Please refer the pattern 2 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
#end
The result of manual analysis falls under the group of Pattern 3 as in explanation above.
Please refer the pattern 3 example under manual analysis 1 to get the idea of how the
conclusion for the result of manual analysis is done.
1(EQ N1 0)
2(EQ N3 0)
6(> 0 width)
A-45
Appendix 3: Manual Analysis Results of the paths in the tested Program
12(EQ neg 0)
#end
Infeasible like above mentioned Pattern 1 infeasibility explanation under manual analysis 2.
Please refer the pattern 1 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
1(EQ N1 0)
2(EQ N3 0)
6(> 0 width)
12(<= x N14)
#end
Infeasible like above mentioned Pattern 1 infeasibility explanation under manual analysis 2.
Please refer the pattern 1 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
1(EQ N1 0)
2(EQ N3 0)
A-46
Appendix 3: Manual Analysis Results of the paths in the tested Program
6(> 0 width)
7(>= x N8)
#end
Ineasible like above mentioned Pattern 1 nfeasibility explanation under manual analysis 2.
Please refer the pattern 1 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
3(<= notCt 0)
#end
Feasible like above mentioned Pattern 2 feasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
4(EQ tok 4)
A-47
Appendix 3: Manual Analysis Results of the paths in the tested Program
5(EQ F0 0)
7(EQ (& V3 8) 0)
#end
Feasible like above mentioned Pattern 2 feasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
4(EQ tok 4)
5(EQ F0 0)
7(EQ (& V3 8) 0)
#end
A-48
Appendix 3: Manual Analysis Results of the paths in the tested Program
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to know how the conclusion for
the result is achieved.
4(EQ tok 4)
5(EQ F0 0)
7(EQ (& V3 8) 0)
10(EQ F3 0)
#end
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to know of how the conclusion
for the result is achieved.
A-49
Appendix 3: Manual Analysis Results of the paths in the tested Program
4(EQ tok 4)
5(EQ F0 0)
7(EQ (& V3 8) 0)
8(EQ F2 0)
#end
Feasible like above mentioned Pattern 2 feasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
3(EQ F1 0)
11(EQ F3 0)
#end
A-50
Appendix 3: Manual Analysis Results of the paths in the tested Program
Feasible like above mentioned Pattern 2 feasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
3(EQ F1 0)
#end
Feasible like above mentioned Pattern 2 feasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
3(EQ F1 0)
A-51
Appendix 3: Manual Analysis Results of the paths in the tested Program
12(EQ N1 0)
#end
Feasible like above mentioned Pattern 2 feasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to get the idea of how the
conclusion for the result is achieved.
#end
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
A-52
Appendix 3: Manual Analysis Results of the paths in the tested Program
9(> i 0)
#end
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to know how the conclusion for
the result is achieved.
9(> i 0)
A-53
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to know how the conclusion for
the result is achieved.
#end
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to know how the conclusion for
the result is achieved.
A-54
Appendix 3: Manual Analysis Results of the paths in the tested Program
9(< V2 F0)
#end
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to know how the conclusion for
the result is achieved.
7(EQ N3 0)
A-55
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 2 infeasibility explanation under manual analysis 2.
Please refer the pattern 2 example under manual analysis 2 to know how the conclusion for
the result is achieved.
A-56
Appendix 3: Manual Analysis Results of the paths in the tested Program
22(<= y ymax)
23(NOT (>= (+ (* (* (- 2 (+ (* gap top) gap)) (- 2 (+ (* gap top) gap))) S53) (- (- 2 (+ (* gap
top) gap)) (- 2 (+ (* gap top) gap)))) limit))
#end
Infeasible like above mentioned Pattern 3 infeasibility explanation under manual analysis 2.
Please refer the pattern 3 example under manual analysis 2 to know how the conclusion for
the result is achieved.
1(EQ N1 0)
3(<= N5 F0)
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result is achieved.
1(EQ N1 0)
2(> N3 F0)
A-57
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result is achieved.
1(EQ N1 0)
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result is achieved.
1(EQ N1 0)
3(<= N5 F0)
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result is achieved.
1(EQ N1 0)
2(> N3 F0)
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result is achieved.
A-58
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result is achieved.
2(EQ N1 0)
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result is achieved.
1(EQ c null)
#end
Feasible like above mentioned Pattern 4 feasibility explanation under manual analysis 2.
Please refer the pattern 4 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-59
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 5 infeasibility explanation under manual analysis 2.
Please refer the pattern 5 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-60
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 5 infeasibility explanation under manual analysis 2.
Please refer the pattern 5 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-61
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 5 infeasibility explanation under manual analysis 2.
Please refer the pattern 5 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-62
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 5 infeasibility explanation under manual analysis 2.
A-63
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 5 infeasibility explanation under manual analysis 2.
#end
A-64
Appendix 3: Manual Analysis Results of the paths in the tested Program
Infeasible like above mentioned Pattern 5 infeasibility explanation under manual analysis 2.
8(<= V4 N8)
#end
Infeasible like above mentioned Pattern 5 infeasibility explanation under manual analysis 2.
Please refer the pattern 5 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-65
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
A-66
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-67
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
#end
Feasible like above mentioned Pattern 6 feasibility explanation under manual analysis 2.
Please refer the pattern 6 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-68
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-69
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
#end
Feasible like above mentioned Pattern 6 feasibility explanation under manual analysis 2.
Please refer the pattern 6 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-70
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-71
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-72
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-73
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
#end
Feasible like above mentioned Pattern 6 feasibility explanation under manual analysis 2.
Please refer the pattern 6 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-74
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-75
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
#end
Feasible like above mentioned Pattern 6 feasibility explanation under manual analysis 2.
Please refer the pattern 6 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-76
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-77
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-78
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-79
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
#end
Feasible like above mentioned Pattern 6 feasibility explanation under manual analysis 2.
Please refer the pattern 6 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-80
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
A-81
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Infeasible like above mentioned Pattern 6 infeasibility explanation under manual analysis 2.
Please refer the pattern 6 infeasibility example under manual analysis 2 to know how the
conclusion for the result is achieved.
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
2(EQ N1 0)
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-82
Appendix 3: Manual Analysis Results of the paths in the tested Program
1(EQ c null)
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
2(EQ N1 0)
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
1(EQ c null)
A-83
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
7(EQ F0 0)
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-84
Appendix 3: Manual Analysis Results of the paths in the tested Program
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
10(EQ N3 0)
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-85
Appendix 3: Manual Analysis Results of the paths in the tested Program
9(EQ V2 0)
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
7(EQ F0 0)
#end
Feasible like above mentioned Pattern 7 feasibility explanation under manual analysis 2.
Please refer the pattern 7 feasibility example under manual analysis 2 to get the idea of how
the conclusion for the result of manual analysis is done.
A-86
Appendix 3: Manual Analysis Results of the paths in the tested Program
4: start = 0
5: goto [?= (branch)]
6: if index < image.<java.lang.String: int length()>() goto (branch)
7: tableswitch(image.<java.lang.String: char charAt(int)>(index)) { case 10: goto
lines.<java.util.LinkedList: boolean add(java.lang.Object)>(image.<java.lang.String:
java.lang.String substring(int,int)>(start, index));
case 11: goto index = index + 1;
case 12: goto index = index + 1;
case 13: goto lines.<java.util.LinkedList: boolean
add(java.lang.Object)>(image.<java.lang.String: java.lang.String substring(int,int)>(start,
index));
default: goto index = index + 1; }
8: index = index + 1
9: if index < image.<java.lang.String: int length()>() goto (branch)
10: if start < index goto lines.<java.util.LinkedList: boolean
add(java.lang.Object)>(image.<java.lang.String: java.lang.String substring(int,int)>(start,
index))
11: if start <= 0 goto return (java.lang.String[]) lines.<java.util.LinkedList: java.lang.Object[]
toArray(java.lang.Object[])>(newarray (java.lang.String)[lines.<java.util.LinkedList: int
size()>()])
12: lines.<java.util.LinkedList: boolean add(java.lang.Object)>(image.<java.lang.String:
java.lang.String substring(int,int)>(start, index))
13: return (java.lang.String[]) lines.<java.util.LinkedList: java.lang.Object[]
toArray(java.lang.Object[])>(newarray (java.lang.String)[lines.<java.util.LinkedList: int
size()>()])
A-87
Appendix 3: Manual Analysis Results of the paths in the tested Program
A-88
Appendix 3: Manual Analysis Results of the paths in the tested Program
A-89
Appendix 4: User Guide
“User Guide “
Manual Analysis
A-90
Appendix 4: User Guide
1.0 Introduction
This user manual can be as a guide to run the analysis tool and attain the source or
IR files of the selected path ID by giving input of the IDfile.txt under the specified
folder.
The manual comprises of majorly 4 main sectors, which are as mentioned below;
First of all, his user manual comprised of installation and setting up necessary
software and IDE components: Java, and Eclipse before running the developed
analysis tool, IPathDetector 2.
Secondly, it will guide of how to construct run-configuration before testing the any
source code using the developed tool, IPathdectector2.As a third, the guide
comprises of the steps of how to run the system. Lastly, there involves the steps to
how to attain the java source code of the body of the unsolved paths and
Intermediate Representation (IR) of the unsolved paths.
So, as a conclusion, this manual will direct you to achieve the print out documents of
the unsolved paths’ IR representation statements and also their source codes in
the .txt or .doc file after complete auto run of the project. It also provides a brief
introduction of the user interface of the system. The main purpose of the project is to
develop an analysis tool which will be able to detect infeasible paths in a java
program by using SOOT API in eclipse platform. And also, additionally, to find out
which are the causes of the result of unsolved paths after the analysis completed by
developed analysis tool IPathdetector2.
Following are the basic requirements before running the analysis tool,
IPathDetector2 in any system.
They involve of the model of Desktop or LapTop , Operation System on the pac and
also 3 types of software platform as described as follows.
Soot is free software and is licensed under the GNU lesser General Public License.
Soot can be used as a standalone or as a tool to optimize or inspect class files. Soot
created by Sable research group from McGill University .
The minimum platform requirement to be able to apply Soot is JDK 1.5 and
Eclipse 3.3.
SO, install the following before install Soot2.3.
1. Java Developer Kit 1.6
2. Eclipse IDE
A-92
Appendix 4: User Guide
Correct path variable setting is very important, if the step is omitted the program
won’t be able to run.
For Operating System” Microsoft Vista “click on ‘Start’ > ‘Control Panel’,
double-click ‘System’. In the System window, click on ‘Advanced System
Settings’.
Choose ‘Advanced’ tab, click on ‘Environment Variables’. In the newly
open window, click on ‘Path under System variables’, choose ‘Edit’, then
add the following to the end of the Path string. E.g. [directory
path]\jdk1.6.0_07\the directory path will be URL of where your JDK has
been installed.
Suggest adding as C:\Program_Files\Java\jdk1.6.0_07\bin and format of
the path is as follows and add in the highlight.
Example:
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\
Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program
Files\Common Files\Roxio Shared\DLLShared\;C:\ProgramFiles\Common
Files\Roxio Shared\11.0\DLLShared\;C:\Program Files\Java\jdk1.6.0\bin
Note:
o The Path is a series of directories separated by semi-colon (;), therefore make
sure to add the semi-colon at the end of the current Path value before adding the
[directory path]\ jdk1.6.0_07\bin to the Path.
o There should be only one bin directory for Java JDK in the Path.
A-93
Appendix 4: User Guide
Eclipse Classic 3.5, version of Eclipse includes the Eclipse platform, java
development tools and plug-in development environment. It can be downloaded
from http://www.eclipse.org/downloads/or the direct link is
http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-
3.5-200906111540/eclipse-SDK-3.5-win32.zip or can be found in the CD ([drive
letter]:/Resources/ eclipse-SDK-3.4.2-win32.zip).
Unzip the downloaded compressed file and run eclipse.exe. Upon installation
select a workspace for the project (ex C:/Program_Files/myexperiment)
On successful installation the following welcome screen appears,
A-94
Appendix 4: User Guide
A-95
Appendix 4: User Guide
Finally in the Install window, press next, and then accept the license
agreement and press finish.
A-96
Appendix 4: User Guide
A-97
Appendix 4: User Guide
Import the test file under ([drive letter]:/SampleTestFile/ Test) into the current
workspace and name it as Test.
To test a project a new run configuration should be created for the project.
This can be done by selecting ‘run’ from the ‘menu bar’ and then ‘Run
Configuration’. Then click on ‘java application’ and then the new launch
configuration button found on the upper left corner.
I. In the ‘Main’ tap of the window, Project is the name of the infeasible path
detector project (here IPathDetector2) and Main class is the location of the
main file in the infeasible detector (Here it is emframe.Main).
A-98
Appendix 4: User Guide
-allow-phantom-refs
-p jb use-original-names:true
-p cg all-reachable:true
-p cg verbose:true SOOT
properties
--exclude java.*
--exclude sun.*
--process-dir
A-99
Appendix 4: User Guide
To know which packs are enabled when, I will explain using the two
documents using their setting and defaults.
Soot command-line:
A-100
Appendix 4: User Guide
Argument classes are those classes which are either listed explicitly on the
command line or found in a directory specified with the -process-dir option when you
use Soot's command lines. When you use the Soot's Eclipse plug-in, argument
classes are those which you selected before starting Soot from the Navigator popup
menu or all classes in the current project if you started Soot from the Project menu.
Application classes are classes that Soot analyzes, transforms, and turns into
output files. Library classes are classes which are directly or indirectly, referred
classes by the application classes, but they are not application classes by
themselves. Soot resolves these classes and reads .class or .jimple source files for
them, but it does not perform transformations on library classes or write output files
for them.
Users may define the designation of application and library classes using the
Application Mode Options.
1. General options
2. Input options
3. Output options
4. Processing options
5. Input Attribute options
6. Annotation options
7. Miscellaneous options
1. General options
-v, -verbose
A-101
Appendix 4: User Guide
2. Input Options
-process-dir dir
Add all classes found in dir to the argument classes which is analyzed and
transformed by Soot. This option can be specified more than once, to add
argument classes from multiple directories.
If subdirectories of dir contain .class or .jimple files, Soot assumes that the
subdirectory names correspond to components of the classes' package
names. If dir contains subA/subB/MyClass.class, for instance, then Soot
assumes MyClass is in package subA.subB.
-allow-phantom-refs
Allow Soot to process a class even if it cannot find all classes referenced by
that class. This may cause Soot to produce incorrect results
Exclude the library class of the package named “pkg” from application
classes. Also allows to selectively excluding classes from application classes. If you
specify both include and exclude options, first the classes from all excluded
packages are marked as library classes, then the classes from all included packages
are marked as application classes.
A-102
Appendix 4: User Guide
IV. Lastly, under the ‘Classpath’ tab of the window, two things must be
done as follows
Adding the jars:
Add the jars used by the project by selecting User Entries, then select Add
External JARs. Add the java library jars, which can be found in
\Java\jdk1.6.0_07\jre\lib\ and
A-103
Appendix 4: User Guide
\Java\jdk1.6.0_07\jre\lib\ext\
(These are the jars that will be found in the JRE System Library of the
project being tested. Even the jars in the External Library should be
added.).
Adding the bin:
Importantly, the bin location of the project to be tested should also be
added, this can be done by selecting ‘Advanced’, then ‘Add External
Folders’ and the selecting the bin folder of the IPathDectector2.
Name of the run configuration
A-104
Appendix 4: User Guide
To get txt files which contain the retrieved source code and IR code of the
requested paths of the tested program is as follows:
(eg. C:/myexperiment/idFile.txt)
A-105
Appendix 4: User Guide
Figure 12:idFil
Advantages:
Save the trouble for analyzer to click on manual analysis button each time for
each class.
Save the trouble for analyzer to look for/brute force the saved source code
and IR in the previously saved by IntraResults.txt and InterResults.txt in
index III.
1. Next after loading, the Program Analysis Viewer, with progress bar of the
class in the system will be displayed.
4.1 Analysis can be done by user manually by clicking on the class name
displayed one by one or do the analysis automatically by clicking the
automated button. The result for intra path analysis will be displayed
after the analysis completes.
4.2 But, since our objective is to retrieve the source and IR code of the
selected path id in the idFile.txt, we would just do Automatic analysis
by clicking ‘Automated’ button on the program analysis viewer shown in
Figure13 below.
A-106
Appendix 4: User Guide
A-107
Appendix 4: User Guide
click undefined for all the prompted windows of the unsolvable paths until
finish to the end.
7.0 After all the unsolvable paths are defined as ‘un_defined’; the system will
show the complete analysis message box as shown in Figure 16 below.
8. You may check the specify txt file under speicfi folder to see the source code
and IR code retrieved.
Eg.
C:/myexp/statements.txt for Input IR to Simplify
C:/myexp/unsolveSRC.txt for for source code of JAVA
A-108
Appendix 4: User Guide
A-109