?? overview.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>RECON - OVERVIEW</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (Win95; I) [Netscape]">
<BASE HREF="http://www.cs.uwf.edu/~wilde/recon/">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A HREF="about.html"><IMG SRC="go_prev.gif" BORDER=0 ALT="[About RECON]"></A>
<A HREF="index.html"> <IMG SRC="go_up.gif" BORDER=0 ALT="[Home]"></A>
<A HREF="http://www.cs.uwf.edu/~wilde/publications/index_tech_rpts.html">
<IMG SRC="go_next.gif" BORDER=0 ALT="[Technical Reports]"></A><BR>
<A HREF="site-map.html"> Site Map</A>
<P>
<!-- SCCS File Identification
/*====================================================================*/
/* Page : @(#)overview.html 2.8 - 04/04/00 */
/*====================================================================*/
-->
<H2 ALIGN=CENTER>RECON - OVERVIEW</H2>
<H3 ALIGN=CENTER>A Tool for Software ``Reconnaissance''</H3>
<CENTER>
<!-- <P>@(#)overview.html 2.8 - 04/04/00<BR> -->
Norman Wilde and,<BR>
Students in the Master of Software Engineering<BR>
University of West Florida, Pensacola, Florida, USA<BR>
</P></CENTER>
<BLOCKQUOTE>
<P>Reconnaissance: In military science, the act or process of obtaining
information about an enemy area...<BR>
[Webster's Dictionary] </P>
</BLOCKQUOTE>
<P>Software Engineers frequently need to ask: "Where in this program
is feature X implemented?" RECON implements a simple, yet powerful
method for addressing this question, based on comparing the execution paths
of different test cases. For example, the program in Figure 1 is part of
a reverse Polish notation calculator from a well known text [1]. We could
ask "where is the division operation handled?" Using RECON, a
Software Engineer would perform four steps: </P>
<OL>
<LI>"Instrumentation Process": Tell RECON to make an instrumented
copy of the program</LI>
<LI>"Compile Process": Compile the instrumented copy to an executable</LI>
<LI>"Test Process": Run test cases using this executable, for
example: </LI>
<UL>
<LI>One case involving division (the "/" operator)</LI>
<LI>One case with each of the 3 other operators ("+", "-",
"*")</LI>
</UL>
<LI>"Analysis Process:" Tell RECON to analyze the 4 test cases
(1 with the division feature, 3 without the feature).</LI>
</OL>
<P>RECON tracks execution of each <I>branch</I> of the original program.
Each ``if'' or ``while'' statement has two branches, one for the true side
and one for the false. Each switch has as many branches as there are different
values for the switch index. </P>
<P>RECON counts the number of test cases "with" the feature that
executed the branch and the number of total test cases that executed the
branch. Branches that executed when the feature was demonstrated are probably
involved in implementing that feature.
<P>
You can ask for a ``deterministic'' analysis that only gives branches
for which
<BLOCKQUOTE>
test cases with the feature = total test cases
</BLOCKQUOTE>
or else a "probabilistic" analysis in which RECON calculates
the percentage:
<BLOCKQUOTE>
(test cases with the feature) x 100 / (total test cases)
</BLOCKQUOTE>
and shows you the branches that exceed a user defined threshold percentage
value.
<HR>
<PRE>
main()
{
int type;
double op2;
char s[MAXOP};
while ((toupper(type = getops(s))) !='Q')
>>>>> 47 ("/")
switch (type)
{
case NUMBER: push(atof(s));
break;
case '+': push(pop() + pop());
break;
case '*': push(pop() * pop());
break;
case '-': op2 = pop();
push(pop() - op2);
break;
case '/': op2 = pop();
>>>>> T
if (op2 != 0.0)
push(pop() / op2);
else
printf("error: zero divisor");
break;
case NEWLINE: printf(" %.8g", pop());
break;
default:printf(" %s unknown", s);
break;
}
return 0;
}
</PRE>
<CENTER><P><B>Figure 1<BR>
Reverse Polish Notation Calculator<BR>
With RECON Output </B></P></CENTER>
<HR>
<P>Figure 1 shows a sample of the output of RECON. A listing of the program
is created with branches that the Software Engineer should investigate
marked with ">>>>>" so that they can be easily
found by searching in an editor. </P>
<P>For <I>if</I> and <I>while</I> statements, the predicate value associated
with the feature is shown as ``T'' or ``F'' or possibly both. For <I>switch</I>
statements, the value of the switch expression is given, together with
its ASCII character equivalent, if any. </P>
<P>In this particular case, RECON noticed that only test cases with division
executed the statement </P>
<BLOCKQUOTE>
<P>switch (type)</P>
</BLOCKQUOTE>
<P>with type = 47 so it marked that statement with: </P>
<BLOCKQUOTE>
<P>>>>>> 47 ('/')</P>
</BLOCKQUOTE>
<P>This is the statement where the division operator is detected. </P>
<P>Similarly RECON noticed that only test cases with division gave a true
value at the statement </P>
<BLOCKQUOTE>
<P>if (op2 != 0.0)</P>
</BLOCKQUOTE>
<P>so it marked that statement with: </P>
<BLOCKQUOTE>
<P>>>>>> T</P>
</BLOCKQUOTE>
<P>This statement is inside a code segment that only handles division.
Any such conditional statement will be detected. </P>
<P>
<HR></P>
<H3>Environment</H3>
<P>RECON is written in ANSI Standard C and is distributed in source form.
A version for pre-ANSI compilers and a pre-compiled version for
MS-DOS platforms are also available. It has been used
successfully on Unix and MS-DOS operating systems.
RECON analyzes target systems written in C. It will also analyze most
C++ code but with some limitations. RECON tools for other target
languages are under development.
<H3>Conclusions</H3>
<P>We expect software ``reconnaissance'' and the RECON tool to be useful
in many program understanding situations, but it is a complement, not a
replacement, for other tools. The results depend both on the user's ability
to find good test cases and on the way the original designer may have combined
features in the code. RECON won't necessarily find all the code related
to a particular feature but our experiments show it will usually find good
starting points for a search [2, 3]. </P>
<H3>Acknowledgment</H3>
<P>Our thanks to the students in the Software Engineering Project course
who have helped develop the theory and the operation of the RECON tool.
</P>
<H3>References</H3>
<OL>
<LI>B. Kernighan, D. Ritchie, "The C Programming Language, Second
Edition", Prentice-Hall, 1988.</LI>
<LI>N. Wilde, J. Gomez, T. Gust, D. Strasburg, "Locating User Functionality
in Old Code", Proc. IEEE Conf. on Software Maintenance 1992, Orlando,
November, 1992, pp. 200 - 205.</LI>
<LI>M. Scully, "Augmenting Program Understanding Strategies with Test
Case Based Methods", SERC-TR-68-F, Software Engineering Research Center,
University of Florida, Gainesville, Florida 32611, July 1993.</LI>
</OL>
<A HREF="about.html"><IMG SRC="go_prev.gif" BORDER=0 ALT="[About RECON]"></A>
<A HREF="index.html"> <IMG SRC="go_up.gif" BORDER=0 ALT="[Home]"></A>
<A HREF="http://www.cs.uwf.edu/~wilde/publications/index_tech_rpts.html"> <IMG SRC="go_next.gif" BORDER=0 ALT="[Technical Reports]"></A><BR>
<A HREF="site-map.html"> Site Map</A>
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -