Software Analysis Visualization



Similar documents
Software Engineering & Architecture

Génie Logiciel et Gestion de Projets. Evolution

CodeCrawler An Extensible and Language Independent 2D and 3D Software Visualization Tool

The Class Blueprint A Visualization of the Internal Structure of Classes

Polymetric Views A Lightweight Visual Approach to Reverse Engineering

A Visualization Method to Support Impacts Analysis in Program Understanding

What is Visualization? Information Visualization An Overview. Information Visualization. Definitions

Hierarchical Data Visualization

An Introduction to Software Visualization. Visualization. Types of Software Visualization. Course Overview

Component visualization methods for large legacy software in C/C++

Program Understanding in Software Engineering

Program Understanding with Code Visualization

CodeCrawler Lessons Learned in Building a Software Visualization Tool

A Tool for Visual Understanding of Source Code Dependencies

An Open Framework for Reverse Engineering Graph Data Visualization. Alexandru C. Telea Eindhoven University of Technology The Netherlands.

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Karunya University Dept. of Information Technology

Software visualization. Why visualization?

Big Data: Rethinking Text Visualization

Assuming the Role of Systems Analyst & Analysis Alternatives

Visualization methods for patent data

Object-Oriented Systems Analysis and Design

Software Engineering Introduction & Background. Complaints. General Problems. Department of Computer Science Kent State University

Spreadsheet Simulation

Algorithms, Flowcharts & Program Design. ComPro

Hierarchical Data Visualization. Ai Nakatani IAT 814 February 21, 2007

Design methods. List of possible design methods. Functional decomposition. Data flow design. Functional decomposition. Data Flow Design (SA/SD)

Hierarchy and Tree Visualization

How To Develop Software

Graph/Network Visualization

Vragen en opdracht. Complexity. Modularity. Intra-modular complexity measures

Topic Maps Visualization

The Eyes Have It: A Task by Data Type Taxonomy for Information Visualizations. Ben Shneiderman, 1996

Core Syllabus. Version 2.6 B BUILD KNOWLEDGE AREA: DEVELOPMENT AND IMPLEMENTATION OF INFORMATION SYSTEMS. June 2006

How To Understand The Software Development Lifecycle

Software Engineering. System Models. Based on Software Engineering, 7 th Edition by Ian Sommerville

High-level Design. What is software architecture?

11 Tips to make the requirements definition process more effective and results more usable

Glossary of Object Oriented Terms

Masters of Science in Software & Information Systems

Fundamentals of Java Programming

Training Management System for Aircraft Engineering: indexing and retrieval of Corporate Learning Object

What is a life cycle model?

WebSphere Business Modeler

Product Review: James F. Koopmann Pine Horse, Inc. Quest Software s Foglight Performance Analysis for Oracle

Software Engineering/Courses Description Introduction to Software Engineering Credit Hours: 3 Prerequisite: (Computer Programming 2).

Java (12 Weeks) Introduction to Java Programming Language

Developing SOA solutions using IBM SOA Foundation

GCE APPLIED ICT A2 COURSEWORK TIPS

Gadget: A Tool for Extracting the Dynamic Structure of Java Programs

The Role of the Software Architect

Supporting Software Development Process Using Evolution Analysis : a Brief Survey

Software Engineering Question Bank

Object Oriented Programming. Risk Management

COSC 3351 Software Design. Recap for the first quiz. Edgar Gabriel. Spring For the 1 st Quiz

Development models. 1 Introduction. 2 Analyzing development models. R. Kuiper and E.J. Luit

SOA Enabled Workflow Modernization

VISUALIZATION APPROACH FOR SOFTWARE PROJECTS

Table of Contents. CHAPTER 1 Web-Based Systems 1. CHAPTER 2 Web Engineering 12. CHAPTER 3 A Web Engineering Process 24

(BA122) Software Engineer s Workshop (SEW)

The value of modeling

POLAR IT SERVICES. Business Intelligence Project Methodology

1.1 The Nature of Software... Object-Oriented Software Engineering Practical Software Development using UML and Java. The Nature of Software...

Using UML Part One Structural Modeling Diagrams

Course Syllabus For Operations Management. Management Information Systems

Understanding Software Static and Dynamic Aspects

Clustering & Visualization

Data Analysis 1. SET08104 Database Systems. Napier University

The course: An Introduction to Information Visualization Techniques for Exploring Large Database

MultiMedia and Imaging Databases

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Business-Driven Software Engineering Lecture 3 Foundations of Processes

Fluency With Information Technology CSE100/IMT100

Frequency, definition Modifiability, existence of multiple operations & strategies

Software Engineering. How does software fail? Terminology CS / COE 1530

