Software Engineering Lecture 3 Designing and Visualizing Software

  • Slides: 43
Download presentation
Software Engineering Lecture 3 – Designing and Visualizing Software Architecture Slides inspired by Richard

Software Engineering Lecture 3 – Designing and Visualizing Software Architecture Slides inspired by Richard Taylor, University of California

Last time • The context of Architecture – How it fits into the Software

Last time • The context of Architecture – How it fits into the Software Development Lifecycle 2

 • How do you communicate code/design? 3

• How do you communicate code/design? 3

Objectives • Concepts – What is visualization? – Differences between modeling and visualization –

Objectives • Concepts – What is visualization? – Differences between modeling and visualization – What kinds of visualizations do we use? – Visualizations and views – How can we characterize and evaluate visualizations? • Constructing visualizations – Guidelines for constructing new visualizations – Pitfalls to avoid when constructing new visualizations – Coordinating visualizations 4

Objectives • Concepts – What is visualization? – Differences between modeling and visualization –

Objectives • Concepts – What is visualization? – Differences between modeling and visualization – What kinds of visualizations do we use? – Visualizations and views – How can we characterize and evaluate visualizations? • Constructing visualizations – Guidelines for constructing new visualizations – Pitfalls to avoid when constructing new visualizations – Coordinating visualizations 5

Models vs. Visualizations • Models and visualizations are very closely related • A model

Models vs. Visualizations • Models and visualizations are very closely related • A model is just abstract information – a set of design decisions • Visualizations give those design decisions form: – they let us depict those design decisions and interact with them in different ways – Because of the interaction aspect, visualizations are often active – they are both pictures AND tools 7

Models vs. Visualizations <? xml version=“ 1. 0”> <model> <decision num=“ 1”…/> <decision num=“

Models vs. Visualizations <? xml version=“ 1. 0”> <model> <decision num=“ 1”…/> <decision num=“ 2”…/> </model> XML-based visualization DD DD C 1 Model DD Our first decision is that the system will have two components, C 1 and C 2. . . DD DD C 2 Box-and-arrow visualization Natural language visualization 8

Visualizations • Some notations are textual – Natural language, XML-based ADLs • …or graphical

Visualizations • Some notations are textual – Natural language, XML-based ADLs • …or graphical – Power. Point-style • …or a little of both – UML 9

Different Relationships Viz Model One visualization (common) Viz Model Viz Many visualizations for one

Different Relationships Viz Model One visualization (common) Viz Model Viz Many visualizations for one model (common) Model One visualization bringing together many models (uncommon) 10

Kinds of Visualizations: Textual Visualizations – Generally conform to some syntactic format, like programs

Kinds of Visualizations: Textual Visualizations – Generally conform to some syntactic format, like programs conform to a language – Decorative options • Fonts, colors, bold/italics • Tables, bulleted lists/outlines 11

Textual Visualizations <instance: x. Arch xsi: type=”instance: XArch”> <types: arch. Structure xsi: type=”types: Arch.

Textual Visualizations <instance: x. Arch xsi: type=”instance: XArch”> <types: arch. Structure xsi: type=”types: Arch. Structure” types: id=”Client. Arch”> <types: description xsi: type=”instance: Description”> Client Architecture </types: description> <types: component xsi: type=”types: Component” types: id=”Web. Browser”> <types: description xsi: type=”instance: Description”> Web Browser </types: description> <types: interface xsi: type=”types: Interface” types: id=”Web. Browser. Interface”> <types: description xsi: type=”instance: Description”> Web Browser Interface </types: description> <types: direction xsi: type=”instance: Direction”> inout </types: direction> </types: interface> </types: component> </types: arch. Structure> </instance: x. Arch> XML visualization 12 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Textual Visualizations (cont’d) <instance: x. Arch xsi: type=”instance: XArch”> XML visualization <types: arch. Structure

