© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 41 4 Software models Software is complex –often more than what people can handle –not.

Slides:



Advertisements
Similar presentations
Design by Contract.
Advertisements

Modeling Main issues: What do we want to build How do we write this down.
Ch 3: Unified Process CSCI 4320: Software Engineering.
Chapter 7 Structuring System Process Requirements
Modeling Main issues: What do we want to build How do we write this down ©2008 John Wiley & Sons Ltd. vliet.
Use Case Model. C-S 5462 Use case model describes what the user expects the system to do –functional requirements may describe only the functionalities.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System modeling 2.
CS 340 UML Class Diagrams. A model is an abstraction of a system, specifying the modeled system from a certain viewpoint and at a certain level of abstraction.
Review Questions The four symbols on a data flow diagram are: Rounded rectangles (processes) Squares (external agents) Open-ended boxes (data stores) Arrows.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Software Testing and Quality Assurance
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
© Copyright Eliyahu Brutman Programming Techniques Course.
Sharif University of Technology1 Design and Use-case Realization Software Engineering Laboratory Fall 2006.
Use Case Analysis – continued
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
Data flow diagrams.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
ITEC 370 Lecture 10 Design. Review Design –Why is it part of the process? –Who is the audience for design?
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CS 360 Lecture 6.  A model is a simplification of reality  We build models to better understand the system being developed.  We build models of complex.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Lab 04.
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Requirements as Usecases Capturing the REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
UML Use Case Diagramming Guidelines. What is UML? The Unified Modeling Language (UML) is a standard language for specifying, visualizing, constructing,
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
9-1 © Prentice Hall, 2007 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Design Jon Walker. More UML ● What is UML again?
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
MODEL-BASED SOFTWARE ARCHITECTURES.  Models of software are used in an increasing number of projects to handle the complexity of application domains.
Connecting with Computer Science2 Objectives Learn how software engineering is used to create applications Learn some of the different software engineering.
7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Winter 2007SEG2101 Chapter 31 Chapter 3 Requirements Specifications.
Analysis Yaodong Bi. Introduction to Analysis Purposes of Analysis – Resolve issues related to interference, concurrency, and conflicts among use cases.
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
1 SWE Introduction to Software Engineering Lecture 14 – System Modeling.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Chapter 11 Inheritance © 2008 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. Marilyn Bohl/Maria Rynn Tools for Structured and Object-Oriented.
Unified Modeling Language. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems,
System modeling and the Unified Modeling Language (UML) CS
Analysis Classes Unit 5.
Chapter 4: Business Process and Functional Modeling, continued
UML Diagrams By Daniel Damaris Novarianto S..
Main issues: • What do we want to build • How do we write this down
Chapter 11 Object-Oriented Design
Unified Modeling Language
UML Diagrams Jung Woo.
Introduction to UML Introduction to UML Shiyuan Jin September,23,2002
UML Diagrams: The Static Model Class Diagrams
Analysis models and design models
CIS 375 Bruce R. Maxim UM-Dearborn
Presentation transcript:

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Software models Software is complex –often more than what people can handle –not necessary to know all details at all times Models offer simplified view –concentrate on the important issues and omit the clutter help to deal with software complexity Different models are needed in different contexts

Roles of software models Predictive (Designs) created up-front, before implementation starts predict how the software will be like helpful for resource planning and risk assessment Extracted extracted from an existing system, by analysis of the properties of the software help answer specific questions about the software © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 42

Roles of software models (2) Prescriptive –correspond to an existing system and its code –set of rules on how to evolve the software –software engineers must guarantee that the models remain valid after they change the code –define constraints that need to be preserved during evolution © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 43

Criteria for successful software modeling Need to understand which details are essential and which are not –the important properties need to be retained by the model Models that miss important information are misleading and can lead to mistakes © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 44

