© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.1 3. Software Visualization Introduction SV in a Reengineering Context Static Code Visualization.

Slides:



Advertisements
Similar presentations
Visual Scripting of XML
Advertisements

SECOND MIDTERM REVIEW CS 580 Human Computer Interaction.
1 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 2 Radu Marinescu Reverse Engineering.
Practical Business Modeling in the Unified Process Tom Morgan Software Architect, Fidelity National Information Services
OORPT Object-Oriented Reengineering Patterns and Techniques 7. Problem Detection Prof. O. Nierstrasz.
© S. Demeyer, S. Ducasse, O. Nierstrasz Reverse Engineering.1 2. Reverse Engineering What and Why Setting Direction  Most Valuable First First Contact.
Program Comprehension & Software Evolution - [Lightweight] Principles and [real] Practice Michele Lanza Faculty of Informatics University of Lugano Switzerland.
Object-Oriented Analysis and Design
Software engineering for real-time systems
© S. Demeyer, S. Ducasse, O. Nierstrasz Duplication.1 7. Problem Detection Metrics  Software quality  Analyzing trends Duplicated Code  Detection techniques.
OORPT Object-Oriented Reengineering Patterns and Techniques 5. Software Visualization Prof. O. Nierstrasz.
7. Duplicated Code Metrics Duplicated Code Software quality
© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.1 5. Software Visualization Introduction  SV in a Reengineering Context Static Code Visualization.
OORPT Object-Oriented Reengineering Patterns and Techniques X. CHAPTER Prof. O. Nierstrasz.
1/31 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2005] January 22, 2009.
© Copyright Eliyahu Brutman Programming Techniques Course.
An Introduction to Software Visualization Dr. Jonathan I. Maletic Software DevelopMent Laboratory Department of Computer Science Kent State University.
Object-Oriented Reengineering Patterns 3. Software Visualization Selected slides courtesy Tudor Girba.
Object Oriented Analysis and Design Using the UML
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Structured Vs. Object Oriented Analysis and Design SAD Vs. OOAD
The Re-engineering and Reuse of Software
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
CASE Tools And Their Effect On Software Quality Peter Geddis – pxg07u.
Human Interface Engineering1 Main Title, 60 pt., U/L case LS=.8 lines Introduction to Human Interface Engineering NTU Seminar Amy Ma HIE Global Director.
Objects What are Objects Observations
What is UML? What is UP? [Arlow and Neustadt, 2005] January 23, 2014
UML - Development Process 1 Software Development Process Using UML (2)
Unit 2: Engineering Design Process
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
What is a life cycle model? Framework under which a software product is going to be developed. – Defines the phases that the product under development.
Introduction to UML By: Prof. Aiman Hanna Department of Computer Science, Concordia University, Montreal, Canada.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Software development process ธนวัฒน์ แซ่ เอียบ. The development process Process –set of rules which define how a development project. Methodology and.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 1 Object Modeling.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Unit 2: Engineering Design Process
1 Introduction to Software Engineering Lecture 1.
Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet,
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
 What is Modeling What is Modeling  Why do we Model Why do we Model  Models in OMT Models in OMT  Principles of Modeling Principles of Modeling 