Textual Visualizations (cont’d) <instance: x. Arch xsi: type=”instance: XArch”> XML visualization <types: arch. Structure xsi: type=”types: Arch. Structure” types: id=”Client. Arch”> <types: description xsi: type=”instance: Description”> Client Architecture </types: description> <types: component xsi: type=”types: Component” types: id=”Web. Browser”> <types: description xsi: type=”instance: Description”> Web Browser x. Arch{ </types: description> arch. Structure{ <types: interface xsi: type=”types: Interface” id = “Client. Arch” types: id=”Web. Browser. Interface”> description = “Client Architecture” <types: description xsi: type=”instance: Description”> component{ Web Browser Interface id = “Web. Browser” </types: description> description = “Web Browser” <types: direction xsi: type=”instance: Direction”> interface{ inout id = “Web. Browser. Interface” </types: direction> description = “Web Browser Interface” </types: interface> direction = “inout” </types: component> } </types: arch. Structure> } </instance: x. Arch> } } Compact visualization 13 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Textual Visualizations: Interaction • Generally through an ordinary text editor or word processor •

Textual Visualizations: Interaction • Generally through an ordinary text editor or word processor • Some advanced mechanisms available – – Syntax highlighting Static checking Autocomplete Structural folding 14

Textual Visualizations • Advantages – – Depict entire architecture in a single file Good

Textual Visualizations • Advantages – – Depict entire architecture in a single file Good for linear or hierarchical structures Hundreds of available editors Substantial tool support if syntax is rigorous • Disadvantages – – Can be overwhelming Bad for graphlike organizations of information Difficult to reorganize information meaningfully Learning curve for syntax/semantics 15

Kinds of Visualizations: Graphical Visualizations • Depict architectures (primarily) as graphical symbols – –

Kinds of Visualizations: Graphical Visualizations • Depict architectures (primarily) as graphical symbols – – – Boxes, shapes, pictures, clip-art Lines, arrows, other connectors Photographic images Regions, shading 2 D or 3 D • Generally conform to a symbolic syntax – But may also be ‘free-form’ and stylistic 16

Graphical Visualizations Abstract, stylized visualization 17 Software Architecture: Foundations, Theory, and Practice ; Richard

Graphical Visualizations Abstract, stylized visualization 17 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Graphical Visualizations Abstract, stylized visualization More rigorous deployment visualization 18 Software Architecture: Foundations, Theory,

Graphical Visualizations Abstract, stylized visualization More rigorous deployment visualization 18 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Graphical Visualizations: Interaction • Generally graphical editors with point-and-click interfaces – Employ metaphors like

Graphical Visualizations: Interaction • Generally graphical editors with point-and-click interfaces – Employ metaphors like scrolling, zooming, ‘drill-down’ • Editors come with various support for notations • More exotic editors and interaction mechanisms exist in research – 3 D editors – “Sketching-based” editors 19

Graphical Visualizations • Advantages – Symbols, colors, and visual decorations more easily parsed by

Graphical Visualizations • Advantages – Symbols, colors, and visual decorations more easily parsed by humans than structured text – Handle non-hierarchical relationships well – Diverse spatial interaction metaphors (scrolling, zooming) allow intuitive navigation • Disadvantages – Cost of building and maintaining tool support • Difficult to incorporate new semantics into existing tools – Do not scale as well as text to very large models 20

Hybrid Visualizations • Few graphical notations are purely symbolic – Text labels, at a

Hybrid Visualizations • Few graphical notations are purely symbolic – Text labels, at a minimum – Annotations are generally textual as well 21

Hybrid Visualizations (cont’d) Primarily graphical UML class diagram 22 Software Architecture: Foundations, Theory, and

Hybrid Visualizations (cont’d) Primarily graphical UML class diagram 22 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John Wiley & Sons, Inc. Reprinted with permission.

Evaluating Visualizations • Scope and Purpose – What is the visualization for? What can

Evaluating Visualizations • Scope and Purpose – What is the visualization for? What can it visualize? • Basic Type • Depiction • Interaction 24

Evaluating Visualizations (cont’d) • Fidelity – How well/completely does the visualization reflect the information

Evaluating Visualizations (cont’d) • Fidelity – How well/completely does the visualization reflect the information in the underlying model? – Consistency should be a minimum requirement, but details are often left out • Consistency – How well does the visualization use similar representations for similar concepts? • Comprehensibility – How easy is it for stakeholders to understand use a visualization • Note: this is a function of both the visualization and the stakeholders 25

Evaluating Visualizations (cont’d) • Dynamism – How well does the visualization support models that

Evaluating Visualizations (cont’d) • Dynamism – How well does the visualization support models that change over time (dynamic models)? • View Coordination – How well the visualization is connected to and kept consistent with other visualizations • Aesthetics – How pleasing is the visualization (look and feel) to its users? • A very subjective judgment • Extensibility – How easy is it to add new capabilities to a visualization? 26

