Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde...

Post on 29-Mar-2015

214 views 1 download

Tags:

Transcript of Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde...

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

2

Pop Quiz1. 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?

3

Software Reconnaissancefacilitates searching for product features in software systems, and is especially valuable in understanding unfamiliar programs.

4

HistoryReconnaissance 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.

TelecordiaSoftware Reconnaissance tools for C and C++.

5

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!"

6

Why?

In telephone software, find all code fragments that are involved with the "call forwarding" feature.

7

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.

8

Locating Marker Components

Components executed in test cases that do

exhibit the feature.

Set 1

9

Locating Marker Components

Components executed in test cases that do

exhibit the feature.

Components executed in test cases that do not exhibit the

feature.

Set 2Set 1

10

Locating Marker Components

Look here first

Components executed in test cases that do

exhibit the feature.

Components executed in test cases that do not exhibit the

feature.

Code components for feature

Set 2Set 1 Set 1 minus Set 2

11

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 ManualFAQ

WWW demo

12

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.

13

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

14

Primary Circumstances

1. Development Environment

2. Target Environment

3. Remote Monitoring

15

Tracing Decisions

1. What events should be instrumented?

2. What information should be captured at each event?

3. How is trace monitoring performed?

16

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.

17

Current Architecture

trace_now

Instrumented Ada Program

Trace Manager trace_manager_interface

trace_array_pkgPackage

trace_it

send_traces

copy_traces

tmi_array

traces_arrayUser’s Main ProgramUnit

18

Notations

InstrumentationIf (Recon_T_F( number = 1, “string ”));

Traces1 41T

Marked Output>>>>> 100% T

19

Ada Performance Trials

Impact of producing traces on software features.

Reference point for selecting trace strategies.

Hand-instrumented several small publicly available programs.

20

Ada Programs in TrialsProgram Description SourceACESSALL.ADB Demonstrates access types [CORO]BTREE.ADB Binary tree demonstration [CORO]CHAR_LOO.ADB Loop printing characters [EMBR]FUNCRECR.ADB Recursive factorial calculation [CORO]GODYNSTR.ADB Dynamic string package [CORO]INPUT_TE.ADB Input of different data types [EMBR]LINKLIST.ADB Linked list of characters [CORO]MULTOUT.ADB File output [CORO]OPEROVER.ADB Operator overloading [CORO]RANDOM_T.ADB Test random number generator [EMBR]

21

Basic Block Events(% slowdown)

BOOL CNT SEQ TIME

Program GLOB PKG GLOB PKG PKG PKGACCESSALL.ADB 39% 38% 37% 37% 37% 36%BTREE.ADB 27% 31% 28% 32% 34% 31%

CHAR_LOO.ADB 13% 23% 22% 20% 24% 23%FUNCRECR.ADB 37% 41% 38% 42% 41% 41%GODYNSTR.ADB 16% 22% 21% 21% 32% 31%INPUT_TE.ADB 56% 56% 55% 56% 56% 55%LINKLIST.ADB 31% 34% 28% 34% 36% 33%MULTOUT.ADB 0% 17% 14% 9% 0% 10%OPEROVER.ADB 45% 40% 43% 42% 44% 45%RANDOM_T.ADB 25% 28% 23% 27% 28% 28%

22

Subprogram Entry and Return Events

(% slowdown)

BOOL CNT SEQ TIME

Program GLOB PKG GLOB PKG PKG PKGACCESSALL.ADB 39% 37% 36% 37% 36% 36%BTREE.ADB 26% 31% 27% 31% 35% 35%

CHAR_LOO.ADB 11% 20% 18% 20% 21% 20%FUNCRECR.ADB 33% 41% 38% 41% 42% 40%GODYNSTR.ADB 14% 18% 18% 19% 25% 23%INPUT_TE.ADB 55% 55% 55% 56% 57% 56%LINKLIST.ADB 27% 31% 27% 31% 31% 32%MULTOUT.ADB 0% 14% 13% 18% 15% 21%OPEROVER.ADB 44% 40% 42% 44% 44% 44%RANDOM_T.ADB 25% 25% 22% 28% 26% 26%

23

Future WorkOur 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.

24

TraceGraph

25

TraceGraph Cell

26

Recon3 ToolkitInstrumentor

--- Available by request

Trace Manager Interface/Trace Array Package--- Trial version

Trace Manager--- Platform dependent

TraceGraph--- Prototype available on the web

27

Acknowledgements

Architecture: Gus Lorberg Andre

Wacaster

Performance Trials: Barry CokerCarlos Trani

Survey of Industrial

Instrumentation Practices: Dean Knudson

28

Contact Information

Laura J. WhiteUniversity of West Florida

850-474-3017lwhite@uwf.edu