Topic 9Summer 2003 1 ICS 52: Introduction to Software Engineering Lecture Notes for Summer Quarter, 2003 Michele Rousseau Topic 9 Partially based on lecture.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Design Concepts and Principles
Visual Basic: An Object Oriented Approach 2 – Designing Software Systems.
Introduction to Software Engineering Lecture 5 André van der Hoek.
Ch 12: Object-Oriented Analysis
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Introduction To System Analysis and Design
Introduction to Software Engineering Lecture 7 André van der Hoek.
Introduction to Software Engineering Lecture 6 André van der Hoek.
Illinois Institute of Technology
CS 425/625 Software Engineering Software Testing
Midterm ReviewSummer ICS 52: Introduction to Software Engineering Lecture Notes for Summer Quarter, 2003 Michele Rousseau Midterm Review Partially.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
The chapter will address the following questions:
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 11 Slide 1 Architectural Design.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
System Design Chapter 8. Objectives  Understand the verification and validation of the analysis models.  Understand the transition from analysis to.
Introduction To System Analysis and design
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
The Design Discipline.
Chapter 5CSA 217 Design in Construction Chapter 5 1.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Integration testing l Tests complete systems or subsystems composed of integrated.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
ICS 52: Introduction to Software Engineering Lecture Notes for Summer Quarter, 2003 Michele Rousseau Topic 3 Partially based on lecture notes written by.
CS 360 Lecture 3.  The software process is a structured set of activities required to develop a software system.  Fundamental Assumption:  Good software.
OHTO -99 SOFTWARE ENGINEERING LECTURE 5 Today: - An overview to OO Analysis and OO Design - Introduction of Assignment 2.
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 07. Review Architectural Representation – Using UML – Using ADL.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
High-Level Design With Sequence Diagrams COMP314 (based on original slides by Mark Hall)
Introduction To System Analysis and Design
SOFTWARE DESIGN.
Software Life Cycle Requirements and problem analysis. –What exactly is this system supposed to do? Design –How will the system solve the problem? Coding.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Software Engineering Principles Principles form the basis of methods, techniques, methodologies and tools Principles form the basis of methods, techniques,
Approaching a Problem Where do we start? How do we proceed?
SE: CHAPTER 7 Writing The Program
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
Systems Analysis and Design in a Changing World, 3rd Edition
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 05. Review Software design methods Design Paradigms Typical Design Trade-offs.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
1 Examining Execution Sequences Introducing Sequence Diagrams.
1 CMPT 275 High Level Design Phase Modularization.
Software Design Process
Lecture 18: Object-Oriented Design
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
CSC 480 Software Engineering Test Planning. Test Cases and Test Plans A test case is an explicit set of instructions designed to detect a particular class.
Software Engineering Issues Software Engineering Concepts System Specifications Procedural Design Object-Oriented Design System Testing.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Modern Systems Analysis and Design Third Edition Chapter 2 Succeeding as a Systems Analyst 2.1.
CSC 480 Software Engineering PSP Project 2 August 27, 2004.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Design CS 470 – Software Engineering I Sheldon X. Liang, PH.D.
18/2/16.  Aggregation  Part-of relationship between a component or an aggregate (collection) object)
GRASP – Designing Objects with Responsibilities
Chapter ? Quality Assessment
Conception OBJET GRASP Patterns
Lecture 9- Design Concepts and Principles
About the Presentations
Lecture 9- Design Concepts and Principles
Presentation transcript:

Topic 9Summer ICS 52: Introduction to Software Engineering Lecture Notes for Summer Quarter, 2003 Michele Rousseau Topic 9 Partially based on lecture notes written by Sommerville, Frost, & Easterbrook. Duplication of course material for any commercial purpose without the written permission of the lecturers is prohibited

Topic 9Summer Today’s Lecture l A brief introduction to Classes & Objects

Topic 9Summer Noun extraction for design Complements design by information hiding

Topic 9Summer Remember this? Invoice Processing System – Object Model This system can: Issue invoices to customers Receive payments Issue receipts for payments Issue reminders for unpaid invoices The dashed line means that one object uses the attributes or services of another object

Topic 9Summer Choosing classes & objects l At the conceptual level: an object is a set of responsibilities, including responsibility for itself (encapsulates functions and data) l At the specification level: an object is a set of methods (its interface), which can be invoked by itself or other objects l At the implementation level: an object is code (methods) and data (attributes) Object Oriented approach attempts to manage complexity in real-world problems

