CS3500: Object-Oriented Design Fall 2013

Similar documents
CIS 890: Safety Critical Systems

User Stories Applied, Mike Cohn

An AVL tree with N nodes is an excellent data. The Big-Oh analysis shows that most operations finish within O(log N) time

Software specification and modelling. Requirements engineering

Motivation for B-Trees

User Stories Applied, Mike Cohn

Material You Need to Know

2-3 and Trees. COL 106 Shweta Agrawal, Amit Kumar, Dr. Ilyas Cicekli

Introduction to User Stories. CSCI 5828: Foundations of Software Engineering Lecture 05 09/09/2014

Intro to Software Requirements

Multi-way Search Trees! M-Way Search! M-Way Search Trees Representation!

Administrivia. Wednesday: Requirements and Specification. CS169 Lecture 4. We assign teams and you start on Monday. Determining Stakeholders and Needs

1. i. What are the 3 major components of a information system and show their relationship input output

Lecture 7 (3-April-2013)

Software Engineering - I

Binary Trees

Data Structures and Algorithms

Multi-way Search Trees. (Multi-way Search Trees) Data Structures and Programming Spring / 25

User Stories for Agile Requirements. Mike Cohn - background. Copyright Mountain Goat Software, LLC

Fundamentals: Software Engineering. Objectives. Last lectures. Unit 2: Light Introduction to Requirements Engineering

M-ary Search Tree. B-Trees. B-Trees. Solution: B-Trees. B-Tree: Example. B-Tree Properties. Maximum branching factor of M Complete tree has height =

Requirement Analysis

Design and Analysis of Algorithms Lecture- 9: B- Trees

CS 171: Introduction to Computer Science II. Binary Search Trees

Section 4 SOLUTION: AVL Trees & B-Trees

M-ary Search Tree. B-Trees. Solution: B-Trees. B-Tree: Example. B-Tree Properties. B-Trees (4.7 in Weiss)

Balanced Search Trees

CIS265/ Trees Red-Black Trees. Some of the following material is from:

CMSC 341 Lecture 14: Priority Queues, Heaps

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

2014 Intelliware Development Inc.

Requirements Engineering. Establishing what the customer requires from a software system. Requirements Engineering. What is a Requirement?

CS Transform-and-Conquer

Ch 4: Requirements Engineering. What are requirements?

Mathematics and Computing: Level 2 M253 Team working in distributed environments

Dilbert Scott Adams. CSc 233 Spring 2012

Trees. A tree is a directed graph with the property

AVL Trees Goodrich, Tamassia, Goldwasser AVL Trees 1

B-Trees. Disk Storage. What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree. Deletion in a B-tree

Quality Software Requirements By J. Chris Gibson

CS301 - Data Structures Glossary By

CSC Design and Analysis of Algorithms

Balanced Trees Part Two

CS F-11 B-Trees 1

CS 350 : Data Structures B-Trees

Administrivia. Added 20 more so far. Software Process. Only one TA so far. CS169 Lecture 2. Start thinking about project proposal

Lecture 32. No computer use today. Reminders: Homework 11 is due today. Project 6 is due next Friday. Questions?

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 09/17/2015

Homework 3. Theory (50 points) Data Structures and Algorithms in JAVA Shlomo Hershkop Department of Computer Science Columbia University Summer 2002

Linked Structures Songs, Games, Movies Part III. Fall 2013 Carola Wenk

CSC Design and Analysis of Algorithms. Lecture 7. Transform and Conquer I Algorithm Design Technique. Transform and Conquer

Requirements Engineering

Binary Search Trees Treesort

CS 2150 (fall 2010) Midterm 2

Binary Search Trees. Carlos Moreno uwaterloo.ca EIT

Computer Science 210 Data Structures Siena College Fall Topic Notes: Binary Search Trees

Agile Tester Foundation E-learning Course Outline

Recall: Properties of B-Trees

SOFTWARE LIFE-CYCLE PROCESSES From Waterfall to Extreme Programming

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Student WebAdvisor Training Manual

Module 9: Binary trees

What is a Multi-way tree?

CSE 214 Computer Science II Introduction to Tree

Binary Heaps in Dynamic Arrays

