THE SOFTWARE DESIGN PROCESS CSCE 315 – Programming Studio Spring 2010.

Slides:



Advertisements
Similar presentations
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
Advertisements

Software Engineering Key design concepts Design heuristics Design practices.
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Structured Design. 2 Design Quality – Simplicity “There are two ways of constructing a software design: One is to make it so simple that there are obviously.
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
Object-Oriented Software Development CS 3331 Fall 2009.
By Justin Hendrix. Design Challenges Design is the activity that links requirements to coding and debugging. Good design is useful on small project and.
Design Concepts and Principles
Chapter 13 Design Concepts and Principles
High Quality Code Why it matters. By Ryan Ruzich.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
Object-Oriented Analysis and Design
Software Engineering and Design Principles Chapter 1.
Object-Oriented Metrics. Characteristics of OO ● Localization ● Encapsulation ● Information hiding ● Inheritence ● Object abstraction.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Object-Oriented Metrics
Chapter 1 Principles of Programming and Software Engineering.
The Software Design Process CPSC 315 – Programming Studio Fall 2009.
Chapter 10 Class and Method Design
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering CSE470: Systems Engineering 35 Computer System Engineering Computer System Engineering is a problem-solving activity. Itemize desired.
1 Working with Classes Chapter 6. 2 Class definition A class is a collection of data and routines that share a well-defined responsibility or provide.
Computer Science 240 Principles of Software Design.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
The Design Discipline.
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
Chapter 5CSA 217 Design in Construction Chapter 5 1.
Introduction to Object-oriented programming and software development Lecture 1.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
CSE 303 – Software Design and Architecture
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
SE: CHAPTER 7 Writing The Program
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Design Concepts and Principles Instructor: Dr. Jerry Gao.
1 Software Development Software Engineering is the study of the techniques and theory that support the development of high-quality software The focus is.
CSE 403, Spring 2008, Alverson Software Design “There are two ways of constructing a software design: one way is to make it so simple that there are obviously.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Introduction to Design. What is Design? 2 minutes Pairs.
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.
1-1 Software Development Objectives: Discuss the goals of software development Identify various aspects of software quality Examine two development life.
Dr D. Greer, Queens University Belfast )Chapter Six 1 Software Engineering Chapter Six Software Design Quality Learning Outcomes.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
CS 350 – Software Design Expanding Our Horizons – Chapter 8 The traditional view of objects is that they are data with methods. Sometimes objects could.
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
High Quality Code – Style Matters  Design in Construction  Layout and Style Software Construction by Jeff Nogy.
Object-Oriented Design Concepts University of Sunderland.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Chapter 2 Principles of Programming and Software Engineering.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
1 Object-Oriented Programming Using C++ CLASS 17 Honors.
Design in Construction
Chapter 1: Software design
Algorithms and Problem Solving
Object-Oriented Programming Concepts
Data Abstraction: The Walls
Principles of Programming and Software Engineering
TIM 58 Chapter 8: Class and Method Design
The Software Design Process
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Algorithms and Problem Solving
Object-Oriented PHP (1)
Presentation transcript:

THE SOFTWARE DESIGN PROCESS CSCE 315 – Programming Studio Spring 2010

Design when?  Software design ~ activity that turns requirements to a plan or an outline of code  When software design takes place varies (size, required quality, e.g., affect). Two opposite ends: 1. Full detailed spec before anything programmed 2. Design takes place during construction (at the keyboard)  Usually a mix  More often than not, some design in front of a keyboard

Outline  Challenges in Design  Design Concepts  Heuristics  Practices

Challenges in Design  Design is a “wicked” problem [Rittel, Webber 73]  A problem that can only be (clearly) defined by solving it  Only after “solving” it do you understand what the needs actually are  e.g. Tacoma Narrows bridge  “Plan to throw one away”  Problem of this class  Design problems are not “wicked”

Challenges in Design  Process is Sloppy  Mistakes  Wrong, dead-end paths  Stop when “good enough”  It is not a bad thing that design is a sloppy activity  Cheap to correct errors when nothing built yet  Tradeoffs and Priorities  Goodness of a design dependent on priorities Fast develoment time? Scalable? High-performance? Adaptable Designer’s task to strike the right balance  Priorities can change

Challenges in Design  Restrictions are necessary  Constraints improve the result  Force simplifications and generalizations  Nondeterministic process  Not one “right” solution  A Heuristic process  Rules of thumb vs. fixed process  Emergent  Evolve and improve during design, coding

Brooks: Accidental vs. Essential Difficulties  Accidental difficulties have been and are addressed  Better languages, better IDEs, better debuggers, etc.  Essential difficulties unavoidable  Even with a perfect programming language, software must precisely model parts of real world. This is inherently complex.

Primary goal of software design Managing Complexity

 All other goals secondary  Goal of minimizing complexity suggests two goals 1. Minimize the amount of complexity that a human (programmer) must deal with at any one point of time 2. Minimize accidental complexity

Levels of Design  Software system as a whole  Division into subsystems/packages  Classes within packages  Data and routines within classes  Internal routine design  Work at one level can affect those below and above.  Design can be iterated at each level

Key Design Concepts  Most Important: Manage Complexity  Software already involves conceptual hierarchies, abstraction  Goal: minimize how much of a program you have to think about at once  Should completely understand the impact of code changes in one area on other areas