Topic 9Summer Objects l Have Public and Private sides l OOD –views the world as a system of cooperating collaboration agents.

Topic 9Summer Some Terminology l Encapsulation – bundling operations and data that are conceptually linked (like putting them in a capsule) l Information Hiding – Making the capsule opaque l Method – an action l Attribute – a variable/constant l Object – primitive programming element l Class – a generic specification for an arbitrary number of similar objects – (abstract, template)

Topic 9Summer An OOD Process l Find the classes in your system l Determine operations for each class l Determine how objects will need to collaborate with each other

Topic 9Summer Hints for Choosing Classes l How do I find classes, attributes and so on? Look at the requirements »classes often correspond to nouns »attributes often correspond to abstract nouns »operations often correspond to verbs

Topic 9Summer Determining Classes l Model physical objects (employees, invoices, printers, etc..) l If more than 1 word is used for the same concept choose the one that is most meaningful. l Be wary of adjectives – does it describe new behavior? l Model known interfaces l Model the values of attributes – but don’t model attributes e.g. Line and length – class or attribute

Topic 9Summer A class should... l represent a coherent concept Principle: Low Coupling, High Cohesion l have a small, well-defined set of responsibilities l be named with a singular noun that says what each each instance of the class is l have no more than operations

Topic 9Summer An Example FastData Inc. wants a subsystem to process office supply orders via the Web. The user will supply via a form their name, password, account number, and a list of supplies along with an indication of the quantities desired. The subsystem will validate the input, enter the order into a database, and generate a receipt with the order number, expected ship date, and the total cost of the order. If the validation step fails, the subsystem will generate an error message describing the cause of the failure

Topic 9Summer You may need to rewrite Make it concise. l “FastData, Inc. employees may order office supplies via the Internal Web and receive a receipt confirming the order. The order must include the user name, user password, account number, and the list of supplies. A receipt must be generated containing an order number, ship date, and total cost. If the order is valid, it must be entered into an order database. If the order is invalid, an error message must be generated.”

Topic 9Summer Formalize the Strategy l Identify the nouns of the description, which serve as the basis for identifying the subsystem’s classes. l Look for out-of-domain nouns (and throw them out!) l Look for abstract nouns (use these for attributes) l The remaining nouns are good candidates for classes!

Topic 9Summer Find the nouns l “FastData, Inc. employees may order office supplies via the Internal Web and receive a receipt confirming the order. The order must include the user name, user password, account number, and the list of supplies. A receipt must be generated containing an order number, ship date, and total cost. If the order is valid, it must be entered into an order database. If the order is invalid, an error message must be generated.”

Topic 9Summer Nouns –Employees –Office Supplies  Item –Internal Web –Receipt –Order –User name –User password – Account number – Order number – Ship date – Total cost – Order database – Error message – List of supplies

Topic 9Summer Nouns l Out-of-Domain Internal Web l Abstract user name user password account number order number ship date total cost list of supplies l Good Candidates employee item (was office supplies) receipt order order database error message l Notes We have decided not to worry about the Web in this design. Instead we focus on the inputs and outputs and defer the Web details until later.

Topic 9Summer Basic Classes Employee Name Password Account # Order Number Employee Item Error Message Item Order Ship Date Total cost Receipt Order Order Database l This gives us a starting place to refine and revise

Topic 9Summer Assigning Responsibilities l Responsibilities include 2 key items The knowledge an object maintains The actions an object can perform l An object is a client when it requests services from another object. l An object is a server when it fulfills a request from another object. l Where to look – Requirements Classes

Topic 9Summer Identifying Responsibilities l Look for the verbs Which ones clearly represent actions that some object must perform Note where information is mentioned »Information an object must maintain and manipulate l Look at they system as a whole (walkthrough) l Look at the classes

Topic 9Summer Assigning Responsibilities l Try to evenly distribute system intelligence l State responsibilities as generally as possible l Keep behavior with related information l Keep information about 1 thing in 1 place l Share responsibilities among related objects

Topic 9Summer What Operations go with which Class? Employee Name Password Account # Order Number Employee Item SendReceipt() SendErrorMsg() AddItem() Error Message Item Order Ship Date Total cost Receipt Order Order Database

Topic 9Summer Final Notes l Refine, Revise l Define relationships

Topic 9Summer Design Recap

Topic 9Summer Important concepts l Architectural styles l Information hiding l Noun extraction l Uses diagram l Comprises diagram

