Chapter 4 Design Principles I Correctness and Robustness.

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

Making the System Operational
Chapter 6 Introduction to Design Patterns. Sample Design Goals and Ways to Accomplish Them Reusability, Flexibility, and Efficiency o Reuse flexible designs.
COMP 121 Week 9: AbstractList and ArrayList. Objectives List common operations and properties of Lists as distinct from Collections Extend the AbstractCollection.
Methods Java 5.1 A quick overview of methods
Chapter 13 – Introduction to Classes
 Both System.out and System.err are streams—a sequence of bytes.  System.out (the standard output stream) displays output  System.err (the standard.
Error Management with Design Contracts Karlstad University Computer Science Error Management with Design Contracts Eivind J. Nordby, Martin Blom, Anna.
Basic Concepts in Component-Based Software Engineering
Chapter 1 The Systems Development Environment
Introduction To System Analysis and Design
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
THE OBJECT-ORIENTED DESIGN WORKFLOW Interfaces & Subsystems.
1 Building with Assurance CSSE 490 Computer Security Mark Ardis, Rose-Hulman Institute May 10, 2004.
Design 15 February. Software Engineering: Elaborated Steps Concept (contract, intro on web site) Requirements (use cases, requirements) Architecture Design.
Overview of Software Requirements
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
20 February Detailed Design Implementation. Software Engineering Elaborated Steps Concept Requirements Architecture Design Implementation Unit test Integration.
1 Exception and Event Handling (Based on:Concepts of Programming Languages, 8 th edition, by Robert W. Sebesta, 2007)
The chapter will address the following questions:
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
The Design Discipline.
Dr. Ken Hoganson, © August 2014 Programming in R STAT8030 Programming in R COURSE NOTES 1: Hoganson Programming Languages.
Chapter 4 Design Principles I Correctness and Robustness
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture # 05: Design Principles I - Correctness and Robustness SWE 316: Software.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.
Prologue: The Software Process. Main Phases of Software Process 1. Requirements Analysis (answers “WHAT?”) Specifying what the application must do 2.
Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency.
Lecture # 06 Design Principles II
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency.
CSE 303 – Software Design and Architecture
Comp2110 Software Design lecture 13Detailed Design (1)  detailed design contrasted with high level design  introducing the Observer Design Pattern 
CS212: Object Oriented Analysis and Design Lecture 4: Objects and Classes - I.
Copyright © Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy. All rights reserved. Implementing Architectures Software Architecture.
2/6/01D-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Using PARTS to Illustrate Requirements Concepts.
Chapters 4&5 Design Principles: Correctness, Robustness, Flexibility, Reusability, and Efficiency.
SWE 619 © Paul Ammann Procedural Abstraction and Design by Contract Paul Ammann Information & Software Engineering SWE 619 Software Construction cs.gmu.edu/~pammann/
Exceptions Handling Exceptionally Sticky Problems.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
1 Introduction to Software Engineering Lecture 1.
Software Architecture. What is a SW architecture? A SW architecture consists of a set of layers Each layer is related to a central area of functionality.
Copyright 2004 Scott/Jones Publishing Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 7 Structured Data and Classes.
Chapter 1 Introduction to Databases. 1-2 Chapter Outline   Common uses of database systems   Meaning of basic terms   Database Applications  
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
Historical Aspects Origin of software engineering –NATO study group coined the term in 1967 Software crisis –Low quality, schedule delay, and cost overrun.
Object-Oriented Software Engineering using Java, Patterns &UML. Presented by: E.S. Mbokane Department of System Development Faculty of ICT Tshwane University.
CS 772: Global Knowledge Networks V. “Juggy” Jagannathan CSEE, West Virginia University.
Chapter 6 Introduction to Design Patterns. Process Phase Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed.
Copyright  2002 Urbancode Software Development, Inc. All Rights Reserved. Developing with JAAS Presented by Maciej Zawadzki
Chapter 1 Programming Review and Introduction to Software Design.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 13 Creational Design Pattern SWE 316: Software Design and Architecture.
Software Design: Principles, Process, and Concepts Getting Started with Design.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Human Computer Interaction
CSE 303 – Software Design and Architecture
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Computer Science 209 Software Development Handing Errors and Creating Documentation.
The Facade Pattern (Structural) ©SoftMoore ConsultingSlide 1.
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
Chapter 7 Creational Design Pattern. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Object-Oriented Programming (OOP) and C++
Application Analysis. Application Interaction Model The purpose of analysis is to understand the problem so.
Introduction to Software Engineering 1. Software Engineering Failures – Complexity – Change 2. What is Software Engineering? – Using engineering approaches.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
The Development Process of Web Applications
Presentation transcript:

Chapter 4 Design Principles I Correctness and Robustness

Ch 4 – Design Principles I o Correctness o Robustness o Design Details: How Much is Enough

4.1 Correctness

Key Concept:  Correctness  Goal: That each artifact satisfies designated requirements, and that together they satisfy all of the application’s requirements. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Sufficient Designs: Terminology and Rationale A design sufficient to implement the requirements. a correct design Sometimes called … the design must be entirely understandable It follows that … the design very modular A common way to achieve this is to make … Minimum goal: Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  Correctness by Informal Methods  Simplify and modularize designs until they convince. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Introducing Interfaces 1 of 2 Shipment setVehicle() perishable() getWidth() printRoute() describeType() getLength() getDuration() setType() Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Introducing Interfaces 2 of 2 Shipment setVehicle() perishable() getWidth() printRoute() describeType() getLength() getDuration() setType() Shipment Dimensions getWidth() getLength() getWeight() TransportationMeans getDuration() setVehicle() printRoute() GoodsType describeType() setType() perishable() Shipment Dimensions TransportationMeans GoodsType Original form Forms using interfaces Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Package Interfaces Pricing purchases Furniture Clothing Appliance Selection ClothingTryout «singleton» PurchasesIF Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Participant- services Conversation- services Example of Package Interfaces Conversation chatServer chatClient Display ConversationManager ClientComm ServerComm billing AccountingBill Financial Message- reception Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  Interfaces  -- collections of function prototypes: Make designs more understandable. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Domain vs. Non-Domain Classes o Domain classes : Particular to the application o Examples: BankCustomer, BankTransaction, Teller o Typically not GUI classes o Sufficient to classify all requirements (see chapter xx) o Non-Domain (i.e., design) classes : Generic o Examples: abstract classes, utility classes o Arise from design and implementation considerations Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Alternative Modularizations mechanics position ground control onBoardNavigation control trajectory weather Application tracking trajectory of rocket carrying orbit-bound satellite into position Alternative 1 Alternative 2 Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

4.2 Robustness

1.Protection from faulty Input o User input o Input, not from user Data communication Function calls made by other applications 2. Protection from developer error o Faulty design o Faulty implementation Improving Robustness: Sources of Errors Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Example: int computeArea( int aLength, int aBreadth ) { … }  Capture parameter constraints in classes if feasible int computeArea( RectangleDimension aRectangleDimension )  Specify all parameter constraints in method comments aLength > 0 and aBreadth > 0 and aLength >= aBreadth  Callers obey explicit requirements on parameters o Problem is method programmers have no control over callers  Check constraints first within the method code if( aLength <= 0 ) …… o Throw exception if this is a predictable occurrence o Otherwise abort if possible o Otherwise return default if it makes sense in context o And generate warning or log to a file Constraints on Parameters Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  Robustness  -- is promoted by verifying data values before using them. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Wrapping Parameters Replace int computeArea( int aLength, int aBreadth ) {..} with int computeArea( Rectangle aRectangle ) {..} -- where class Rectangle { … Rectangle( int aLength, int aBreadth ) { if( aLength > 0 ) this.length = aLength; else ….. } … } Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  Robustness  -- is promoted by enforcing intentions. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

4.3 Design Details: How Much is Enough

How Much Design Detail Before Initial Coding? 0% Recommen- ded % of design detail before starting to code Very simpleVery complex Inexperienced designer Experienced designer 100% Type of application Diminishing ability of designer to envisage consequences of design decision. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Summary of This Chapter  Correctness of a Design or Code o Supports the requirements o In general, many correct designs exist  Robustness of a Design or Code o Absorbs errors o -- of the user o -- of developers Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.