Requirements engineering

Sample Exam Syllabus

Trees. (Trees) Data Structures and Programming Spring / 28

Binary Search Trees. Analysis of Algorithms

Physical Disk Structure. Physical Data Organization and Indexing. Pages and Blocks. Access Path. I/O Time to Access a Page. Disks.

Chapter 5 Hashing. Introduction. Hashing. Hashing Functions. hashing performs basic operations, such as insertion,

BST Deletion. First, we need to find the value which is easy because we can just use the method we developed for BST_Search.

Tree Data Structures CSC 221

Trees. Eric McCreath

Problem. Indexing with B-trees. Indexing. Primary Key Indexing. B-trees: Example. B-trees. primary key indexing

Basics : the Requirements Engineering Process

CSC 261/461 Database Systems Lecture 17. Fall 2017

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/27/17

Agile Accessibility. Presenters: Ensuring accessibility throughout the Agile development process

Operations on Heap Tree The major operations required to be performed on a heap tree are Insertion, Deletion, and Merging.

Process of Interaction Design and Design Languages

Software testing. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 23 Slide 1

CMSC 341 Lecture 15 Leftist Heaps

Lecture 7. Transform-and-Conquer

TEXAS DEPARTMENT OF INFORMATION RESOURCES. Test Scenario. Instructions. Version DEC 2006

Lecture 5: Requirements Specifications

CSCI Trees. Mark Redekopp David Kempe

1: Specifying Requirements with Use Case Diagrams

c) A perfect ternary tree of height h? (In a ternary tree, each node may have up to three children.)

Black-box Testing Techniques

CS 310 B-trees, Page 1. Motives. Large-scale databases are stored in disks/hard drives.

Section 1: True / False (1 point each, 15 pts total)

B2B Portal User Guide

Computational Optimization ISE 407. Lecture 16. Dr. Ted Ralphs

Software Project Management, 9th Sep.

The requirements engineering process

Maps; Binary Search Trees

CS 206 Introduction to Computer Science II

Balanced Binary Search Trees. Victor Gao

Software Design Models, Tools & Processes. Lecture 2: Inception Phase Cecilia Mascolo

Transcription:

CS3500: Object-Oriented Design Fall 2013 Class 20 11.12.2013

Assignment 8 Due Friday, November 15, 2013 2

Software Process

Phases of the Software Requirements Process Design Implementation Testing Maintenance 4

Software Process Models 5

Waterfall Model Figure from [Braude & Bernstein] 6

Waterfall with Feedback figure 3.4 on page 37 Figure from [Braude & Bernstein] 7

Waterfall Pros - Simple & easy to use - Practiced for many years - Easy to manage - Facilitates allocation of resources - Works well for smaller projects where requirements are very well understood Cons - Requirements must be known up front - Hard to estimate reliably - No stakeholder feedback until after testing - Major problems not discovered until late in process - Lack of parallelism - Inefficient use of resources 8

Iterative & Incremental 9

Iterative Figure from [Braude & Bernstein] 10

Spiral Figure from [Braude & Bernstein] 11

Incremental Figure from [Pressman] 12

Requirements

Why should we care about requirements?

There s no sense being exact about something if you don t even know what you re talking about. - John von Neumann 15

The hardest single part of building a software system is deciding precisely what to build. No other part of the conceptual work is so difficult as establishing the detailed technical requirements, including all the interfaces to people, to machines, and to other software systems. No other part of the work so cripples the resulting system if done wrong. No other part is more difficult to rectify later. - Fred Brooks 16

Cost of Defects Requirements 1 Design 5 Implementation 20 Test 50 Maintenance 100 0 25 50 75 100 17

Reasons for Project Failure Incomplete requirements 13.1% Lack of user involvement 12.4% Lack of resources 10.6% Unrealistic expectations 9.9% Lack of executive support 9.3% Changing requirements/specification 8.7% Lack of planning 8.1% Didn t need it any longer 7.5% Sources:Standish Group,1995 and 1996;Scientific American, September 1994. 18