Chapter 1 Applying UML and Patterns. The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
Computing and SE II Chapter 15: Software Process Management Er-Yu Ding Software Institute, NJU.
Computer Systems & Architecture Lesson 4 8. Reconstructing Software Architectures.
Modeling as a Design Technique Chapter 2 Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha
PROC-1 1. Software Development Process. PROC-2 A Process Software Development Process User’s Requirements Software System Unified Process: Component Based.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
SBD: Information Design
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Generating Software Documentation in Use Case Maps from Filtered Execution Traces Edna Braun, Daniel Amyot, Timothy Lethbridge University of Ottawa, Canada.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Winter 2011SEG Chapter 11 Chapter 1 (Part 1) Review from previous courses Subject 1: The Software Development Process.
Parastoo Mohagheghi 1 A Multi-dimensional Framework for Characterizing Domain Specific Languages Øystein Haugen Parastoo Mohagheghi SINTEF, UiO 21 October.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
1 SYS366 Week 1 - Lecture 1 Introduction to Systems.
2000 Research Overview Dr. Kim Mens Programming Technology Lab Vrije Universiteit Brussel.
1 Object-Oriented Reengineering © S. Demeyer, S.Ducasse, O. Nierstrasz Lecture 4 Radu Marinescu Design Extraction.
Introduction to Object Oriented Programming Lecture-3.
Michele Lanza Software Visualization. 2 Software Visualization - Outline  Introduction  Software Visualization in a Reengineering Context  Static Code.
Object-Oriented Analysis and Design
Object-Oriented Software Engineering Using UML, Patterns, and Java,
Introduction to Unified Modeling Language (UML)
OORPT Object-Oriented Reengineering Patterns and Techniques
Find API Usage Patterns
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.1 3. Software Visualization Introduction SV in a Reengineering Context Static Code Visualization  Examples Dynamic Code Visualization  Examples Lightweight Approaches  Combining Metrics and SV Understanding Evolution Conclusion

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.2 The Reengineering Life-cycle Requirements Designs Code (0) requirement analysis (1) model capture (2) problem detection (3) problem resolution (4) program transformation (2) problem detection issues Tool support Scalability Efficiency

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.3 Program Visualization Reduction of complexity Generate different views on software system Visualization is powerful. But  Can be complex (active research area), Efficient space use, crossing edges, focus...  Colors are nice but there is no convention  Nice pictures do not imply valuable information  Where to look? What is important?

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.4 A Bit of Vocabulary Visualization  Information Visualization Software Visualization  Algorithm Visualization  Program Visualization Static Code Visualization Dynamic Code Visualization The overall goal is to reduce complexity

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.5 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 The main conceptual problem: "Software is intangible, having no physical shape or size. Software visualisation tools use graphical techniques to make software visible by displaying programs, program artifacts and program behaviour.” [Thomas Ball]

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.6 In a Reengineering Context Reengineering context constraints  Limited time  Limited resources Work on old systems, dialects New tools are not processing your (C++) dialect Approaches  Scalability is crucial  Efficient (time/information obtained)  Need a clear focus Solutions  Minimize tools support  Use existing proven tools (Rigi, CodeCrawler, Jinsight)  Do it yourself but simple thing first

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.7 Program Visualization 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, …) “Program visualization is the visualization of the actual program code or data structures in either static or dynamic form” [Price, Baecker and Small]

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.8 Program Visualization II Level of granularity?  Complete systems, subsystems, modules, classes, hierarchies,... When to apply?  First contact with a unknown system  Known/unknown parts?  Forward engineering? Methodology?

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.9 RoadMap Introduction SV in a Reengineering Context Static Code Visualization  Examples Dynamic Code Visualization  Examples Lightweight Approaches  Combining Metrics and SV Understanding Evolution Conclusion

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.10 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, …  …

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.11 Example 1: Class Hierarchies Jun/OpenGL The Smalltalk Class Hierarchy Problems:  Colors are meaningless  Visual Overload

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.12 Example 2: Tree Maps Pros  100% screen  Large data  Scales well Cons  Boundaries  Cluttered display  Interpretation  Leaves only Useful for the display of HDDs

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.13 Examples 3 & 4 Euclidean cones  Pros: More info than 2D  Cons: Lack of depth Navigation Hyperbolic trees  Pros: Good focus Dynamic  Cons: Copyright

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.14 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

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.15 Class Diagram Examples

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.16 Example 5a: Rigi Scalability problem Entity- Relationshi p visualizatio n Problems:  Filtering  Navigatio n

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.17 Example 5b: Rigi Entities can be grouped Pros:  Scales well  Applicable in other domains Cons:  Not enough code semantics

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.18 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, however at the expense of semantics

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.19 RoadMap Introduction SV in a Reengineering Context Static Code Visualization  Examples Dynamic Code Visualization  Examples Lightweight Approaches  Combining Metrics and SV Understanding Internal  Call flow within classes Understanding Evolution Conclusion

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.20 Dynamic Code Visualization Visualization of dynamic behaviour of a software system  Code instrumentation  Trace collection  Trace evaluation  What to visualize Execution trace Memory consumption Object interaction …

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.21 Example 1: JInsight Visualization of execution trace

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.22 Example 2: Inter-class call matrix Simple Reproducible Scales well Excel?

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.23 Dynamic SV: Evaluation Code instrumentation problem  Logging, Extended VMs, Method Wrapping, C++ preprocessing is heavy Scalability problem  Traces quickly become very big (1Mb/s) Completeness problem: scenario driven Pros:  Good for fine-tuning, problem detection Cons:  Tool support crucial  Lack of abstraction without tool support

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.24 RoadMap Introduction SV in a Reengineering Context Static Code Visualization  Examples Dynamic Code Visualization  Examples Lightweight Approaches  Combining Metrics and SV Understanding Evolution Conclusion

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.25 Do It Yourself Considerations A decent graph layout can be a hard task...  Algorithmic aspects may be important  Efficient space use (physical limits of a screen)  Colours are nice, but... there are no conventions!  Trade-off between usefulness and complexity Keeping a focus is hard:  Beautiful graphs are not always meaningful  Where should we look?  What should we look for? Which approach be reproduced by reengineers in work context and provides useful information?

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.26 Solution: A lightweight approach A combination of metrics and software visualization  Visualize software using colored rectangles for the entities and edges for the relationships  Render up to five metrics on one node: Size (1+2) Color (3) Position (4+5) Relationship Entity Y Coordinate Height Color tone Width X Coordinate

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.27 Combining Metrics and Visualization Metrics  Scale well  Simple metrics  simple extraction ( perl scripts )  But numerical combination is meaningless Simple Graphs  Easy to draw  Scale well  But not enough semantics CodeCrawler:

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.28 Nodes:Classes Edges:Inheritance Relationships Width: Number of attributes Height: Number of methods Color: Number of lines of code System Complexity View

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.29 LOC NOS Nodes:Methods Size: Method parameters Position X: Lines of code Position Y: Statements Method Assessment

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.30 Inheritance Classification View Boxes:Classes Edges:Inheritance Width: Number of Methods Added Height: Number of Methods Overridden Color: Number of Method Extended

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.31 Data Storage Class Detection View Boxes: Classes Width: Number of Methods Height: Lines of Code Color: Lines of Code

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.32 Industrial Validation Nokia (C MLOC >2300 classes) Nokia (C++/Java 120 kLOC >400 classes) MGeniX (Smalltalk 600 kLOC >2100classes) Bedag (COBOL 40 kLOC)... Personal experience 2-3 days to get something Used by developers + Consultants

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.33 Evaluation Pros  Quick insights  Scalable  Metrics add semantics  Interactivity makes the code “come nearer”  Reproducible  Industrial Validation is the acid test Cons  Simple  Useful in a first approach phase  Code reading needed  Level of granularity

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.34 RoadMap Introduction SV in a Reengineering Context Static Code Visualization  Examples Dynamic Code Visualization  Examples Lightweight Approaches  Combining Metrics and SV Understanding Evolution Conclusion

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.35 Understanding Evolution Information is in the history! Overwhelming complexity How can we detect and understand changes? One solution: The Evolution Matrix

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.36 The Evolution Matrix Last Version First Version Major Leap Removed Classes TIME (Versions) GrowthStabilisation Added Classes

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.37 Dayfly & Persistent Dayflies: Exists during only one or two versions. Perhaps an idea which was tried out and then dropped. Persistent: Has the same lifespan as the whole system. Part of the original design. Perhaps holy dead code which no one dares to remove.

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.38 Visualizing Classes Using Metrics Object-Oriented Programming is about “state” and “behavior”:  State is encoded using attributes  Behavior is encoded with methods We visualize classes as rectangles using for width and height the following metrics:  NOM (number of methods)  NOA (number of attributes) The Classes can be categorized according to their “personal evolution” and to their “system evolution”: Pulsar, Supernova,Red Giant, Stagnant,DayflyPersistent Foo Bar

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.39 Pulsar & Supernova Pulsar: Repeated Modifications make it grow and shrink. System Hotspot: Every System Version requires changes. Supernova: Sudden increase in size. Possible Reasons: Massive shift of functionality towards a class. Data holder class for which it is easy to grow. Sleeper: Developers knew exactly what to fill in.

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.40 White Dwarf, Red Giant, Idle White Dwarf: Lost the functionality it had and now trundles along without real meaning. Possibly dead code. Red Giant: A permanent god class which is always very large. Idle: Keeps size over several versions. Possibly dead code, possibly good code.

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.41 Example: MooseFinder (38 Versions)

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.42 RoadMap Introduction SV in a Reengineering Context Static Code Visualization  Examples Dynamic Code Visualization  Examples Lightweight Approaches  Combining Metrics and SV Understanding Evolution Conclusion

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.43 Conclusions SV is very useful when used correctly An integrated approach is needed, just having nice pictures is not enough 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

© S. Demeyer, S. Ducasse, O. Nierstrasz Visualization.44 Lessons Learned Visualization is not just smoke and mirrors!  Complexity reduction, abstraction But it should be adapted to  your goal (first contact, deep understanding),  time (2 days - a month),  size (a complete system or 3 classes) Minimize tool support if you are not familiar Simple approaches give 80%, the last 20% are hard to get