Dynamic Analysis for Locating Product Features in Ada Code

Download Report

Transcript Dynamic Analysis for Locating Product Features in Ada Code

Dynamic Analysis for
Locating Product Features
in Ada Code
Laura J. White and Norman Wilde
Department of Computer Science
University of West Florida
Pensacola, Florida
Pop Quiz
1. Estimate the total number of hours that
you have invested, searching for code
related to product features within large
software systems.
a. 00
b. 102
c. 1030000
d. 1032,000,000,000,000
2. Was it fun?
2
Software
Reconnaissance
facilitates searching for product
features in software systems, and is
especially valuable in understanding
unfamiliar programs.
3
History
Reconnaissance method tried and
refined with SERC support.
Series of case studies conducted.



Trials on our own code.
Experienced C programmers "thinking
aloud".
Software Engineers finding features in
code that they were familiar with.
Telecordia
Software Reconnaissance tools for C
and C++.
4
Trial Results
Software Reconnaissance usually finds
very good starting points for code
exploration.
Attention is focused on a small part of
the code.
Code familiar to Software Engineers:
"I didn't know it was doing that!"
5
Why?
In telephone software, find all code
fragments that are involved with
the "call forwarding" feature.
6
The Method
1. Instrument a copy of the program.
2. Compile instrumented program.
3. Execute instrumented program with
test cases that do and do not exhibit
the feature.
Traces will be produced.
4. Analyze the traces.
7
Locating Marker
Components
Set 1
Components executed in
test cases that do
exhibit the feature.
8
Locating Marker
Components
Set 1
Components executed in
test cases that do
exhibit the feature.
Set 2
Components executed in test
cases that do not exhibit the
feature.
9
Locating Marker
Components
Look here first
Set 1
Components executed in
test cases that do
exhibit the feature.
Set 2
Components executed in test
cases that do not exhibit the
feature.
Set 1 minus Set 2
Code components for
feature
10
Recon2
Software Reconnaissance for C and
C++ code is available for download at
www.cs.uwf.edu/~recon/
Also available at this site:
User's Manual
FAQ
WWW demo
11
Software Reconnaissance
for Ada


Several SERC affiliates expressed an
interest in applying Software
Reconnaissance to Ada code, and
especially to embedded systems.
The development of a Software
Reconnaissance tool for Ada code is
currently underway.
12
New Concerns
Ada code has characteristics which
make dynamic analysis interesting:
1. Impact of traces on embedded
systems
2. Real-time constraints
3. Multi-tasking
13
Primary Circumstances
1. Development Environment
2. Target Environment
3. Remote Monitoring
14
Tracing Decisions
1. What events should be instrumented?
2. What information should be captured
at each event?
3. How is trace monitoring performed?
15
Development
The actual implementation of this tool
has proceeded slowly as this software
is the target used in the graduate
software engineering project course,
that emphasizes process and
maintenance.
16
Current Architecture
trace_array_pkg
Package
Trace Manager
send_traces
copy_traces
Instrumented Ada Program
trace_manager_interface
trace_now
trace_it
tmi_array
traces_array
User’s Main Program
Unit
17
Notations
Instrumentation
If (Recon_T_F( number = 1, “string ”));
Traces
1
41T
Marked Output
>>>>> 100% T
18
Ada Performance Trials
Impact of producing traces on
software features.
Reference point for selecting trace
strategies.
Hand-instrumented several small
publicly available programs.
19
Ada Programs in Trials
Program
ACESSALL.ADB
BTREE.ADB
CHAR_LOO.ADB
FUNCRECR.ADB
GODYNSTR.ADB
INPUT_TE.ADB
LINKLIST.ADB
MULTOUT.ADB
OPEROVER.ADB
RANDOM_T.ADB
Description
Source
Demonstrates access types
[CORO]
Binary tree demonstration
[CORO]
Loop printing characters
[EMBR]
Recursive factorial calculation [CORO]
Dynamic string package
[CORO]
Input of different data types [EMBR]
Linked list of characters
[CORO]
File output
[CORO]
Operator overloading
[CORO]
Test random number generator [EMBR]
20
Basic (%
Block
Events
slowdown)
BOOL
Program
ACCESSALL.ADB
BTREE.ADB
CHAR_LOO.ADB
FUNCRECR.ADB
GODYNSTR.ADB
INPUT_TE.ADB
LINKLIST.ADB
MULTOUT.ADB
OPEROVER.ADB
RANDOM_T.ADB
GLOB
39%
27%
13%
37%
16%
56%
31%
0%
45%
25%
CNT
PKG
38%
31%
23%
41%
22%
56%
34%
17%
40%
28%
GLOB
37%
28%
22%
38%
21%
55%
28%
14%
43%
23%
PKG
37%
32%
20%
42%
21%
56%
34%
9%
42%
27%
SEQ
TIME
PKG
37%
34%
24%
41%
32%
56%
36%
0%
44%
28%
PKG
36%
31%
23%
41%
31%
55%
33%
10%
45%
28%
21
Subprogram Entry and
Return
Events
(% slowdown)
BOOL
Program
ACCESSALL.ADB
BTREE.ADB
CHAR_LOO.ADB
FUNCRECR.ADB
GODYNSTR.ADB
INPUT_TE.ADB
LINKLIST.ADB
MULTOUT.ADB
OPEROVER.ADB
RANDOM_T.ADB
GLOB
39%
26%
11%
33%
14%
55%
27%
0%
44%
25%
CNT
PKG
37%
31%
20%
41%
18%
55%
31%
14%
40%
25%
GLOB
36%
27%
18%
38%
18%
55%
27%
13%
42%
22%
PKG
37%
31%
20%
41%
19%
56%
31%
18%
44%
28%
SEQ
TIME
PKG
36%
35%
21%
42%
25%
57%
31%
15%
44%
26%
PKG
36%
35%
20%
40%
23%
56%
32%
21%
44%
26%
22
Future Work
Our future work will focus on:



Modifying the instrumentor to provide
various types of instrumentation.
Moving the trace_manager_interface to a
package that will be with'd by the user's
main program unit.
Make use of the TraceGraph visualization
tool.
23
TraceGraph
24
TraceGraph Cell
25
Recon3 Toolkit
Instrumentor
--- Available by request
Trace Manager Interface/Trace Array Package
--- Trial version
Trace Manager
--- Platform dependent
TraceGraph
--- Prototype available on the web
26
Acknowledgements
Architecture:
Gus Lorberg
Andre Wacaster
Performance Trials:
Barry Coker
Carlos Trani
Survey of Industrial
Instrumentation Practices: Dean Knudson
27
Contact Information
Laura J. White
University of West Florida
850-474-3017
[email protected]
28