5 UML (Unified Modeling Language) Readable –serves as a communication between the customer and the developer –widely used Helps comprehension of the system

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 46 UML diagrams Structure diagrams –class diagrams –component diagram –package diagram –implementation diagram Behavior diagrams –activity diagram –sequence diagram –collaboration diagram –state diagram –use case diagram Supported by tools: Rational Rose,Visio,Violet …

UML class diagrams Structural diagrams Represent the classes in the system and their relationships Can have different levels of precision and completeness Independent of the software technologies © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 47

8 Class representation 3 compartments –class name –attributes (data members) –operations (function members) Supports different levels of detail –class name only

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 49 Association Associations are lines connecting class symbols

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 410 Adornments Adornments are at the ends of paths –arrow means navigation

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 411 Generalization (inheritance) “Is-a” relationship –rectangle is a shape –ellipse is a shape

Generalization hierarchies © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 412

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 413 Composite/component “Part-of” relationship –inventory is part of a store

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 414 PoS

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 415 Activity diagram Activities are decomposed into actions

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 416 Swim lanes

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 417 Class dependency graphs (CDG) Depict classes and their dependencies Different from UML class diagrams –in small but significant details Extracted form the existing code Used during software evolution

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 418 Class responsibilities Each class in the program plays a role –assumes a certain responsibility –class Item is responsible for items sold in the store Supplier class –helps class Item to fulfill its responsibility –class Price is supplier class of Item

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 419 Clients, suppliers, dependencies Class B helps class A to fulfill its responsibilities: –B is supplier of class A –A is client of class B –there is dependency of class A on class B denoted (A,B)

Dependency examples If there is a part-of relation between classes A and B, there is also a dependency (A,B) If there is a non-polymorphic inheritance of X from Y, then (X,Y) is a dependence If there is a polymorphic inheritance between X and Y, then both (X,Y) and (Y,X) are dependencies. © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 420

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 421 Definition of CDG directed graph G = (C,D) –vertices C are classes of the program –edges D are dependencies

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 422 CDG

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 423 Supplier slice Set of all suppliers, suppliers of suppliers, … Let (C,D) be a CDG –A  C be a class –then supplier slice S(A) = {X | X = A or there is a dependency  D such that Y  S(A)}

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 424 Supplier slice of Item

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 425 Class responsibilities, cont. Local responsibility –class assumes it alone and unaided Composite responsibility –assumed by the whole supplier slice –class itself may be unable to implement everything that is expected from it –it delegates some of the responsibilities to its suppliers

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 426 Contracts Composite responsibilities are sometimes expressed by contracts –between a class and its clients –clients request something –they have to make the request within reasonable bounds they cannot request items that the store does not sell Bounds are described by the precondition Results of the action is postcondition

Examples of contracts Contract of “Average_calculator” –precondition: A non-empty list of student names and grades –postcondition: the grade point average Contract of “Checking_withdrawal” –precondition: amount to be withdrawn W, current balance in the account B, 0 ≤ W ≤ B –postcondition: the printed check, the new balance in the account. © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 427

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 428 Ariane 5 disaster Ariane is a series of rockets European space program Ariane 5 crashed after launch in 1996 Loss approximately half billion dollars Cause: software error

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 429 Ariane 5 software error Inertial Reference System (IRS) –IRS is a supplier to the rest of the software –deals with “horizontal bias” –precondition: horizontal bias must fit within 16-bit integer –IRS was used in the earlier versions of Ariane Clients of IRS in Arianne 5 violated this precondition Boooom!!!!

Ariane 5 30

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 431 Formality of contracts Contracts are described by formal logic –special assertion language Plain English –verbal description of contracts Contracts are only tacit –not recorded anywhere –all programmers must rediscover them misunderstandings and errors very common practice not recommended

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 432 CDG and UML CDG and UML class diagrams are similar Software engineers sometimes use the more popular UML class diagrams instead of CDG –they should make sure that the diagram contains all dependencies –direction of dependencies may be missing in UML, have to be filled in!