Project Success Factors User involvement 15.9% Management support 13.9% Clear statement of requirements 13.0% Proper planning 9.6% Realistic expectations 8.2% Smaller milestones 7.7% Competent staff 7.2% Ownership 5.3% Sources:Standish Group,1995 and 1996;Scientific American, September 1994. 19

Sources of requirements Stakeholders Documents Books 20

Types of Requirements Functional - expresses a function that an application must perform Nonfunctional - does not involve specific functionality - qualifies services or functionalities - should be specific, quantifiable, and testable 21

Examples Functional - The application allows clerks to check out DVDs. Nonfunctional - The application shall display a customer s account status in less than two seconds. 22

Analysis & Specification Analysis: process of understanding the problem and the requirements for a solution Specification: process of describing what a system will do Analysis leads to Specification they are not the same [From NCSU CSC510 Slides] 23

Output Software Requirements Specification (SRS) All stakeholders can agree on set of requirements 24

User of a Requirements Document [Kotonya & Sommerville] System customers - Specify the requirements & read them to check that they meet their needs. - Specify changes to the requirements. Managers - Use the requirements document to plan a bid for the system & to plan the system development process System engineers - Use the requirements to understand what system is to be developed. System test engineers - Use the requirements to develop validation tests for the system. System maintenance engineers - Use the requirements to understand the system & the relationships between its parts 25

Requirements Document The official statement of what is required of the system developers should include both a definition and a specification of requirements It is NOT a design document As far as possible, it should set of WHAT the system should do rather than HOW it should do it [From NCSU CSC510 Slides] 26

Format of Requirements [Hull, Jackson, and Dick]

Functional Requirements The <stakeholder type> shall be able to <capability/function>. The system shall allow the <stakeholder type> to <capability/function>. The system shall <capability/function>. 28

Constraints [Hull, Jackson, and Dick] Performance/capability: The <system> shall be able to <function> <object> not less than <performance> times per <units>. Performance/capability: The <system> shall be able to <function> <object> of type <qualification> within <performance> <units> Performance/capacity: The <system> shall be able to <function> not less than <quantity> <object>. Performance/timeliness: The <system> shall be able to <function> <object> within <performance> <units> from <event>. Performance/periodicity: The <system> shall be able to <function> not less than <quantity> <object> within <performance> <units> Interoperability/capacity: The <system> shall be able to <function> <object> composed of not less than <performance> <units> with <external entity>. Sustainability/periodicity: The <system> shall be able to <function> <object> for <performance> <units> every <performance> <units>. Environmental/operability: The <system> shall be able to <function> <object> while <operational condition>. 29

Quality of Requirements - Comprehensiveness - How comprehensive is the SRS? - Does the SRS include all of the customer s wants and needs? - Consistency - How consistent is the SRS? - Are there contradictions in the SRS? - Self-Completeness - How self-complete is the SRS? - Does the SRS contain all of the necessary parts? - Understandability - How understandable is each requirement? - Unambiguity - How unambiguous is each requirement? - Can the requirement be interpreted in only one way? - Prioritization - How effectively prioritized are the requirements? - Is there an order for implementation? - Testability - How testable is each requirement? - Is it possible to validate the requirement in the finished product? - Traceability - How traceable is each requirement? - Is the requirement traceable forward? Backward? [Braude & Bernstein] 30

Traceability Track each requirement to design and code that implements it Track each part of code back to corresponding elements of design and requirements Critical in requirements engineering to link the requirements for the system and other important entities of the software 31

Traceability requirement accommodates design element implements relates to relates to implements test validates code verifies verifies verifies verifies inspection inspection inspection inspection Figure from [Braude & Bernstein] 32

Benefits of Traceability [Hull, Jackson, and Dick] Greater confidence in meeting objectives. Ability to assess the impact of change. Improved accountability of subordinate organizations. Ability to track progress. Ability to balance cost against benefit. 33

Stories 34

User Stories [Cohn] Describe software functionality that will be important for the users Allow software engineers to gain an understanding of what the software may include 35

Aspects in User Stories [Cohn] A written description of the story used for planning and as a reminder Conversations about the story that serve to flesh out the details of the story Tests that convey and document details and that can be used to determine when a story is complete 36

Use Cases Use case: sequence of actions taken by the actor and the application Actor (person or system) Scenario: list of numbered steps - Main success scenario - Extensions or error conditions 37