Visual Data Mining. Motivation. Why Visual Data Mining. Integration of visualization and data mining : Chidroop Madhavarapu CSE 591:Visual Analytics

Tudumi: Information Visualization System for Monitoring and Auditing Computer Logs

Service-Oriented Architecture and Software Engineering

Content Management Implementation Guide 5.3 SP1

Transcription:

28th International Conference on Software Engineering Software Analysis Visualization Harald Gall and Michele Lanza

!oftware Visualiza"o# Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 2

Software Visualization - Outline! Introduction! Software Visualization in a Reengineering Context! Static Code Visualization " Examples! Dynamic Code Visualization " Examples! Lightweight Approaches " Combining Metrics and Visualization " Demonstration! Conclusion Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 3

Prologue Once upon a time! Reverse engineer 1.2 MLOC C++ system of ca. 2300 classes! * 2 = 2 400 000 seconds! / 3600 = 667 hours / 8 = 83 days / 5 = 16 weeks & 3 days! ~ 4 months to read the system! Questions: " What is the size and the overall structure of the system? " What is the internal structure of the system and its elements? " How did the software system become like that? Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 4

Introduction! Visualization " Information Visualization! Software Visualization " Algorithm Visualization " Program Visualization " Static Code Visualization " Dynamic Code Visualization! The overall goal is to reduce complexity Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 5

Information Visualization! The human eye and brain interpret visual information in order to react to the world! We want to answer questions on what we perceive! J. Bertin inferred three levels of questions " Lower perception (one element) " Medium perception (several elements) " Upper perception (all elements/the complete picture)! Information Visualization is about " how to display information " how to reduce its complexity Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 6

Software Visualization Software Visualization is the use of the crafts of typography, graphic design, animation, and cinematography with modern human-computer interaction and computer graphics technology to facilitate both the human understanding and effective use of computer software. Price, Baecker and Small, Introduction to Software Visualization! 2 main fields: " Algorithm Visualization " Program Visualization Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 7

Conceptual Problem "Software is intangible, having no physical shape or size. Software visualization tools use graphical techniques to make software visible by displaying programs, program artifacts and program behavior. [Thomas Ball] Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 8

Software Visualization in Context! There are many good-looking visualization techniques, but..when it comes to software maintenance & evolution, there are several problems: " Scalability " Information Retrieval " What to visualize " How to visualize " Reengineering context constraints " Limited time " Limited resources Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 9

The Reengineering Life-cycle Requirements (0) requirement analysis (2) problem detection (3) problem resolution Designs (1) model capture (2) problem detection issues Tool support Scalability Efficiency Code (4) program transformation Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 10

Program Visualization Program visualization is the visualization of the actual program code or data structures in either static or dynamic form [Price, Baecker and Small]! Static code visualization! Dynamic code visualization! Generate different views of a system and infer knowledge based on the views! Complex problem domain (current research area) " Efficient space use, edge crossing problem, layout problem, focus, HCI issues, GUI issues, " Lack of conventions (colors, symbols, interpretation, ) Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 11

Program Visualization II! Level of granularity? " Complete systems, subsystems, modules, classes, hierarchies,...! When to apply? " First contact with an unknown system " Known/unknown parts? " Forward engineering?! Methodology? Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 12

Static Code Visualization! The Visualization of information that can be extracted from the static structure of a software system! Depends on the programming language and paradigm: " Object-Oriented PL: " classes, methods, attributes, inheritance, " Procedural PL: " procedures, invocations, " Functional PL: " functions, function calls, Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 13

Example 1: Class Hierarchies! Jun/OpenGL! The Smalltalk Class Hierarchy! Problems: " Colors are meaningless " Visual Overload " Navigation Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 14

Example 2: Tree Maps! Pros " 100% screen " Large data " Scales well! Cons " Boundaries " Cluttered display " Interpretation " Leaves only! Useful for the display of Hard Disks Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 15

Examples 3 & 4! Euclidean cones " Pros: " More info than 2D " Cons: " Lack of depth " Navigation! Hyperbolic trees " Pros: " Good focus " Dynamic " Cons: " Copyright Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 16

Class Diagram Approaches! For example UML diagrams! Pros: " OO Concepts " Good for small parts! Cons: " Lack of scalability " Require tool support " Requires mapping rules to reduce noise " Preconceived views Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 17

Class Diagram Examples Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 18

Example 5: MetricView! UML & 3D Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 19

Example 6a: Rigi! Scalability problem! Entity-Relationship visualization! Problems: " Filtering " Navigation Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 20

Example 6b: Rigi! Entities can be grouped! Pros: " Scales well " Applicable in other domains! Cons: " Not enough code semantics Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 21

