cs350 lecture 3 requirements...

30
CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST [email protected]

Upload: others

Post on 26-Feb-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

CS350 Lecture 2-1 Requirements Engineering 1

Doo-Hwan Bae

School of Computing, KAIST

[email protected]

Page 2: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Importance of Requirements (1/2)

• Problem: Sorting a given list of numbers in an ascending order.

In order to solve it, answer the following questions

• Is the given problem statement sufficient to develop a program?

• If not, what additional information do we need to know?

2019-09-17 CS350 Software Engineering, SoC, KAIST 2

Page 3: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Importance of Requirements (2/2) in SW Development ProjectsSome advices from industry practitioners• Do not make assumptions as to the user/customer’s needs, ask them.

• Involve the end users as soon as possible, get in touch with the actual people that will be using the software on a daily basis, they are the ones that truly understand what Is needed.

• Scope creep is major issue in most project, especially custom development. A clear and defined scope is going to save a lot of headaches for all involved in the long run.

• A great way to show a customer what you envision is with a prototype.

• A well written, clear and easy to follow documentation of the requirements is essential and before they sign off, go over it with the customer

• It is important to understand the environment in which the software will run

2019-09-17 CS350 Software Engineering, SoC, KAIST 3

Page 4: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Requirements Engineering Overview (1/7)

• Must state what to do, not how to do.

• Identify the qualities required for the application.

• Functional and nonfunctional

• Used by both customer and designers

2019-09-17 CS350 Software Engineering, SoC, KAIST 4

Page 5: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Requirements Engineering Overview(2/7)

• Three steps in RE• Requirements Elicitation (gathering and analysis)

-- understand/analyze the problem

• Requirements Specification

-- Once the problem is understood, it has to be specified

-- Or, describe the product to be delivered

-- Informal and formal methods, used.

• Requirements validation and verification

-- Once described, the different parties involved have to agree upon its nature.

-- Validation: the correct R’s are stated.

-- Verification: The R’s are stated correctly.

2019-09-17 CS350 Software Engineering, SoC, KAIST 5

Page 6: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Requirements Engineering Overview(3/7)

• Group User R’s into several categories (MoSCoW)

- Must haves: Essential features

- Should haves: Nice features

- Could haves: if time allows

- Won’t haves: not today

2019-09-17 CS350 Software Engineering, SoC, KAIST 6

Page 7: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Requirements Engineering Overview(4/7)

• Separate functional requirements into three views:• A model of data/static structure:

• Entity relationship diagrams, domain model (class diagram)

• A model of function:

• Data flow diagrams, use case diagram

• A model of control:

• Control flow diagrams, State Machines, Petri nets, sequencediagram

2019-09-17 CS350 Software Engineering, SoC, KAIST 7

Page 8: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Requirements Engineering Overview(5/7)

• Other Requirements

- Which machine, which OS, which DBMS, terminal?

- Which classes of users can be distinguished?

- What is the size of the DB, how is it expected to grow?

- What response time should the system offer?

- How much will a system of this kind cost?

2019-09-17 CS350 Software Engineering, SoC, KAIST 8

Page 9: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Requirements Engineering Overview(6/7)

Seven Deadly Sins• Noise

• Irrelevant information• Confusing presentation

• Silence• Omissions

• Over-specification• Premature implementation decisions

• Contradiction• Inconsistency

• Ambiguity

• Forward reference

• Wishful thinking

2019-09-17 CS350 Software Engineering, SoC, KAIST 9

Page 10: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Requirements Engineering Overview(7/7)

Specification Qualities

• Clear, unambiguous, understandable

• Consistent

• Complete

• Functional

• Verifiable

• Traceable

• Easily changed

2019-09-17 CS350 Software Engineering, SoC, KAIST 10

Page 11: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Classification of Specification Methods

• Formal and informal

• Operational or descriptive

• Representative methods:• OO: object-oriented view

• Structured Analysis: function-oriented view

• Finite State Machines: state transition view

• Petri-Nets: operation or control view

2019-09-17 CS350 Software Engineering, SoC, KAIST 11

Page 12: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

OO Analysis

• Functional analysis: Use-case modeling• From user’s point of view, not system developer’s view

• Static structure analysis: Domain modeling (top level class diagram)

• Behavioral analysis: Sequence modeling

2019-09-17 CS350 Software Engineering, SoC, KAIST 12

Page 13: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Initial ATM Requirements ( Problem )

• A customer uses a bank ATM for checking balances of bank accounts, depositing funds, withdrawing cashes, and transferring funds.

• A bank ATM consists of a keypad, screen, cash dispenser, ATM card reader, cash deposit slot.

• A user can have a checking account and saving account.• A customer enters his/her card and password for authentication and then choose a transaction to be executed. After the transaction is over, the ATM returns the card and receipt, and stores the transaction for bookkeeping.

• Once the request from the ATM is passed, the bank checks the account and process a requested transaction and update the account.

2019-09-17 CS350 Software Engineering, SoC, KAIST 13

Page 14: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Use-Case Modeling

• Establish the system boundary

• Identify actors that use the system

• For each actor, identify functionalities the system provide

• Represent each functionality as a use case

• Identify relationships between actors and use cases,..

2019-09-17 CS350 Software Engineering, SoC, KAIST 14

Page 15: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Identify Use Cases

• Identify actors first• Actor: a person/thing that initiate actions to a system or receives results of actions

