1 Software maintenance: Relative Cost 90% 80% 70% 60% 50% 40% - - PDF document

1
SMART_READER_LITE
LIVE PREVIEW

1 Software maintenance: Relative Cost 90% 80% 70% 60% 50% 40% - - PDF document

An Environment for Comprehending the Behavior of Software Systems Maher Salah Department of Computer Science Drexel University July 25, 2005 Overview Problem: Software maintenance Modern software systems Large, distributed,


slide-1
SLIDE 1

1

An Environment for Comprehending the Behavior of Software Systems Maher Salah

Department of Computer Science Drexel University July 25, 2005

July 25, 2005 Maher Salah 2

Overview

  • Problem: Software maintenance
  • Modern software systems

– Large, distributed, multi-language and developed using pre-built components – Difficult and expensive, especially if the source code is not available

Þ Effective SC tools can greatly simplify and reduce maintenance effort

  • Solution: Software Comprehension Environment
  • Profiling and analysis of distributed systems
  • Analysis of program features
  • Common data repository
  • Software views
  • Evaluation: Case study
  • Mozilla: Web browser
  • Jext: Programmers’ Text Editor
  • TechReport: Publication database

July 25, 2005 Maher Salah 3

Outline

  • Motivation
  • Software Comprehension
  • Architecture of Software Comprehension

Environment

  • Software views / Case Study
  • Related Work
  • Conclusions
slide-2
SLIDE 2

2

July 25, 2005 Maher Salah 4

Software maintenance: Relative Cost

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 1970s Early 1980s Late 1980s Early 1990s New Development Software maintenance

[Maod-1990] July 25, 2005 Maher Salah 5

Software maintenance: Cost Distribution

20% 25% 55%

Corrective maintenance Adaptive maintenance Perfective maintenance

⇒ Approximately 80% of the maintenance effort is spent on non-corrective tasks

[Swanson-1990] July 25, 2005 Maher Salah 6

Software maintenance: Cost Reduction

Rigorous design and thorough testing

– Corrective maintenance

Limiting non-corrective changes

– Enhancements – Adapting to hardware/software infrastructure changes – Not an option: System evolution depends on these changes to meet its user’s needs.

slide-3
SLIDE 3

3

July 25, 2005 Maher Salah 7

Software maintenance: Cost Reduction

Reducing amount of effort spent on maintenance ½ the maintenance effort is spent on understanding the system’s logic and behavior. [Pigoski-1994]

Þ Effective software comprehension tools

July 25, 2005 Maher Salah 8

Outline

  • Motivation
  • Software Comprehension
  • Architecture of Software Comprehension

Environment

  • Software views / Case Study
  • Related Work
  • Conclusions

July 25, 2005 Maher Salah 9

Software Comprehension

Program Entities Program Relationships Program Source code Extractor Profiler Source code Com piled binaries Fi lterin g & q uery tool s Analyzers Software views Program Gather data Store data into repository Filter and analyze data Software views

slide-4
SLIDE 4

4

July 25, 2005 Maher Salah 10

Outline

Software Comprehension

  • Architecture of Software

Comprehension Environment

  • Software Views / Case Study
  • Related Work
  • Conclusions

July 25, 2005 Maher Salah 11

Architecture of the Software Comprehension Environment

Languages models & Program schema S Q L ( J D B C ) S M Q L

Analysis/Visualization Subsystem Repository Subsystem

Trace Marker (Features) Feature-im plem entation view Feature interaction view Feature-sim ilarity view M

  • dule-interaction view

Class-interaction view Rem

  • te-interaction view