Evaluation! Pros " Intuitive approaches " Aesthetically pleasing results! Cons " Several approaches are orthogonal to each other " Too easy to produce meaningless results " Scaling up is sometimes possible, but at the expense of semantics Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 22

Dynamic Code Visualization! Visualization of dynamic behavior of a software system " Code instrumentation " Trace collection " Trace evaluation " What to visualize " Execution trace " Memory consumption " Object interaction " Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 23

Example 1: JInsight! Visualization of execution trace Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 24

Example 2: Inter-class call matrix! Simple! Scales quite well! Reproducible Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 25

Example 3: TraceCrawler Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 26

Dynamic SV: Evaluation! Code instrumentation problem " Logging, Extended VMs, Method Wrapping! Scalability problem " Traces quickly become very big! Completeness problem " Scenario driven! Pros: " Good for fine-tuning, problem detection! Cons: " Tool support crucial " Lack of abstraction without tool support Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 27

Taking a step back! Why is visualization important at all?! Is it actually useful? " No, visualization is only a means, not the end " Yes, visualization is only a means, not the end!!!! The question is: What is the end? " We want to understand systems Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 28

Lightweight Approaches! Already existing approaches and tools exist: " hyperbolic views, fish-eye views, spring layouts, " Rigi, ShrimpView, Creole, Gsee, " Some of them are even copyrighted and/or commercial tools!! Why are they not widely used?! The reengineering context does not permit heavy-weight approaches " Let s do it lightweight then Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 29

Object-Oriented Reverse Engineering! Goal: take a (large legacy) software system and understand it, i.e., construct a mental model of the system?! Problem: the software system in question is " Unknown, very large, and complex " Domain- and language-specific " Seldom documented or commented " In bad shape Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 30

Object-Oriented Reverse Engineering (II)! Constructing a mental model requires information about the system: " Top-down approaches " Bottom-up approaches " Mixed Approaches! There is no silver bullet methodology! Every reverse engineering situation is unique! Need for flexibility, customizability, scalability, and simplicity Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 31

Reverse Engineering Approaches! Reading (source code, documentation, UML diagrams, comments)! Running the SW and analyze its execution trace! Interview users and developers (if available)! Clustering! Concept Analysis! Software Visualization! Software Metrics! Slicing and Dicing! Querying (Database)! Data Mining! Logic Reasoning! Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 32

The Information Crystallization Problem! Many approaches generate too much or not enough information! The reverse engineer must make sense of this information by himself! We need the right information at the right time Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 33

What is the actual problem?! The information needed to reverse engineer a legacy software system resides at various levels! We need to obtain and combine " Coarse-grained information about the whole system " Fine-grained information about specific parts " Evolutionary information about the past of the system Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 34

A simple Solution - The Polymetric View! A lightweight combination of two approaches: " Software visualization (reduction of complexity, intuitive) " Software metrics (scalability, assessment)! Interactivity (iterative process, silver bullet impossible)! Does not replace other techniques, it complements them: " Opportunistic code reading Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 35

The Polymetric View - Principles! Visualize software: " entities as rectangles " relationships as edges Entities! Enrich these visualizations: " Map up to 5 software metrics on a 2D figure " Map other kinds of semantic information on nominal colors 2 position metrics Relationships width metric color metric height metric Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 36

The Polymetric View - Example System Complexity View Nodes = Classes Edges = Inheritance Relationships Width = Number of Attributes Height = Number of Methods Color = Number of Lines of Code Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 37

The Polymetric View - Example (II) System Complexity View Nodes = Classes Edges = Inheritance Relationships Width = Height = Color = Reverse engineering goals # attributes # methods # lines of code View-supported tasks Get an impression (build a first raw mental model) of the system, know the size, structure, and complexity of the system in terms of classes and inheritance hierarchies Locate important (domain model) hierarchies, see if there are any deep, nested hierarchies Locate large classes (standalone, within inheritance hierarchy), locate stateful classes and classes with behaviour Count the classes, look at the displayed nodes, count the hierarchies Search for node hierarchies, look at the size and shape of hierarchies, examine the structure of hierarchies Search big nodes, note their position, look for tall nodes, look for wide nodes, look for dark nodes, compare their size and shape, read their name => opportunistic code reading Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 38

The Polymetric View - Description! Every polymetric view is described according to a common pattern! Every view targets specific reverse engineering goals! The polymetric views are implemented in CodeCrawler System Complexity View Structural Specification Target... Scope... Metrics.................. Layout... Description...... Goals.. Symptoms.. Scenario Case Study.... Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 39

Coarse-grained Software Visualization! Reverse engineering question: " What is the size and the overall structure of the system?! Coarse-grained reverse engineering goals: " Gain an overview in terms of size, complexity, and structure " Asses the overall quality of the system " Locate and understand important (domain model) hierarchies " Identify large classes, exceptional methods, dead code, etc. " Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 40

