November 2005J. B. Wordsworth: J5DAMSDI1 Design and Method Specification, Design, Implementation.

Slides:



Advertisements
Similar presentations
CSE341: Programming Languages Lecture 16 Datatype-Style Programming With Lists or Structs Dan Grossman Winter 2013.
Advertisements

Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Chapter 1. The Phases of Software Development. Data Structure 2 Chapter outline  Objectives  Use Javadoc to write a method’s complete specification.
1 Design by Contract Building Reliable Software. 2 Software Correctness Correctness is a relative notion  A program is correct with respect to its specification.
Requirements and Design
Object Oriented Design An object combines data and operations on that data (object is an instance of class) data: class variables operations: methods Three.
November 2005J. B. Wordsworth: J5DAMQVT1 Design and Method Quality, Verification, and Testing.
Software Testing and Quality Assurance
Chapter 9 Describing Process Specifications and Structured Decisions
Copyright W. Howden1 Lecture 13: Programming by Contract.
Software Testing and Quality Assurance
Schema Operators. State We can use the language of schemas to describe the state of a system, and operations upon it. Different aspects of the state --
Schema Operators. State We can use the language of schemas to describe the state of a system, and operations upon it. Different aspects of the state --
The Entity-Relationship Data Model
Use Cases.
Chapter 24 - Quality Management Lecture 1 1Chapter 24 Quality management.
Chapter 7: The Object-Oriented Approach to Requirements
System Analysis Overview Document functional requirements by creating models Two concepts help identify functional requirements in the traditional approach.
This chapter is extracted from Sommerville’s slides. Text book chapter
Object Oriented Software Development
Project Analysis Course ( ) Week 2 Activities.
Managing Software Quality
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
Chapter 9 Integrity. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.9-2 Topics in this Chapter Predicates and Propositions Internal vs.
Modular Programming Chapter Value and Reference Parameters computeSumAve (x, y, sum, mean) ACTUALFORMAL xnum1(input) ynum2(input) sumsum(output)
BMAN Integrative Team Project Week 2 Professor Linda A Macaulay.
Lecture 17 March 24, 2011 Formal Methods 2 CS 315 Spring Adapted from slides provided by Jason Hallstrom and Murali Sitaraman (Clemson)
TECH Computer Science Data Abstraction and Basic Data Structures Improving efficiency by building better  Data Structure Object IN  Abstract Data Type.
Presented by: CHAN LAI SAN ( ) REBAH DAW SARREB ( ) FIDA AL-OBAISI ( ) 08 April 2008 (Tuesday 6pm – 7:30pm)
Computer Programming 2 Lab(1) I.Fatimah Alzahrani.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
Modeling and simulation of systems Model building Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Systems Analysis and Design in a Changing World, 3rd Edition
Assessing the influence on processes when evolving the software architecture By Larsson S, Wall A, Wallin P Parul Patel.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
1 15 quality goals for requirements  Justified  Correct  Complete  Consistent  Unambiguous  Feasible  Abstract  Traceable  Delimited  Interfaced.
October 2004J. B. Wordsworth J4ISDSPE1 Information Systems Development Specification.
Architectural Point Mapping for Design Traceability Naoyasu Ubayashi and Yasutaka Kamei Kyushu University, Japan March 26, 2012 FOAL 2012 (AOSD Workshop)
Ist.psu.edu School of Information Sciences and Technology IST 311 – Object-Oriented Design & Software Steven Haynes IST 311 – Class 7 17 January 2006
CSC 480 Software Engineering Design by Contract. Detail Design Road Map Begin with architectural models  Class model: domain classes  Overall state.
Week 3: Requirement Analysis & specification
Systems Analysis and Design in a Changing World, Fourth Edition
November 2003J. B. Wordsworth: J3ISDQR41 Information Systems Development Quality and Risk (4)
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
Software Requirements Specification Document (SRS)
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
Defining Classes I Part B. Information hiding & encapsulation separate how to use the class from the implementation details separate how to use the class.
Types and Programming Languages Lecture 10 Simon Gay Department of Computing Science University of Glasgow 2006/07.
Fusion Design Overview Object Interaction Graph Visibility Graph Class Descriptions Inheritance Graphs Fusion: Design The overall goal of Design is to.
The Big Picture Chapter 3.
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
The Big Picture Chapter 3. A decision problem is simply a problem for which the answer is yes or no (True or False). A decision procedure answers a decision.
Unit 1 - Introducing Abstract Data Type (ADT) Part 1.
 System Requirement Specification and System Planning.
Use Case Model.
Formal Specification of Java Interfaces
Top 10 most important gadgets.
Method Verification CS/SWE 332 Paul Ammann.
Defining Classes and Methods
Chapter 11 Describing Process Specifications and Structured Decisions
Defining Classes and Methods
SECTION 4: OO METHODOLOGIES
Software Reviews.
Software Development Process Using UML Recap
Formal Methods Lecture 16 March 22, 2011 CS 315 Spring 2011
Method Verification Paul Ammann.
Presentation transcript:

November 2005J. B. Wordsworth: J5DAMSDI1 Design and Method Specification, Design, Implementation

November 2005J. B. Wordsworth: J5DAMSDI2 Objectives Understand the process to be followed for design, implementation, and testing. Describe the inputs to and outputs from the design activity. Describe the role of the abstraction function. Write class definitions in an approved style. Plan for the implementation and testing of Java classes.

November 2005J. B. Wordsworth: J5DAMSDI3 Analysis Specification Design Implementation Test Planning Testing Begin End

November 2005J. B. Wordsworth: J5DAMSDI4 The design activity Read the specification and make sure that you understand it. Propose a design: –Plan possible designs – think forwards about their effects. –Select a design. –Invent the right diagrams and documents to record the design. –Record the chosen design in the design documents. –Verify that the design matches the specification.

November 2005J. B. Wordsworth: J5DAMSDI5 Inputs to the design activity Specification information in the FID0 functions: –Arguments (inputs) –Results (outputs) –State components changed and referred to –Constraints to be enforced –precondition and postcondition for each function Specification information in the FID0 state: –State components to be represented –Invariants to be respected –Initialisation of the state Language knowledge

November 2005J. B. Wordsworth: J5DAMSDI6 Outputs from the design activity Detailed specifications of the design classes: –Name –Attributes: names, types, constraints, initial values –Constructors: inputs, values of attributes of aresulting object –Methods: names, arguments, results, description of intended effects in various cases (Correctness argument for the design decisions) Sequence diagrams for each back end function and its variants (next lecture)

November 2005J. B. Wordsworth: J5DAMSDI7 A conceptual (class) diagram Newsagency Paper Customer 0..* Order 1 1 satisfies requires * addr: String name: String num: Int

November 2005J. B. Wordsworth: J5DAMSDI8 Some constraints Customers have unique names. Papers have unique names. The num in Paper is the number of Order objects linked to it.

November 2005J. B. Wordsworth: J5DAMSDI9 A specification fragment CustomerName, Address, PaperName : Base_Type Customer : tuple_of ( address : Address ) customer_function : mapping_from CustomerName to Customer paper_function : mapping_from PaperName to Integer order_relation : relation_between CustomerName and PaperName customer_list : sequence_of CustomerName paper_list : sequence_of PaperName

November 2005J. B. Wordsworth: J5DAMSDI10 Specification invariants (B1) dom ( order_relation )  dom ( customer_function ) (B2) ran ( order_relation )  dom ( paper_function ) (B3) ran ( customer_list )  dom ( customer_function ) (B4) ran ( paper_list )  dom ( paper_function ) (B5)  pn  dom ( paper_function ) ( paper_function ( pn ) = | { ord | ord  order_relation  ord.2 = pn } | )

November 2005J. B. Wordsworth: J5DAMSDI11 Some design decisions Attributes of Newsagency: –customers: a Hashtable to relate customer name (String) to a Customer object reference –papers: a Hashtable to relate paper name (String) to a Paper object reference Attributes of Customer: –addr (a String) Attributes of Paper: –num (an integer) Attributes of Order: –paper (a Paper object reference), cust (a Customer object reference)

November 2005J. B. Wordsworth: J5DAMSDI12 Sample function: specification addCustomer ( cna, cad ) returns status precondition cna  CustomerName  cad  Address postcondition case: cna  dom ( customer_function ) do status := 1 case: cna  dom ( customer_function ) do customer_function ( cna ) := ( addr := cad ) & status := 0 Preserves (B1) and (B3)

November 2005J. B. Wordsworth: J5DAMSDI13 Defining the behaviour of a Java method: addCustomer InputSituationChange of stateOutput cn ca cn is a key of customers. None.Return 1. cn is not a key of customers. Let cc be a new Customer object with addr = ca. Add the pair ( cn, cc ) to customers. Return 0. int addCustomer ( String cn, String ca ) ; Precondition None. Postcondition

November 2005J. B. Wordsworth: J5DAMSDI14 Justifying the data design decisions The abstraction function explains how each specification structure can be retrieved from the Java data structures. Watch your language! Example: customer_function (S) is the set of pairs whose first members are the keys of customers (J), and whose second members are the tuples containing the addr (J) attributes of the corresponding Customer (J) objects.

November 2005J. B. Wordsworth: J5DAMSDI15 Verification of a method Check that the name of the operation, the inputs, and the outputs agree. For each situation in the design: –Decide which partition of the specification corresponds. –Check that the design change of state agrees with the specification change of state. –Check that the design output is equal to the specification output.

November 2005J. B. Wordsworth: J5DAMSDI16 Implementation Write the Java classes from the class definitions provided by the design. Test each class as you write it, starting at the bottom of the class hierarchy.

November 2005J. B. Wordsworth: J5DAMSDI17 Summary The design process accepts specifications and produces definitions of classes for programming. Class definitions can be compared with specifications (verification) and with one another (consistency). The Java classes are written from the class definitions, and tested.