Topic 9Summer How do we decide if a design is the best possible design? l Ability to predict comes with experience l Qualities to look for: Verifiability, Maintainability, Repairability, Evolvability, Reusability, Portability, Understandability, Interoperability l Principles to maintain: Rigor & formality, Separation of concerns, Modularity, Abstraction, Anticipation of change, Generality

Topic 9Summer What is a Good Class? l …and what should not be a class? l A class should be named with a noun Example: “class Book” l A class should not represent a task or operation Don’t do this: “class FindABook” Don’t have classes described as “performing” something l A class should contain several related operations These correspond to the class’ responsibilities l A class should contain at least one attribute l A class should represent a single abstraction

Topic 9Summer Is fan-in, fan-out relevant? l Yes, but it’s not as important as other indications of a good design l High cohesion and low coupling are the most important l For smaller systems, the uses diagram is the next most important l For larger systems, the comprises diagram is also important

Topic 9Summer How does high level architecture affect module interaction? l Architectural styles restrict the way in which components can be connected Prescribe patterns of interaction Promote fundamental principles »Rigor, Separation of concerns, Modularity, Abstraction, Anticipation of change, Generality, Incrementality »Low coupling, High cohesion

Topic 9Summer Do we have to code up the modules? l Yes, but later.

Topic 9Summer Why do we define levels in the uses diagram? l The process of doing so helps identify cycles (which are usually bad) l The levels are used in making an integration test plan

Topic 9Summer How many levels should we have in a uses diagram? l It depends. l Small systems may only have 2 or 3 l Larger systems may have many more, or they may remain fairly “shallow”

Topic 9Summer Acceptance testing? l Acceptance testing is performed after implementation and integration testing is complete, before the product is given to the client l Acceptance test plans are made during the requirements phase l The acceptance test plan includes a high-level description of what is being tested, and specific test inputs, along with expected outputs.

Topic 9Summer Integration testing? l Integration testing is performed after implementation and module testing, before acceptance testing l The integration test plan is made during design l The integration test plan includes a plan of the order of integration and specific test cases.

Topic 9Summer Integration Testing

Topic 9Summer V-Model of Development and Testing Develop Acceptance Tests Acceptance Test ReviewRequirements Review Develop RequirementsExecute System TestsDevelop Integration Tests Integration Tests ReviewDesign Review DesignExecute Integration TestsDevelop Unit Tests Unit Tests ReviewCode Review CodeExecute Unit Tests

Topic 9Summer Integration Test Plans l Goal (Why?) Ensure modules make compatible assumptions about each other. Exercise interfaces between modules, as opposed to functionality within modules l Hard part: Identifying interactions that reveal agreement or disagreement on assumptions l Approach (How?) Combine more and more modules Use USES hierarchy »Work up from lowest numbers  Use test harnesses to test each group of modules »Work down from highest numbers  Use stubs as mockups to test each group of modules l Test execution can be done during implementation effort

Topic 9Summer Integration Test Example Provided Interface Main component Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface

Topic 9Summer Integration Testing Tools l Extra code you write for integration testing. Needed because not all modules are ready at the same time. l Harnesses or drivers Call or invoke modules and pass parameters to them l Stubs Are called by modules, do minimal processing, return reasonable values

Topic 9Summer Test Harnesses (bottom-up integration) Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Subcomponent Required Interface Provided Interface Test Harness Required Interface Provided Interface Test Harness Required Interface

Topic 9Summer Stubs (top-down integration) Provided Interface Main component Required Interface Provided Interface Stub Required Interface Provided Interface Stub Required Interface Provided Interface Stub Required Interface

Topic 9Summer Stubs Provided Interface Main component Required Interface Provided Interface Stub Required Interface Provided Interface Stub Required Interface Provided Interface Subcomponent Required Interface Provided Interface Stub Required Interface Provided Interface Stub Required Interface

Topic 9Summer Stubs Provided Interface Main component Required Interface Provided Interface Subcomponent Required Interface Provided Interface Stub Required Interface Provided Interface Subcomponent Required Interface Provided Interface Stub Required Interface Provided Interface Stub Required Interface

Topic 9Summer Integration Testing Strategies l Integrate and test increasingly larger subsets of modules l Top-down integration testing Can be done before units are fully coded Requires stubs l Bottom-up integration testing Requires test harnesses or drivers Can thoroughly test lower modules but postpones detection of major integration problems l Hybrid of both most common in practice