M o d e l i n g ( A n a l y z e r s ) V i s u a l i z a t i o n ( P r e s e n t a t i o n / N a v i g a t i Software Programs Static analyzers Dynamic analyzers ( P r o f i l e r s ) S o u r c e c o d e E x e c u t i o n T r a c e s

Data Gathering Subsystem July 25, 2005 Maher Salah 12

Data Gathering Subsystem

Languages models & Program schema S Q L (JDBC) S M Q L

Analysis/Visualization Subsystem Repository Subsystem

Trace Marker (Features) Feature-im plem entation view Feature interaction view Feature-sim ilarity view M

  • dule-interaction view

Class-interaction view Rem

  • te-interaction view

M o d e l i n g ( A n a l y z e r s ) V i s u a l i z a t i o n ( P r e s e n t a t i o n / N a v i g a t i Software Programs Static analyzers Dynamic analyzers ( P r o f i l e r s ) S o u r c e c o d e E x e c u t i o n T r a c e s

Data Gathering Subsystem

slide-5
SLIDE 5

5

July 25, 2005 Maher Salah 13

Data Gathering Subsystem

  • Program Facts/Data

– Static: Entities and Relations – Dynamic: Entities, Relations and Events

  • Distributed Profiler

– Local Profiler – Logical Time Server

  • Remote Interactions

– Network interceptor Endpoint

July 25, 2005 Maher Salah 14

Data Gathering

  • Endpoint entity

– Local and Remote host – Local and Remote port numbers – Time-stamp

  • Connects Relation

Local Host Remote Host Local Port Remote Port Time Local Host Remote Host Local Port Remote Port Time+Delta Delta < Threshold

Endpoint-A Endpoint-B July 25, 2005 Maher Salah 15

Example: Sequence Diagram

UserClass java.net Sokect- OutputStream write() Java.net. Sokect- InputStream read() Java Program Logical Time C/C++ Win32 Program UserModule (Winsock) Ws2_32.DLL recv() send() EP(B)

EPT

im e(B)

EP(A)

EPT

im e(A)

slide-6
SLIDE 6

6

July 25, 2005 Maher Salah 16

TechReport: Remote-interaction view

Search-by-author feature

July 25, 2005 Maher Salah 17

Distributed Profiler

Program

  • B

JDBC Compliant D a t a b a s e (SQL Server) S Q L (JDBC) S M Q L Analysis/Visualization Subsystem Repository Subsystem Trace Marker A n a l y z e r s V i s u a l i z a t i o n ( P r e s e n t a t i o n ) Profiling Win32 Program (Using Wdbg) Profiling Java Program (Using JvProf) LogicalTimeServer Runtime events (XML Format) Runtime events (XML Format) Import (dbimport) Logical-Time Distributed Marked-Trace Logical-Time Distributed Marked-Trace Trace Marker Program

  • A

Data Collection Import (dbimport)

July 25, 2005 Maher Salah 18

Data Repository

Languages models & Program schema S Q L (JDBC) S M Q L

Analysis/Visualization Subsystem Repository Subsystem

Trace Marker (Features) Feature-im plem entation view Feature interaction view Feature-sim ilarity view M

  • dule-interaction view

Class-interaction view Rem

  • te-interaction view

M o d e l i n g ( A n a l y z e r s ) V i s u a l i z a t i o n ( P r e s e n t a t i o n / N a v i g a t i Software Programs Static analyzers Dynamic analyzers ( P r o f i l e r s ) S o u r c e c o d e E x e c u t i o n T r a c e s

Data Gathering Subsystem

slide-7
SLIDE 7

7

July 25, 2005 Maher Salah 19

Data Repository

  • Logical Models

– Language definitions – Program data

  • Implementation

– Relational database

  • Query/Manipulation Language

– Manipulation: SQL – Query/retrieval: SMQL

July 25, 2005 Maher Salah 20

Language Definitions

  • Model(General) = Graph(Eg , Rg)

Eg: Set of entity types Rg: Set of relation types

  • Java, example:
  • Model(Java) = Graph(Ejava , Rjava)

Ejava ⊂ Eg : Entity types supported by Java Rjava ⊂ Rg : Relation types supported by Java Such that the source and destination entity ∈ Ejava

  • C++, defining

Model(C++) = Graph(Ec++, Rc++) Ec++ = Ejava ∪ {template, struct, typedef, function}

  • {interface, package}

July 25, 2005 Maher Salah 21

SMQL: Software Modeling Query Language

  • Set-based:

– Typed Set (SMQL Objects)

  • Entity Set
  • Relation Set
  • Event Set

– Composite set – Generic Set

  • Operations

– Union, intersection, Difference

  • Functions

– SMQL Filters implement in Java – Closure, Composition, …, etc.

slide-8
SLIDE 8

8

July 25, 2005 Maher Salah 22

/** MOZILLA — Dynamic analysis (C/C++) All interactions from/to MIME.DLL module of Mozilla **/ RelationSet JPEGRelations { include (project) = {"mozilla"} ; EntitySet AllEntities { type = {"method", "function"} ; } EntitySet JPEGEntities { type = {"method", "function"} ; include (container) = {"imgjpeg.dll"} ; } include (invoke) = {AllEntities

  • > JPEGEntities,

JPEGEntities -> AllEntities } ; } /** JETTY - Static analysis (Java) Inheritance forest rooted at HttpListener or http.HttpHandler **/ EntitySet InheritanceRoots { type = {"interface", "class"} ; include (name) = { "org.mortbay.http.HttpListener", "org.mortbay.http.HttpHandler" } ; include (project) = { "jetty-static" } ; } InheritanceForest = closure (null, InheritanceRoots, /** KWIC — Dynamic analysis (Java) **/ EventSet KwicEvents { type = { "method-entry", "method-exit", "thread-start", "thread-end" } ; include (project) = {"kwic-rt"} ; } // Convert EventSet to RelationSet (call-graph) KwicCallgraph = Callgraph (KwicEvents) ; // Attach the SequenceDiagram Visualizer to the clone event set KwicEvents[ "sf.visualizer" ] = "serg.sc.sd.ui.SceEventSequVisualizer" ; KwicEvents["description"] = "Kwic Event Sequence Diagram"; /** Mixing Relationships **/ MixedRelations = InheritanceForest + JPEGRelations ;

SMQL: Example

Mozilla – Dynamic (C/C++) Jetty – Static (Java) KWIC – Dynamic (Java) Union of relations from Mozilla and Jetty

July 25, 2005 Maher Salah 23

SMQL Filters

  • SMQL filters = Analyzers

– Java implementation of IFilter interface

  • Implemented filters

– Closure (Source, Target, RelationTypes) – Composition (E1, E2, …) – Callgraph (E1, E2, …) – AnalyzeEvents (E1, E2, …) – FeatureSimilarity (E1, E2, …) – MethodSequences (E1, E2, …) – Clone (EntitySet || RelationSet || EventSet) – Output_Dot ( RelationSet ) – Output_xml( EntitySet || RelationSet || EventSet)

July 25, 2005 Maher Salah 24

Analysis and Visualization

Languages models & Program schema S Q L (JDBC) S M Q L

Analysis/Visualization Subsystem Repository Subsystem

Trace Marker (Features) Feature-im plem entation view Feature interaction view Feature-sim ilarity view M

  • dule-interaction view

Class-interaction view Rem

  • te-interaction view

M o d e l i n g ( A n a l y z e r s ) V i s u a l i z a t i o n ( P r e s e n t a t i o n / N a v i g a t i Software Programs Static analyzers Dynamic analyzers ( P r o f i l e r s ) S o u r c e c o d e E x e c u t i o n T r a c e s

Data Gathering Subsystem

slide-9
SLIDE 9

9

July 25, 2005 Maher Salah 25

Analysis and Visualization

SMQL Analysis (IFilter) Visualization (ISoftView ) Visual Style Navigational Style Software View Model Revised Model Program Data

Setting the “drill-in” property for a node/edge of a relationSet Performed manually – By applying a different Analyzer

  • r modifying the SMQL code

July 25, 2005 Maher Salah 26

Visualization process flow

Type? Default Visualizer Has User- defined Visual- style? User-defined Visualizer Graph Visualization Containment Tree Drill-in on Node and Edges Visualize SMQL Object Realtionship set Entity Set Clustering No Yes Custom Visualization

July 25, 2005 Maher Salah 27

Illustration Example

/** MOZILLA — Dynamic analysis (C/C++) All interactions from/to MIME.DLL module of Mozilla **/ RelationSet JPEGRelations { include (project) = {"mozilla"} ; EntitySet AllEntities { type = {"method", "function"} ; } EntitySet JPEGEntities { type = {"method", "function"} ; include (container) = {"imgjpeg.dll"} ; } include (invoke) = {AllEntities

  • > JPEGEntities,

JPEGEntities -> AllEntities } ; } /** JETTY - Static analysis (Java) Inheritance forest rooted at HttpListener or http.HttpHandler **/ EntitySet InheritanceRoots { type = {"interface", "class"} ; include (name) = { "org.mortbay.http.HttpListener", "org.mortbay.http.HttpHandler" } ; include (project) = { "jetty-static" } ; } InheritanceForest = closure (null, InheritanceRoots, /** KWIC — Dynamic analysis (Java) **/ EventSet KwicEvents { type = { "method-entry", "method-exit", "thread-start", "thread-end" } ; include (project) = {"kwic-rt"} ; } // Convert EventSet to RelationSet (call-graph) KwicCallgraph = Callgraph (KwicEvents) ; // Attach the SequenceDiagram Visualizer to the clone event set KwicEvents[ "sf.visualizer" ] = "serg.sc.sd.ui.SceEventSequVisualizer" ; KwicEvents["description"] = "Kwic Event Sequence Diagram"; /** Mixing Relationships **/ MixedRelations = InheritanceForest + JPEGRelations ;

slide-10
SLIDE 10

10

July 25, 2005 Maher Salah 28

SceTool

SMQL Editor Visualized as Graph Visualized as SequenceDiagram Visualized as Graphs

Views:

  • Inheritance forest
  • Call-graph
  • Class-interaction
  • Module-interaction
  • Event sequence diagram

July 25, 2005 Maher Salah 29

RelationSet: InheritanceForest

Jetty – Java static analysis

July 25, 2005 Maher Salah 30

RelationSet: JPEGRelations

Mozilla – C/C++ dynamic analysis

slide-11
SLIDE 11

11

July 25, 2005 Maher Salah 31

RelationSet: MixedRelations

Relations from Mozilla & Jetty

July 25, 2005 Maher Salah 32

RelationSet: KwicCallgraph (Call-graph)

KWIC – Java dynamic analysis

July 25, 2005 Maher Salah 33

EventSet : KwicEvents (Sequence Diagram)

KWIC – Java dynamic analysis

slide-12
SLIDE 12

12

July 25, 2005 Maher Salah 34

Summary of Architecture

  • Support

– Analysis of distributed – Analysis of program features – Static and dynamic analysis – Multiple languages

  • Extensible architecture

– Analysis

  • IFilter

– Visualization

  • ISoftView

July 25, 2005 Maher Salah 35

Software Views

Languages models & Program schema S Q L (JDBC) S M Q L

Analysis/Visualization Subsystem Repository Subsystem

Trace Marker (Features) Feature-im plem entation view Feature interaction view Feature-sim ilarity view M

  • dule-interaction view

Class-interaction view Rem

  • te-interaction view

M o d e l i n g ( A n a l y z e r s ) V i s u a l i z a t i o n ( P r e s e n t a t i o n / N a v i g a t i Software Programs Static analyzers Dynamic analyzers ( P r o f i l e r s ) S o u r c e c o d e E x e c u t i o n T r a c e s

Data Gathering Subsystem July 25, 2005 Maher Salah 36

Using M arked-Traces Feature-interaction view Runtime Events Object-interaction view Class-interaction view Call-graphs Feature-implementation view Module-interaction view Feature-similarity view Method invocation sequence Class protocol view Using Distributed Profiler Remote-interaction view Thread-interaction view

Taxonomy of Software Views

Requires information about runtime objects

slide-13
SLIDE 13

13

July 25, 2005 Maher Salah 37

Software Views

  • Feature views

– Impact of changing one feature on other features – Feature implementation and dependencies

  • Remote-interaction

– Highlights interactions between components of distributed systems

  • Thread-interaction

– Highlights potential concurrency issues

  • Class usage protocol

– Documenting usage scenarios

July 25, 2005 Maher Salah 38

Terminology

  • Classification of objects

Let F = { set of features } – Local(Fk): objects created and used by Fk – Import(Fk):objects used by Fk and created by Fj – Export (Fk): objects created by Fk and used by Fj

  • Relationships:

– depends(Fk, Fj) = I(Fk) ∩ E(Fj) ≠φ – shares(Fk, Fj) = I(Fk) ∩ I(Fj) ≠φ

July 25, 2005 Maher Salah 39

Feature-Interaction

  • Feature ⇔ Marked-Trace
  • Construction Feature-interaction diagram

– Identity Import (F) and Export(F) sets – Compute depends(Fk, Fj) = I(Fk) ∩ E(Fj) – Compute shares(Fk, Fj) = I(Fk) ∩ I(Fj) – Draw a depends- edge if depends(Fk, Fj) ≠φ – Draw a shares- edge if shares(Fk, Fj) ≠φ

slide-14
SLIDE 14

14

July 25, 2005 Maher Salah 40

Feature-Interaction: Example

Feature F1 Feature F2

Object O4 Object O5 Object O1 Object O2 Object O2

Feature F3

Object O4 Object O6 Object O1

Uses Uses uses

Object O3

Class C1 Class C2

Object O7

Class C3 Feature F4

Object O4

uses

Interactions within a given Feature are ignored OK Oj

The object is created by the corresponding feature The object is used by the corresponding feature, but created by other feature July 25, 2005 Maher Salah 41

Feature-Interaction: Example

  • Import/Export sets:
  • Depends/Shares:
  • Feature-interaction

view

Import Export Feature F1 {O1, O2} Feature F2 {O2} {O4} Feature F3 {O1, O4} Feature F4 {O4} Depends (F2, F1) = E(F1) I(F2) = {O2} Depends (F3, F1) = E(F1) I(F3) = {O1} Depends (F3, F2) = E(F2) I(F3) = {O4} Depends (F4, F2) = E(F2) I(F4) = {O4} Shares (F3, F4) = I(F3) I(F4) = {O4} Feature-2 Feature-3 Feature-1 Feature-4 C2: O4 C1: O2 C2: O4 C2: O4 C1: O1 July 25, 2005 Maher Salah 42

Jext: Feature-interaction

slide-15
SLIDE 15

15

July 25, 2005 Maher Salah 43

Feature-similarity view

  • The similarity matrix is computed from the

call-graphs

– Fk = Gk (Vk, Ek)

  • Using relations (edges)

| 2 E 1 E | | 2 E 1 E | ) 2 F , 1 F ( Similarity U I =

TechReport: Client-side feature similarity

add-publication search-by-author search-by-title update-publication add-publication 100 2 32 search-by-author 100 47 7 search-by-title 100 3 update-publication 100 July 25, 2005 Maher Salah 44

Class protocol view

  • Terminology

– Usage scenario: A description of how a class is used by other classes – Method invocation sequence: The sequence of invocations against an instance of a class (object).

  • Problem

– Determine the class-usage scenarios from its invocation sequences

  • Approach

– Compute the canonical set and canonical groups of method sequences. – Approximate each canonical group as a regular expression (Usage scenario)

July 25, 2005 Maher Salah 45

Class protocol view

  • File class
  • Symbols

– R = Read – W = Write – O = Open – C = Close

  • Method Sequences

– ORC, – ORRC, – ORRRC, – ORRRRC, – OWC, – OWWWC, – ORWWWWWC, – OWWWWWWWWW WC, – ORRRRRRRRRRWC

+Read() +Write() +Open() +Close() File

slide-16
SLIDE 16

16

July 25, 2005 Maher Salah 46

Class protocol view

  • Canonical set

– ORRC, OWWWRC

  • Canonical groups

– P1 = {ORC, ORRC, ORRRC, ORRRRC, ORRRRRRRRRRWC } – P2 = {OWWWC, WWWWWWWWWWC, ORWWWWWC, OWC}.

  • Regular expressions

– P1 = O (R)1,2,3,4,10 (W)0,1 C ≈ O (R)+ (W)? C – P2 = O (R)0,1 (W)1,3,5,10 C ≈ O (R)? (W)+ C

July 25, 2005 Maher Salah 47 P = {p1, p2, …, pn} Method sequences Kmin Kmax Canonical Set Canonical Groups Similarity function

Computing Canonical Set/Groups

Compute the similarity graph G(P) using the similarity function Compute the canonical set that satisfies: Compute the canonical groups

  • )

IntraEdge ( Weight min

  • )

CutEdge ( Weight max

Extra Edge Cut Edge Intra Edge Canonical Set

Compute Canonical groups Formulate the BCS problem as an integer programming problem Use semi-definite programming (SDP) to find an approximate sooution

Canonical Set

July 25, 2005 Maher Salah 48

Similarity Measure

  • Levenshtein edit-distance function

– Distance d(si, sj) = Least number of operations required to transform string si into string sj. – Operations: deletion, insertion, substitution

  • Adaptation of edit-distance

– Associating a variable cost with each operation

  • Frequency of a particular method invocation

– Cost = exp (-frequency/length)

  • Location of the particular method invocation

– Cost = 1 if s[k] <> s[k-1] – Cost = tiny if s[k] = s[k-1]

slide-17
SLIDE 17

17

July 25, 2005 Maher Salah 49

Similarity Measure

  • Examples:

– InsertCost(“ORRC”, “R”, k) > InsertCost(“ORRRRRC”, “R”, k)

  • ORRC has fewer Rs than ORRRRRC

– InsertCost(“ORRWWC”, “R”, 5) > InsertCost(“ORRWWC”, “R”, 3)

  • Similarity function

) s , s ( d 1 1 ) s , s ( Similarity

j i j i

+ =

July 25, 2005 Maher Salah 50

Computing Canonical Groups

  • Let

– P = {p1, p2, .., pn} - Method sequences – P` = {q1, q2, .., pm} - Canonical set

  • For each pi, compute its similarity to all

elements of P`

  • Place pi in the group gk, where

– similarity(pi, qk) > similarity(pi, ql), ∀ql ∈ P`, k ≠ l

  • In case of a tie in max-similarity, place pi in

all corresponding groups

July 25, 2005 Maher Salah 51

Observations/Limitations

  • MS can get long and complex
  • MS may contain subsequences that may not be

traceable to source code

  • Overlapping groups

Þ At this stage, our approach cannot produce a simplified set class usage scenarios.

  • Analyzing closely related classes can produce

simpler MS than if each class is analyzed individually.

– Example: Socket, SocketInputStreams, and SocketOutputSteam

slide-18
SLIDE 18

18

July 25, 2005 Maher Salah 52

Socket class example

A <init> B setImpl C getInputStream D getOutputStream E getLocalAddress F getLocalPort G getPort H getInetAddress J close I postAccept K setSoTimeout L setSoLinger M setTcpNoDelay N getSoTimeout O connect P isClosed

AEHDEFGHNC(EFGH)2(NEFGH) (N(EFGH)2N(EFGH)2N(EFGH)2(NEFGH))2 ((EFGHN)(EFGH)2(NEFGH))2

···· (W)3(RW)2R(WR(W)2RWR)4

R java.net.SocketInputStream.read() W java.net.SocketOutputStream.write()

Socket, SocketInputStreams, and SocketOutputSteam

July 25, 2005 Maher Salah 53

Evaluation

Case study

July 25, 2005 Maher Salah 54

Case study

  • Systems

System Platform Size (KLOC)

Mozilla: Web browser (v1.0.1) Win32/C,C++

4,410

Jext: Text Editor (v3.2) Java

98

TechReport: Publication database Java/EJB

2.3

slide-19
SLIDE 19

19

July 25, 2005 Maher Salah 55

Tool Architecture for the Analysis of Mozilla

July 25, 2005 Maher Salah 56

Tool Architecture for the Analysis of Jext

Jext Text Editor JDBC Compliant D a t a b a s e (SQL Server) S Q L (JDBC) S M Q L Analysis/Visualization Subsystem Repository Subsystem Trace Marker

  • Feature-im

plem entation view

  • Feature-interaction view
  • Feature-sim

ilarity view

  • Class-interaction
  • Thread-interaction view
  • Class protocol view

SMQL Filters V i s u a l i z a t i o n ( P r e s e n t a t i o n ) Profiling Jext (Using JvProf) Runtime events (XML Format) Import (dbimport)

July 25, 2005 Maher Salah 57

Tool Architecture for the Analysis of TechReport

JDBC Compliant D a t a b a s e (SQL Server) S Q L (JDBC) S M Q L Analysis/Visualization Subsystem Repository Subsystem Trace Marker Feature-im plem entation view Feature-interaction view Feature-sim ilarity view Rem

  • te-interaction view

Class-interaction view Thread-interaction view SMQL Filters V i s u a l i z a t i o n ( P r e s e n t a t i o n ) Profiling EJB Server (Using JvProf) Profiling TechReport (Using JvProf) LogicalTimeServer Runtime events (XML Format) Runtime events (XML Format) Import (dbimport) Import (dbimport) Logical-Time Distributed Marked-Trace Logical-Time Distributed Marked-Trace EJB Server TechReport Client

slide-20
SLIDE 20

20

July 25, 2005 Maher Salah 58

Case study

  • Views

Mozilla Jext TechReport Object-interaction

  • Class-interaction
  • Module-interaction
  • Feature-implementation
  • Feature-interaction
  • Feature-similarity
  • Remote-Interaction
  • Thread-Interaction
  • Class-usage protocol
  • July 25, 2005

Maher Salah 59

Example of a maintenance scenario

  • Change request

– Modify send-page feature of the Mozilla web-browser

  • Developer task

– Study the change request – Locate source code portions related to the send-page:

  • Option-1

– Study the source code and documentation

  • Option-2

– Instrument the application’s code – Exercise the feature using a profiler – Analyze execution trace(s)

July 25, 2005 Maher Salah 60

 Type feature name “send-page”  Exercise send-page feature  Mark start of send-page trace  Mark end of send-page trace  Run/profile Mozilla

  • Load and analyze runtime data

Mozilla: Send-page feature

slide-21
SLIDE 21

21

July 25, 2005 Maher Salah 61

Mozilla: Send-page feature

Module-interaction (Clustered)

July 25, 2005 Maher Salah 62

Simplifying views

  • The user can exercise enough features to

identify common modules/classes

  • Common modules are the application’s

infrastructure and are used by most features

  • Eliminating common modules/classes will

result in simpler and manageable views per feature

July 25, 2005 Maher Salah 63

Send-page feature

Common modules are filtered out Clustered

slide-22
SLIDE 22

22

July 25, 2005 Maher Salah 64

Mozilla: “Msgbsutil” cluster

Module-interaction

July 25, 2005 Maher Salah 65

Mozilla: MIME.DLL class-interaction

July 25, 2005 Maher Salah 66

Mozilla: Feature implementation view

slide-23
SLIDE 23

23

July 25, 2005 Maher Salah 67

Mozilla: Similarity Matrix

print-page

  • pen-url

bookmark - add

  • pen-link

startup bookmark -

  • pen

shutdown send-page save-page 69 57 48 57 57 61 44 61 print-page 100 56 48 59 51 65 44 52

  • pen-url

100 42 77 50 76 43 56 bookmark-add 100 43 40 48 42 36

  • pen-link

100 45 84 46 49 startup 100 50 39 57 bookmark-open 100 47 53 shutdown 100 44 send-page 100

With all modules/classes

print-page

  • pen-url

bookmark

  • add
  • pen-link

startup bookmark

  • open

shutdown send-page save-page 67 45 12 53 50 57 17 22 print-page 100 35 15 45 48 49 16 16

  • pen-url

100 10 63 37 77 17 29 bookmark-add 100 10 10 11 9 3

  • pen-link

100 36 81 16 20 startup 100 39 13 20 bookmark-open 100 20 21 shutdown 100 17 send-page 100

Without common modules/classes

July 25, 2005 Maher Salah 68

Outline

  • Motivation
  • Software Comprehension
  • Architecture of Software Comprehension

Environment

  • Software Views / Case Study
  • Related Work
  • Conclusions

July 25, 2005 Maher Salah 69

Related work

  • Analysis of Multi-language applications

– Web applications [Hassan02] – Integrated conceptual model [Kullback98]

  • Analysis of distributed systems

– BEE++ system [Bruegge93] – X-Ray system [Mendoca99]

  • Analysis of program features

– Concept analysis [Eisenbarth01] – Abstract system dependency graph [Chen00]

slide-24
SLIDE 24

24

July 25, 2005 Maher Salah 70

Outline

Software Comprehension Architecture of Software Comprehension Environment Software views / Case Study Related Work

  • Conclusions

July 25, 2005 Maher Salah 71

Conclusions

  • Contributions

– Development of a software comprehension environment that supports

  • Feature-driven profiling and analysis
  • Distributed profiling
  • Multiple languages (C, C++, Java)
  • SMQL language for retrieving and analyzing data

– Software views

  • Feature-interaction, implementation and similarity
  • Remote-interaction
  • Thread-interaction
  • Class protocol view
  • Module-interaction
  • Class-interaction

July 25, 2005 Maher Salah 72

Conclusions

  • Opportunities for future work

– Views

  • Visualization
  • New views

– Data collection

  • Scripting languages
  • Profiling of popular frameworks: COM+ and .NET

– Integration with common IDEs

slide-25
SLIDE 25

25

July 25, 2005 Maher Salah 73

Publications

  • Class-usage protocol

– Salah M., Denton T., Mancoridis S., Shokoufandeh A., Vokolos F., Scenariographer: A Tool for Reverse Engineering Class Usage Scenarios from Method Invocation Sequences, IEEE ICSM, Budapest, Hungary, 2005.

  • Analysis of large systems: Mozilla

– Salah M., Mancoridis S., Antoniol G. and Di Penta M. , Employing Use-cases and Dynamic Analysis to Comprehend Mozilla, IEEE ICSM, Budapest, Hungary, 2005.

  • Feature analysis – Feature-interaction view

– Salah M., Mancoridis S. A Hierarchy of Dynamic Software Views: from object- interactions to feature-interactions, IEEE ICSM, Chicago, Illinois, 2004.

  • Architecture and analysis of distributed systems

– Salah M., Mancoridis S., Toward an Environment for Comprehending Distributed Component-Based Systems, IEEE WCRE, Victoria, British Columbia, Canada, November 2003.

  • Profiling and dynamic analysis

– Souder, T., Mancoridis, S., Salah, M., Form: A Framework for Creating Views of Program Executions, IEEE ICSM, Florence, Italy, 2001.

Questions

http://serg.cs.drexel.edu/~msalah/sce/