Automatically generated? • Code Sonar • Google Codepro Analyti. X - Webpage 29

Automatically generated? • Code Sonar • Google Codepro Analyti. X - Webpage 29

Objectives • Concepts – What is visualization? – Differences between modeling and visualization –

Objectives • Concepts – What is visualization? – Differences between modeling and visualization – What kinds of visualizations do we use? – Visualizations and views – How can we characterize and evaluate visualizations? • Constructing visualizations – Guidelines for constructing new visualizations – Pitfalls to avoid when constructing new visualizations – Coordinating visualizations 30

Constructing New Visualizations • Must answer many questions in advance – Can I achieve

Constructing New Visualizations • Must answer many questions in advance – Can I achieve my goals by extending an existing visualization? – Can I translate into another notation and use a visualization already available there? – How will my visualization augment the existing set of visualizations for this notation? – How will my visualization coordinate with other visualizations? 31

New Visualizations: Guidelines • Borrow elements from similar visualizations – Leverages existing stakeholder knowledge

New Visualizations: Guidelines • Borrow elements from similar visualizations – Leverages existing stakeholder knowledge – Improves comprehensibility • Be consistent among visualizations – Don’t conflict with existing visualizations without a good reason (e. g. , developing a domain-specific visualization where the concepts and metaphors are completely different) • Give meaning to each visual aspect of elements 32

New Visualizations: Guidelines (cont’d) • Document the meaning of visualizations – Visualizations are rarely

New Visualizations: Guidelines (cont’d) • Document the meaning of visualizations – Visualizations are rarely self-explanatory – Focus on mapping between model and visualization • Balance traditional and innovative interfaces – Stakeholders bring a lot of interaction experience to the table – But just because a mechanism is popular doesn’t mean it’s ideal 33

Common symbols 34

Common symbols 34

35

35

36

36

New Visualizations: Anti. Guidelines • Same Symbol, Different Meaning 37 Software Architecture: Foundations, Theory,

New Visualizations: Anti. Guidelines • Same Symbol, Different Meaning 37 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.

New Visualizations: Anti. Guidelines (cont’d) • Differences without meaning 38 Software Architecture: Foundations, Theory,

New Visualizations: Anti. Guidelines (cont’d) • Differences without meaning 38 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.

New Visualizations: Anti. Guidelines (cont’d) • Decorations without meaning 39 Software Architecture: Foundations, Theory,

New Visualizations: Anti. Guidelines (cont’d) • Decorations without meaning 39 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.

New Visualizations: Anti. Guidelines (cont’d) • Borrowed symbol, different meaning 40 Software Architecture: Foundations,

New Visualizations: Anti. Guidelines (cont’d) • Borrowed symbol, different meaning 40 Software Architecture: Foundations, Theory, and Practice ; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; (C) 2008 John Wiley & Sons, Inc. Reprinted with permission.

Coordinating Multiple Visualizations • How do we keep multiple simultaneous visualizations of the same

Coordinating Multiple Visualizations • How do we keep multiple simultaneous visualizations of the same (part of the) architectural model consistent with each other and the model? 41

DESIGN RECONSTRUCTION 42

DESIGN RECONSTRUCTION 42

Architecture Reconstruction Process • Raw view extraction – Source code, execution traces, build scripts,

Architecture Reconstruction Process • Raw view extraction – Source code, execution traces, build scripts, etc. • Database construction • View fusion and manipulation – Observe data relationships etc. from database – Create a fused view to illustrate how data fit together • Architecture analysis – Conformance 43

Architecture Reconstruction Process 44

Architecture Reconstruction Process 44

Discussion • How do you analyze design? • What do you look for to

Discussion • How do you analyze design? • What do you look for to – Understand structure? – Understand what is going on? – Understand where to add code? 45

How to identify design IMHO • Two alternatives – Top down (Overall Modules Classes

How to identify design IMHO • Two alternatives – Top down (Overall Modules Classes Code) – Follow the execution path • What launches the application • What happens next? • Pick a specific operation (use-case) and follow the execution path for that operation (e. g. logging in or load a document) 46

Summary • Choose the right tool for visualizing design – – Shareability Contributability Flexibility

Summary • Choose the right tool for visualizing design – – Shareability Contributability Flexibility Expressability 51