@(#)r3uarch.htm 1.2 - 04/11/00
University of West Florida
The expected audience for this document is the developers of
Recon3.
The main objective of Recon3 is to allow Software Engineers
to analyze existing software more
effectively for reuse, maintenance (evolution) and debugging activities.
A specific application of Recon3 is to allow the user to
perform Software Reconnaissance, a technique for
locating where particular features of an unfamiliar target program
are implemented by comparing traces of execution ([WILD.95A]).
Experience with Recon2 has indicated that the following criteria
are important if Recon3 is to be easily developed and widely used:
1.2 Scope
Recon3 is a collection of tools to facilitate dynamic software analysis
though instrumentation. The different tools provide for (See Figure 1):
The Recon3 GUI is the main tool provided to enhance ease of use, but
all components and documentation need to be carefully designed
to simplify use as much as possible.
1.3 Definitions, Acronyms and Abbreviations
| Architectures: Basic, Extended, Distributed | Different versions of Recon3 described in Section 2.2.1 |
| Instrumentation Statements | Source code statements introduced into a program to produce trace output. When executed, each instrumentation statement triggers a trace event that the user wants to monitor, causing a trace record to be written, |
| Instrumented Target Program | The original target program with instrumentation statements inserted. |
| Software Reconnaissance | A method of locating a feature in an unfamiliar program by comparing a trace from a test that exhibits the feature with a trace from a test that does not. See [WILD.95A]. |
| Target Program | The original program that the user wishes to analyze. |
| Trace Event | The execution of an instrumentation statement. The trace event is usually the execution of a particular code component of the target program. See Section 2.2.2 for a description of the different kinds of trace event. |
| Trace Mode: immediate, subroutine, order, count | The trace mode defines the data content and interpretation of each trace record. See Section 2.2.3 |
| Trace Frame | A period of time during which a sequence of trace events occur. Many methods of analysis, including Software Reconnaissance, require the comparison of events in different trace frames. A trace frame may cover a particular test case, the time a particular target program feature was operating, a period of target program idle time, etc. |
| Trace Record | A data record containing information about a single trace event. See Section 3.3. |
| User | The programmer or software engineer who is using Recon3 to analyze the target program. |
| [WILD.92] | Norman Wilde, Juan A. Gomez, Thomas Gust, Douglas Strasburg, "Locating User Functionality in Old Code", Proc. IEEE Conf. on Software Maintenance - 1992, Orlando, Florida, November 1992, pp. 200 - 205. |
| [WILD.95A] | Norman Wilde and Michael Scully, "Software Reconnaissance: Mapping Program Features to Code", Journal of Software Maintenance: Research and Practice, Vol. 7, No. 1, January-February 1995, pp. 49 - 62. |
| [WILD.96] | Norman Wilde and Christopher Casey, "Early Field Experience with the Software Reconnaissance Technique for Program Comprehension", Proc. IEEE Conf. on Software Maintenance - 1996, Monterey, November 1996, pp. 312 - 318. |
| [WILD.98] | Norman Wilde, Christopher Casey, Joe Vandeville, Gary Trio, Dick Hotz, "Reverse Engineering of Software Threads: A Design Recovery Technique for Large Multi-Process Systems", Journal of Systems and Software, Vol. 43, October 1998, pp. 11 - 17. |
| [WILD.99] | Norman Wilde and Dean Knudson, "Understanding Embedded Software Through Instrumentation: Preliminary Results from a Survey of Techniques", report SERC-TR-85-F, Software Engineering Research Center, Purdue University, 1398 Dept. of Computer Science, West Lafayette, IN 47906, February 1999. |
Terms defined in section 1.3 will appear in emphasis, like this.
Where appropriate, program names, file names, and C/C++ language
constructs will appear in CODE format like
this.
[Brief explanations and/or status notes are given in block quotes like this one.]
Figure 1
Recon 3 Product Overview DFD
The main Recon3 components are instrumentors, trace managers, trace display and analysis tools, and a graphic user interface (GUI).
[A Software Requirements Specification (SRS) document will be prepared for each component (except the GUI) as it is developed. See these individual SRS documents for tool details.]
[Aaron Tarnosky
has prepared a slightly modified version of the r2inst
instrumentor for C for use in a transition period.]
Instrumentors and Trace Managers are language dependent; a different tool is needed for each source language in the user's target program. Table 1 lists the components that are currently planned and gives the tentative tool name.
|
|
|
|
||
|
|
|
|
||
| C/C++ |
r3cinst |
r3ctmi |
r3ctmi, r3ctmc |
r3ctmi, r3ctmc, r3ctms |
| FORTRAN 77 |
|
|
|
|
| Ada |
|
|
|
|
| Java |
|
|
|
|
|
Note 1: It has not yet been decided if FORTRAN trace managers will be developed for the extended and distributed architectures. Note 2: The Pensacola project team will be responsible for determining when and how the Recon3 Ada tools will be developed. Note 3: Norman Wilde is currently researching possible designs for Java Recon3 tools. |
||||
[Initially ther2analyztrace analyzer is available to do Software Reconnaissance analysis. Research is underway on other possible display and analysis tools. Aaron Tarnosky has prepared a rough temporary conversion tool calledr3uancto convert trace records from the Recon3 format to the Recon2 format so thatr2analyzcan be used.]
|
|
|
|
|
| Target Programs |
Handles only a single process/thread running on a single machine. Writes directly and immediately to a file. This architecture may be used directly for simple programs or customized by the user to handle special needs such as embedded systems. |
Handles multiple processes/threads running on a single machine. It is anticipated that this architecture will be the one most widely used. |
Handles multiple processes/threads running on multiple machines. |
Platform Requirements |
Requires only standard compiler(s) (e.g. ANSI standard C compiler for C source language, ANSI standard C and FORTRAN 77 for FORTRAN, etc.) Requires a file system to which the trace records may be written. |
Requires either:
|
Requires either:
|
[See Section 3.3 for the data items in the trace record for each event type]
[Each trace manager interface shall provide support for all trace events. However each Recon3 language-specific instrumentor automatically instruments only a subset of the events. The others must be instrumented manually by the programmer if they are to be monitored. The event types supported for each language will be defined in the SRS for its instrumentor.]
[This mode has been found useful to allow a software engineer to monitor the call stack as the program executes.]
[It is anticipated that a brief design document will also be prepared for each Recon3 component as it is developed.]
[Recon3 developers should keep the command line interfaces as similar as possible to facilitate ease of use. Pay particular attention to the ordering and meaning of parameters, use of upper or lower case, assumptions about file path names, etc.]
[Note that certain fields containing a variable length string are preceeded by an integer field with the string's length. This design was adopted to facilitate processing of strings with embedded blanks, such as file names on some operating systems.]
| Field | Type | Description |
| ID | character | This field indicates the type of trace event.
# - Comment |
| message | string | This field contains the comment text. |
| Field | Type | Description |
| ID | character | This field indicates the type of trace event.
B - Block T - Decision (True) F - Decision (False) S - Decision (Switch) E - Subroutine (Entry) R - Subroutine (Return) A - Task (Start) V - Task (Rendezvous) O - Task (Stop) U - User X - Exit |
| count | integer | When count mode is set, this field contains the number of times an event occurred during a trace frame. Otherwise, this field contains a value of one. |
| time | integer | Optional trace data item, see 2.2.4. The format is: HHMMSSmmm where HH is the hour, MM is the minute, SS is the second and mmm is thousandths of a second. Precision is operating system dependent. |
| process id | integer | Optional trace data item, see 2.2.4. |
| thread id | integer | Optional trace data item, see 2.2.4. |
| line | integer | This field contains the source file line number at which the trace event occurred. |
| value | integer | This field contains additional information that describes a trace
event.
Block - Ending line number. Decision (Switch) - Value of the switch control expression. Subroutine - Zero (field is ignored). Task - Zero (field is ignored). User - Zero (field is ignored). Exit - Value of exit code. |
| host name length | integer | This field indicates the number of characters in the host name field that follows. |
| host name | string | The trace manager interface initializes this field with an asterisk. The trace manager server initializes this field with the name of the machine on which the trace event occurred. |
| file name length | integer | This field indicates the number of characters in the file name field that follows. |
| file name | string | This field contains the name of the source file in which the trace event occurred. |
| message length | integer | This field indicates the number of characters in the message field that follows. |
| message | string | This field contains additional information that describes a trace
event.
Block - Asterisk (field is ignored). Decision - Asterisk (field is ignored). Subroutine - Name of the subroutine. Task - User specified text (must be at least one printable character). User - User specified text (must be at least one printable character). Exit - Asterisk (field is ignored). |
The record contains three fields as shown in Table 5.
| Field | Type | Description |
| ID | character | This field indicates the type of trace event.
> - Overflow |
| total | integer | The total number of records stored during the trace frame. |
| lost | integer | The number of records that were lost due to memory allocation failures. |
| Field | Type | Description |
| ID | character | This field indicates the type of trace event.
E - Subroutine Entry R - Subroutine Return |
| function name | string | Name of the subroutine. |
| line | integer | This field contains the source file line number at which the trace event occurred. |
| file name | string | This field contains the name of the source file in which the trace event occurred. |
[The web site design, the different "packages", and the user documentation to be distributed are all TBD.]
r3LCxxxx.yyyr3uarch.htm. Its
figures are stored in a Rich Text Format file r3uarchf.rtf
and generated from that file
as GIF's with names like r3uarch1.gif.
An exception to the naming convention is the file r3.h
which contains constants and other information used system-wide.