Coarse-grained Polymetric Views - Example LOC Method Efficiency Correlation View Nodes: Methods Edges: - Size: Number of method parameters Position X: Number of lines of code Position Y: Number of statements NOS Goals: Detect overly long methods Detect dead code Detect badly formatted methods Get an impression of the system in terms of coding style Know the size of the system in # methods Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 41

Inheritance Classification View Boxes: Edges: Width: Height: Color: Classes Inheritance Number of Methods Added Number of Methods Overridden Number of Method Extended Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 42

Data Storage Class Detection View Boxes: Width: Height: Color: Classes Number of Methods Lines of Code Lines of Code Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 43

Quiz: Where would you start looking? Nodes: Edges: Width: Height: Color: Classes Inheritance Relationships Number of attributes Number of methods Number of lines of code Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 44

CodeCrawler Demo Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 45

Clustering the Polymetric Views First Contact System Hotspots System Complexity Root Class Detection Implementation Weight Distribution Candidate Detection Data Storage Class Detection Method Efficiency Correlation Direct Attribute Access View Method Length Distribution Inheritance Assessment Inheritance Classification Inheritance Carrier Intermediate Abstract Class Internal The Class Blueprint Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 46

Coarse-grained SV - Conclusions! Benefits " Views are customizable (context ) and easily modifiable " Simple approach, yet powerful " Scalability! Limits " Visual language must be learned Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 47

Granularity level problem: It looks nice, but...what s inside? Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 48

Fine-grained Software Visualization! Reverse engineering question: " What is the internal structure of the system and its elements?! Fine-grained reverse engineering goals: " Understand the internal implementation of classes and class hierarchies " Detect coding patterns and inconsistencies " Understand class/subclass roles " Identify key methods in a class " Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 49

The Class Blueprint - Principles Initialization External Interface Internal Implementation Accessor Attribute Invocation Sequence The class is divided into 5 layers Nodes Methods, Attributes, Classes Edges Invocation, Access, Inheritance The method nodes are positioned according to Layer Invocation sequence Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 50

The Class Blueprint - Principles (II) # invocations Abstract Method Constant Method Method # lines Overriding Method Read Accessor Delegating Method Write Accessor # external accesses Extending Method Attribute Attribute # internal accesses Method Invocation Direct Attribute Access Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 51

The Class Blueprint - Example! Delegate: " Delegates functionality to other classes " May act as a Façade (DP)! Large Implementation: " Deep invocation structure " Several methods " High decomposition! Wide Interface! Direct Access! Sharing Entries Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 52

The Class Blueprint - Example (II)! Call-flow " Double Single Entry " (=> split class?)! Inheritance " Adder " Interface overriders! Semantics " Direct Access! State Usage " Sharing Entries Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 53

Class Blueprint: Data Storage! Has many attributes! May have many accessor methods! No complex behavior " No internal implementation! Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 54

Class Blueprint: Inheritance Policy Breach Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 55

The Class Blueprint - A Pattern Language?! The patterns reveal information about " Coding style " Coding policies " Particularities! We grouped them according to " Size " Layer distribution " Semantics " Call-flow " State usage! Moreover " Inheritance Context " Frequent pattern combinations " Rare pattern combinations! They are all part of a pattern language Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 56

The Class Blueprint - What do we see? Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 57

CodeCrawler Demo Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 58

Fine-grained SV - Conclusions! Benefits " Complexity reduction " Visual code inspection technique " Complements the coarse-grained views! Limits " Visual language must be learned " Good object-oriented knowledge required " No information about actual functionality => opportunistic code reading necessary Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 59

Epilogue happily everafter.! Did we succeed after all?! Not completely, but " System Hotspots View on 1.200 000 LOC of C++ " System Complexity View on ca. 200 classes of C++ Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 60

Industrial Validation - The Acid Test! Several large, industrial case studies (NDA)! Different implementation languages! Severe time constraints System Language Lines of Code Classes Z C++ 1 200 000 ~2300 Y C++/Java 120 000 ~400 X Smalltalk 600 000 ~2500 W COBOL 40 000 - Sortie C/C++ 28 000 ~70 Duploc Smalltalk 32 000 ~230 Jun Smalltalk 135 000 ~700 Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 61

Software Visualization: Conclusions! SV is very useful when used correctly! An integrated approach is needed, just having nice pictures is not enough! Most tools still at prototype level! In general: only people that know what they see can react on that: SV is for expert/advanced developers! The future of software development is coming and SV is part of it Tutorial F7 Software Evolution: Analysis and Visualization 2006 Harald C. Gall & Michele Lanza 62