Good Design Characteristics  Minimal complexity Favor “simple” over “clever”

Good Design Characteristics  Minimal complexity  Ease of maintenance Imagine what maintainer of code will want to know Be self-explanatory

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling Keep connections between parts of programs minimized Avoid n 2 interactions! Abstraction, encapsulation, information hiding

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility Should be able to add to one part of system without affecting others

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility  Reusability Design so code could be “lifted” into a different system Good design, even if never reused It should be pointed out that the preparation of a library sub-routine requires a considerable amount of work. This is much greater than the effort merely required to code the sub-routine in its simplest possible form. [Whe52]

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility  Reusability  High fan-in For a given class, have it used by many others Indicates reuse effective

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility  Reusability  High fan-in  Low-to-medium fan-out Do not use too many other classes Complexity management

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility  Reusability  High fan-in  Low-to-medium fan-out  Portability Consider what will happen if moved to another environment

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility  Reusability  High fan-in  Low-to-medium fan-out  Portability  Leanness Don’t add extra parts Extra code will need to be tested, reviewed in future changes

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility  Reusability  High fan-in  Low-to-medium fan-out  Portability  Leanness  Stratification Design so that you don’t have to consider beyond the current layer

Good Design Characteristics  Minimal complexity  Ease of maintenance  Loose coupling  Extensibility  Reusability  High fan-in  Low-to-medium fan-out  Portability  Leanness  Stratification  Standard Techniques Use of common approaches make it easier to follow code later Avoid unneeded exotic approaches

Design Heuristics  Rules-of-thumb  “Trials in Trial-and-Error”  Understand the Problem  Devise a Plan  Carry Out the Plan  Look Back and Iterate

Find Real-World Objects  Standard Object-Oriented approach  Identify objects and their attributes  Determine what can be done to each object  Determine what each object is allowed to do to other objects  Determine the parts of each object that will be visible to other objects (public/private)  Define each object’s public interface

Form Consistent Abstractions  View concepts in the aggregate  “Car” rather than “engine, body, wheels, etc.”  Identify common attributes  Form base class  Focus on interface rather than implementation  Form abstractions at all levels  Car, Engine, Piston

Inheritance  Inherit when helpful  When there are common features

Information Hiding  Interface should reveal little about inner workings  Example: Assign ID numbers Assignment algorithm could be hidden ID number could be typed  Encapsulate Implementation Details  Do not set interface based on what is easiest to use  Tends to expose too much of interior  Think about “What needs to be hidden”

More on Information Hiding  Two main advantages  Easier to comprehend complexity  Localized effects allow local changes  Issues:  Circular dependencies A->B->A  Global data (or too-large classes)  Performance penalties Valid, but less important, at least at first

Identify Areas Likely to Change  Anticipate Change  Identify items that seem likely to change  Separate these items into their own class  Limit connections to that class, or create interface that’s unlikely to change  Examples of main potential problems: Business Rules, Hardware Dependencies, Input/Output, Nonstandard language features, status variables, difficult design/coding areas

Keep Coupling Loose  Relations to other classes/routines  Small Size  Fewer parameters, methods  Visible  Avoid interactions via global variables  Flexible  Do not add unnecessary dependencies  e.g. using method that is not unique to the class it belongs to

Kinds of Coupling  Data-parameter (good)  Data passed through parameter lists  Primitive data types  Simple-object (good)  Module instantiates that object  Object-parameter (so-so)  Object 1 requires Object 2 to pass an Object 3  Semantic (bad)  One object makes use of semantic information about the inner workings of another

Examples of Semantic Coupling  Module 1 passes control flag to Module 2  Can be OK if control flag is typed  Module 2 uses global data that Module 1 modifies  Module 2 relies on knowledge that Module 1 calls initialize internally, so it doesn’t call it  Module 1 passes Object to Module 2, but only initializes the parts of Object it knows Module 2 needs  Module 1 passes a Base Object, but Module 2 knows it is actually a Derived Object, so it typecasts and calls methods unique to the derived object

Design Patterns  Design Patterns, by “Gang of Four” (Gamma, Helm, Johnson, Vlissides)  Common software problems and solutions that fall into patterns  Provide ready-made abstractions  Provide design alternatives  Streamline communication among designers

More on Design Patterns  Given common names  e.g. “Bridge” – builds an interface and an implementation in such a way that either can vary without the other varying  Could go into much more on this

Other Heuristics  Strong Cohesion  All routines support the main purpose  Build Hierarchies  Manage complexity by pushing details away  Formalize Class Contracts  Clearly specify what is needed/provided  Assign Responsibilities  Ask what each object should be responsible for

More Heuristics  Design for Test  Consider how you will test it from the start  Avoid Failure  Think of ways it could fail  Choose Binding Time Consciously  When should you set values to variables  Make Central Points of Control  Fewer places to look -> easier changes

More Heuristics  Consider Using Brute Force  Especially for early iteration  Working is better than non-working  Draw Diagrams  Keep Design Modular  Black Boxes

Design Practices (we may return to these)  Iterate – Select the best of several attempts  Decompose in several different ways  Top Down vs. Bottom Up  Prototype  Collaborate: Have others review your design either formally or informally  Design until implementation seems obvious  Balance between “Too Much” and “Not Enough”  Capture Design Work  Design documents