from the system

• Use cases are “Why the customer goes to the ATM?”

• Find action terms from the initial requirements• Check balances• Deposit funds• Withdraw cashes• Transfer funds• Enters card/password• Authenticate• Choose a transaction• Return a card..• Check, process, update

2019-09-17 CS350 Software Engineering, SoC, KAIST 15

Page 16: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Use Case Diagram for ATM

• Let us try• Identify actors, use cases, system boundary

2019-09-17 CS350 Software Engineering, SoC, KAIST 16

Page 17: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Top-level Use Cases

• Technician?

2019-09-17 CS350 Software Engineering, SoC, KAIST 17

Page 18: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Domain Modeling

• Why? —The goal of domain modeling is to understand how system-to-be will work

• Requirements analysis determined how users will interact with system-to-be (external behavior)

• Domain modeling determines how elements of system-to-be interact (internal behavior) to produce the external behavior

• Where? —We do domain modeling based on the following sources:• Knowledge of how system-to-be is supposed to behave (from requirements analysis,

e.g., use cases)

• Studying the work domain (or, problem domain)

• Knowledge base of software designs

• Developer’s past experience with software design

2019-09-17 CS350 Software Engineering, SoC, KAIST 18

Page 19: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Domain Modeling

• What?• Illustrates meaningful conceptual classes in a problem domain

• Is a representation of real-world concepts, not software artifacts

• Is the most important objects/classes in OO development• Decompose the system into a set of objects, rather than functions!

• How?• Identify nouns and noun phrases in textual descriptions of the

domain• Use use cases in use-case diagrams

• Add associations for relationships that must be retained

• Add attributes necessary for information to be preserved

2019-09-17 CS350 Software Engineering, SoC, KAIST 19

Page 20: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Use Case Modeling vs. Domain Modeling

(b)(a)

In use case analysis, we consider

the system as a “black box”

Use Case 1

Use Case 2

Use Case NActor

System

Actors

Use Case 1

Use Case 2

Use Case NActor

System

Actors

Actor

Domain Model

Actors

Actor

Domain Model

Actors

In domain analysis, we consider

the system as a “transparent box”

2019-09-17 CS350 Software Engineering, SoC, KAIST 20

Page 21: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Example: ATM Machine

(b)

(a)

12

345

67

890

12

345

67

890

Actor(Bank

customer)

System

Actor(Remote

datacenter)

(ATM machine)

Concept 2

Concept 1

Actor

Concept 3

Concept n

Domain Model

Actor

2019-09-17 CS350 Software Engineering, SoC, KAIST 21

Page 22: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Building Domain Model from Use Cases

Step 1: Identifying the boundary concepts

Step 2: Identifying the internal concepts

Actor A

Actor B Actor D

Actor C

Boundary concepts

Concept 2Concept 2

Concept 3Concept 3

Concept 4Concept 4

Concept 1Concept 1

Actor A

Actor B

Actor C

Actor D

Concept 1Concept 1

Concept 2Concept 2

Internal

concepts

Concept 3Concept 3

Concept 5Concept 5

Concept 4Concept 4

Concept 6Concept 6

2019-09-17 CS350 Software Engineering, SoC, KAIST 22

Page 23: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Identify Classes for ATM

• Identify all the nouns or noun phrases.Customer, bank, ATM, (bank) account, funds, cash, keypad, screen, cash dispenser, cash deposit slot, user, checking account, saving account, card, password, transaction, receipt, bookkeeping, request.

• Eliminate redundant, irrelevant, implementation constructs, attributes, etc.

2019-09-17 CS350 Software Engineering, SoC, KAIST 23

Page 24: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Initial Class Diagram (Domain Model) for ATM• Objects: ATM, Keypad, Deposit slot, Cash dispenser, Screen, Transaction, Bank, Account, Customer

• Draw a class diagram with only class names and relationships

2019-09-17 CS350 Software Engineering, SoC, KAIST 24

Page 25: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Class Diagram for an ATM & Bank

2019-09-17 CS350 Software Engineering, SoC, KAIST 25

Page 26: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Domain Model for an ATM & Bank

ATM in Bank Consortium

2019-09-17 CS350 Software Engineering, SoC, KAIST 26

Page 27: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Refined Class D.

2019-09-17 CS350 Software Engineering, SoC, KAIST 27

Page 28: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

High Level Sequence Diagram

• You can have more SDs…

2019-09-17 CS350 Software Engineering, SoC, KAIST 28

Page 29: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Refining Diagrams

• Now we have• Use case diagram

• Initial class diagram (domain diagram)

• Sequence diagram

• Once, the initial requirements analysis/specification is over, refining those diagrams until ..

• Then, verify the results

• Also, identify Non-functional requirements

2019-09-17 CS350 Software Engineering, SoC, KAIST 29

Page 30: CS350 Lecture 3 Requirements Engineeringse.kaist.ac.kr/wp-content/uploads/2019/09/CS-350-Lecture...CS350 Lecture 2-1 Requirements Engineering 1 Doo-Hwan Bae School of Computing, KAIST

Summary

• Remember that in the real world, no one will give you the exact, complete, consistent, and unambiguous requirements for software development.

• Also requirements document will be used as a contract

• Requirements changes are inevitable. Be prepared!

• Object-orientation is everywhere.

2019-09-17 CS350 Software Engineering, SoC, KAIST 30