28
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

Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

Embed Size (px)

Citation preview

Page 1: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 2: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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?

Page 3: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

3

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

Page 4: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 5: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 6: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

6

Why?

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

Page 7: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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.

Page 8: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

8

Locating Marker Components

Components executed in test cases that do

exhibit the feature.

Set 1

Page 9: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 10: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 11: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 12: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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.

Page 13: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 14: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

14

Primary Circumstances

1. Development Environment

2. Target Environment

3. Remote Monitoring

Page 15: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

15

Tracing Decisions

1. What events should be instrumented?

2. What information should be captured at each event?

3. How is trace monitoring performed?

Page 16: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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.

Page 17: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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

Page 18: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

18

Notations

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

Traces1 41T

Marked Output>>>>> 100% T

Page 19: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

19

Ada Performance Trials

Impact of producing traces on software features.

Reference point for selecting trace strategies.

Hand-instrumented several small publicly available programs.

Page 20: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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]

Page 21: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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%

Page 22: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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%

Page 23: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

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.

Page 24: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

24

TraceGraph

Page 25: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

25

TraceGraph Cell

Page 26: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

26

Recon3 ToolkitInstrumentor

--- Available by request

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

Trace Manager--- Platform dependent

TraceGraph--- Prototype available on the web

Page 27: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

27

Acknowledgements

Architecture: Gus Lorberg Andre

Wacaster

Performance Trials: Barry CokerCarlos Trani

Survey of Industrial

Instrumentation Practices: Dean Knudson

Page 28: Dynamic Analysis for Locating Product Features in Ada Code Laura J. White and Norman Wilde Department of Computer Science University of West Florida Pensacola,

28

Contact Information

Laura J. WhiteUniversity of West Florida

[email protected]