Use Case: Retrieve a File 1. User clicks File menu 2. System displays options New and Open 3. User clicks Open 4. System displays file window 5. User enters directory and file name 6. User hits Open button 7. System retrieves referenced file into word processor window Extensions 38

Use Case: Retrieve a File Main Success Scenario 1. User clicks File menu 2. System displays options New and Open 3. User clicks Open 4. System displays file window 5. User enters directory and file name 6. User hits Open button 7. System retrieves referenced file into word processor window Extensions Extension 7aSystem displays error indicating file could not be opened 39

Use Case Format Name: describes the task Associated requirement Actor: who is the user Priority Main success scenario Extensions 40

Use Case Exercise 41

Rent a Movie 1. User presses Rent a Movie 2. System displays movies that are for rent 3. User selects a movie 4. System displays selected movie information 5. User presses Rent 6. System prompts for credit card payment 7. User swipes credit card 8. System ejects movie 42

Rent a Movie 1. User presses Rent a Movie a. The user shall be able to press Rent a Movie from the Main screen when she wants to rent a movie. 2. System displays movies that are for rent a. The system shall display the list of possible movies to rent when the user presses Rent a Movie from the Main screen. 3. User selects a movie a. From the Movie Selection screen, the user shall be able to select a movie to rent. b. The system shall only display available movies on the Movie Selection screen. 4. System displays selected movie information a. The system shall display movie information on the selected movie when the user selects the movie from the Movie Selection screen. 43

Rent a Movie 5. User presses Rent a. The user shall be able to press Rent from the Movie screen when she wants to rent the selected movie. 6. System prompts for credit card payment a. The system shall prompt the user for credit card payment via the Payment screen when the user indicates she wants to rent the selected movie. 7. User swipes credit card a. The user shall be able to swipe her credit card to pay for the selected movie. 8. System ejects movie a. The system shall process the credit card payment when the user has selected a movie and swiped her credit card. b. The system shall eject the movie once the payment has been processed. 44

Stories for Online Bookstore Books can be searched by author, title, or ISBN. Books can be viewed detailed information by number of pages, publication date, and a brief description. Book can be placed in shopping cart and bought. Books can be rated and reviewed. 45

Requirements Engineering is difficult Despite the clear benefits of getting requirements complete, right, and errorfree early, they are the hardest part of the system development lifecycle to do right because: - we don t always understand everything about the real world that we need to know, - we may understand a lot, but we cannot express everything that we know - we may think we understand a lot, but our understanding may be wrong, - requirements change as client s needs change, - requirements change as clients and users think of new things they want, and - requirements of a system change as a direct result of deploying the system. [From NCSU CSC510 Slides] 46

47

48

49

Other Approaches to Balanced Trees AVL Trees 2-3 Trees 50

AVL Trees [Levitin] An AVL tree is a binary search tree in which the balance factor of every node, which is defined as the difference between the heights of the node s left and right subtrees, is either 0 or +1 or -1. (The height of the empty tree is defined as -1.) 51

AVL Tree Not AVL Tree Figures from Levitin 52

Figure from Levitin 53

2-3 Trees [Levitin] A 2-3 tree is a tree that can have nodes of two kinds: 2-nodes and 3-nodes. A 2-node contains a single key K and has two children. A 3-node contains two ordered keys K1 and K2 (K1 < K2) and has three children. A 2-3 tree is always height-balanced 54

Figure from Levitin 55

Inserting into 2-3 Trees [Levitin] Always insert a new key K at a leaf except for the empty tree. The appropriate leaf is found by performing a search of K. If the leaf in question is a 2-node, we insert K there as with the first or the second key, depending on whether K is smaller or larger than the node s old key. If the leaf is a 3-node, we split the leaf in two: the smallest of the three keys (two old ones and the new key) is put in the first leaf, the largest is put in the second leaf, while the middle key is promoted to the old leaf s parent. (If the leaf happens to be the tree s root, a new root is created to accept the middle key.) Note that promotion of a middle key to its parent can cause the parent s overflow (if it was a 3-node) and hence can lead to several node splits along the chain of the leaf s ancestors. 56