單元 2 :軟體處理程序與需求分析 2-2 軟體需求

34
Software Engineering for D igital Home 單單 2 單單 單單單單單單單單單 :體 2-2 單 單單 Presenter: Away

Upload: aurelia-vaughn

Post on 15-Mar-2016

119 views

Category:

Documents


2 download

DESCRIPTION

單元 2 :軟體處理程序與需求分析 2-2 軟體需求. Presenter: Away. Outline. Introduction Functional vs. nonfunctional requirements Requirements elicitation activities Identifying actors and scenarios Identifying use case Refining use case and identifying relationship Identifying nonfunctional requirements - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

單元 2 :軟體處理程序與需求分析 2-2 軟體需求Presenter: Away

Page 2: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

2

Outline

• Introduction• Functional vs. nonfunctional requirements• Requirements elicitation activities

– Identifying actors and scenarios– Identifying use case– Refining use case and identifying relationship– Identifying nonfunctional requirements

• Software Requirements Specifications

Page 3: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

3

Software life cycle

Development cycle

Introduction

Design Implementation Testing

Maintenance

RequirementsEngineering

RequirementsElicitation System design

Object designAnalysis

Use CasesProblem statement Class diagram

Page 4: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

4

Requirements engineering

Analysis

Problem statement

Requirements elicitation

Nonfunctional requirements

Dynamic model

Analysis object model

Function model (Use case)

Analysis Model

SpecificationRequirements

Page 5: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

5

Requirements elicitation• Requirements elicitation focuses on describing the purpose of the system.

(Requirements elicitation 重點集中於描述系統目的 )• During Requirements elicitation to produce a requirements specification.

( 完成 requirements elicitation 流程後會產出一份系統需求規格書 )• The requirements specification is written in natural language.

( 系統需求規格書是以人類熟析的語言撰寫 )• The requirements specification is structured and formalized during analysis

to produce an analysis model.( 完成 analysis 流程後產出的 analysis model 是根據 requirements specification 而來 )

• Requirements elicitation and analysis occur concurrently and iteratively.(Requirements elicitation 與 analysis 兩個流程是並行的且過程中會反覆交錯影響 )

Page 6: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

6

Functional requirements• Describe functionality or system services.

( 描述系統的功能、服務 )• How the system should react to particular inputs and how the

system should behave in particular situations.( 描述系統遇到哪些輸入要有何種反應,當系統遇到哪些狀態會何種處理行為 )

• Functional requirements do not focus on any of the implementation details.(Functional requirements 只表達需要系統提供什麼功能或服務,而不著重於怎麼實作這些功能或服務 )

Page 7: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

7

Nonfunctional requirements

Non-functional requirement

Product requirement

Implementation requirement

Deliveryrequirement

Organisationalrequirement

Spacerequirement

Performancerequirement

Usabilityrequirement

Portabilityrequirement

Reliabilityrequirement

Efficiencyrequirement Standards

requirementLegislativerequirement

Ethicalrequirement

Interoperabilityrequirement

External requirement

Privacyrequirement

Safetyrequirement

Page 8: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

8

Product requirements• Requirements which specify that the delivered product must

behave in a particular way.e.g. 1. Yahoo會員註冊 (Usability requirement)2.需同時服務 50 個 user 上線,每個 request 的 response

time 要在 2 秒之內 (Performance requirement)3.對於正常的連線操作狀態下,發生當機的錯誤率不可超過千分之一 (Reliability requirement) 4. Microsoft Windows 2000 至今的 Server 系列皆須能安裝以及執行本系統 (Portability requirement)

Page 9: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

9

Organisational requirements• Requirements which are a consequence of organisational

policies and procedures.

e.g.1.需求規格,設計文件,實作的產品 (delivery

requirement)2.限制使用物件導向方式設計 (implementation

requirement)3.符合 SCORM 2004的標準 (standard requirement)

Page 10: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

10

External requirements• Requirements which arise from factors which are external to

the system and its development process.

e.g. 1.本系統需與公司舊有資料庫溝通,舊有資料庫機器上所使用的處理器為 32 bit (Interoperability requirement)2.不能只利用 user 的姓名或是編號就可以顯示出 user 的所有資訊 (privacy requirement)

Page 11: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

11

Page 12: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

12

Page 13: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

13

Requirements elicitation activities

Problem statement

Requirements elicitation

Nonfunctional requirements

Function model

SpecificationRequirements

Identifying actorsand scenarios

Identifying use case

Refining use case andidentifying relationship

Identifying nonfunctionalrequirements

Scenario

Use cases

Detailed use cases

Page 14: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

14

Problem statement• After an initial meeting with the client, the problem statement

is written.( 在 project manager 跟客戶聊天喝茶後客戶要求的系統 problem statement 由 project manager 記錄下來 )

• Problem

Page 15: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

15

教學網站• 由於資訊的進步,現在有很多的教學已資訊化,老師及學生需要一個平台來溝通,老師要提供上課教材給學生下載.有時候老師開放ftp , e-mail 給學生交作業等等.但這樣的方式並不是很方便.• 由於老師都需要這些功能,所以我們希望建立一個教學網站的系統,借由此系統老師及助教可以很容易對於課程教材、學生資料以及作業、報告及成績等進行輕鬆的控管。學生可利用系統進行教材的下載,成績查詢等功能。• 老師,助教及學生也可以利用系統進行互相討論課業及互相聯絡的進階功能。• 教學網站為一個線上的系統 , 使用者可透過網頁瀏覽器對教學網站進行管理 , 使用 .

Page 16: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home教學網站 (cont.)• 教學網站的基本功能為 -課程介紹 , 課程行事曆 , 課程公告 , 資料下載 , 作業上 /下載 , 報告上 /下載 , 成績查詢 , 課程通訊錄 , 討論區 .• 希望使用 asp /asp.net 開發 . 要支援 50人同時上線 . 在正常的連線操作下 , 發生當機的錯誤率不可超過千分之一 .• 系統要可以安裝在 Microsoft Windows Server 2000以上的版本 . Sql 2000以上的資料庫 .• 不能只利用使用者的姓名或是編號就可以顯示 user的所有資訊 .

16

Page 17: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

17

Requirements elicitation activities

Problem statement

Requirements elicitation

Nonfunctional requirements

Function model

SpecificationRequirements

Identifying actorsand scenarios

Identifying use case

Refining use case andidentifying relationship

Identifying nonfunctionalrequirements

Scenario

Use cases

Detailed use cases

Page 18: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

18

Identifying actors

• What is an actor?– An actor can be human or an external system that exchange

information with the system.( 只要跟本系統做資訊交換這種動作的人或是外部系統都能稱為 actor)

• What is the purpose?– To find all the perspectives from which the developers nee

d to consider the system.(讓系統開發人員可以經由各個 actor 的角度思考系統的製作 )

Page 19: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

19

Identifying actors

• How to identify actors?– Which user groups are supported by the system to perform

their work?( 系統要為哪些使用族群服務 )

– Which user groups execute the system’s main functions?( 系統的主要功能提供給哪些族群使用 )

– Which user groups perform secondary functions?( 系統的次要功能提供給哪些族群使用 )

– With what external hardware or software system will the system interact?( 有什麼外部軟體或是硬體跟本系統互相進行資料傳遞 )

Page 20: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

20

Identifying scenario

• What is a scenario?– A scenario is a concrete, focused, informal description of a

single feature of the system from the viewpoint of a single actor.( 一份 scenario 是從一個 actor 的角度描寫一項系統特徵 )

• What is the purpose?– The emphasis for developers during scenario identification

is to understand the application domain.( 透過 scenario 開發人員可以了解本系統要做某個領域的什麼服務 )

Page 21: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

21

Identifying scenario• How to identify scenario?

– What are the tasks that the actor wants the system to perform?( 系統要為這名 actor 提供什麼服務 ?)

– What information does the actor access? Who creates that data? Can it be modified or removed? By whom?( 這名 actor 可以存取什麼資訊,這些相關的資訊又是誰建立的 ?這些資訊可以被修改或移除嗎 ?如果可以,是由哪些 actor 進行這項動作 )

– Which external changes does the actor need to inform the system about? How often? When?( 有哪些外部資訊是由 actor 告知系統的 ?什麼狀況下會有這樣的動作 ?)

– Which events does the system need to inform the actor about? With what latency?( 系統發生了什麼事件必須通知 actor?)

Page 22: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

22

教學網站 scenario

Scenario name

繳交作業Participating actor instances

Alice : 老師 , Bill : 學生

Flow of events

• Alice 是 OOSE 課程的老師 , Alice 在教學網站上開一個作業 , 要求學生分析出教學網站所有的 use case.• Alice 在教學網站上建立了這個作業 . 及繳交日期等資訊 .• Bill 在上完課後 , 很認真的把作業完成了 , 他登入教學網站 , 選到 OOSE 課程中 , 把作業上傳到教學網站中 .

• 在作業截止後 , Alice 把所有學生繳交的作業下載下來 , 一一批改 , 並把成績登錄在系統上 .

Page 23: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

23

Requirements elicitation activities

Problem statement

Requirements elicitation

Nonfunctional requirements

Function model

SpecificationRequirements

Identifying actorsand scenarios

Identifying use case

Refining use case andidentifying relationship

Identifying nonfunctionalrequirements

Scenario

Use cases

Detailed use cases

Page 24: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

24

Identifying use case• Developers can then consolidate related functionality into single use cases and split u

nrelated functionality into several use cases.( 一份 use case 可以由多份 scenario 當中的功能組合而成,而一份含有許多不同功能 scenario 可以被各自寫到多份 use cases 當中 )

• Writing use cases is a craft. An analyst learns to write better use cases with experience.( 分析師要寫一份好的 use case 是要靠經驗的 )

• Simple use case writing guide (P.137 [B.B., A.H.D., OOSE 2/e])– Use cases should be named with verb phrases.

(Use cases 名稱必須使用動詞,表明 actor 要做什麼事情 )– Actors should be named with noun phrases.

(Actors命名要用名詞 )– A use case should describe a complete user transaction.

(Actor 要做與要系統做並且會發生的事件從頭到尾一件一件按照順序描述 )– Exceptions should be described separately.

( 每個例外狀況視為一個事件寫下 )– …

Page 25: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

25

High-level use cases diagram

建立作業

學生

老師

<<initiate>>

繳交作業

<<initiate>>

Page 26: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

26

教學網站 use case

Use case name 建立作業Participating actors

Initiated by 老師Communicates with 學生

Flow of events 1. 老師要建立作業 .2. 老師輸入作業資訊 .3. 系統檢查輸入的資訊是否正確 .4. 如果正確 , 系統就建立止作業 .

Entry condition • 老師登入了教學網站 .

Exit conditions • 老師在教學網站上建立了一個新的作業 .

Page 27: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

27

Requirements elicitation activities

Problem statement

Requirements elicitation

Nonfunctional requirements

Function model

SpecificationRequirements

Identifying actorsand scenarios

Identifying use case

Refining use case andidentifying relationship

Identifying nonfunctionalrequirements

Scenario

Use cases

Detailed use cases

Page 28: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

28

Refining use cases• The elements that are manipulated by the system are detailed.

( 物件的操作細節 )

• The low-level sequence of interactions between the actor and the system are specified.(更具體說明 actor 與系統間互動的細節 )

• Access rights are specified.(存取權限的具體說明 )

• Handling exceptions are specified.(例外處理的具體說明 )

• Common functionality among use cases are factored out.( 分解兩個以上的 use cases具有的相同功能 )

Page 29: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

29

Detailed use cases diagram

建立課程

老師

學生

<<initiate>>

<<include>><<include>>

<<include>>發佈公告上傳教材 發佈成績

建立作業

<<include>>

繳交作業

查詢成績

Page 30: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

30

Detailed use caseUse case name

建立作業Participating actors

Initiated by 老師Communicates with 學生Flow of events

1. 老師要建立作業 .2. 老師輸入作業的名稱 (50 字元 ), 作業的要求 (2000 字元 ), 截止日期 (日期格式 ).3. 系統檢查輸入的作業名稱 , 作業的要求 , 截止日期是否正確 .4. 如果正確 , 系統就建立止作業 .

Exceptions 3.1 如果所輸入的資料不正確 , 系統要求使用者重新輸入 .Entry condition

老師己登入教學網站 .

Exit conditions

• 老師在教學網站上建立了一個新的作業 .

Page 31: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

31

Requirements elicitation activities

Problem statement

Requirements elicitation

Nonfunctional requirements

Function model

SpecificationRequirements

Identifying actorsand scenarios

Identifying use case

Refining use case andidentifying relationship

Identifying nonfunctionalrequirements

Scenario

Use cases

Detailed use cases

Page 32: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

32

教學網站 nonfunctional requirements

Category Nonfunctional requirements

Reliability • 若 Server shut down 則必須在 40 分鐘內恢復運作Scalability • 系統必須最少可以讓 50位使用者正常連線與執行

Implementation • 只要安裝有支援 cookies, Javascript, 瀏覽器的使用者都要可以使用教學網站• 教學網站要可以在 windows server 2000 + IIS +SQL S

erver 2000 上安裝在執行

Page 33: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

33

Software Requirements Specifications(SRS)

1. Introduction1.1 Purpose1.2 Scope1.3 Definitions, acronyms, and abbreviations1.4 References1.5 Overview

2. Overall description2.1 Product perspective2.2 Product functions2.3 User characteristics2.4 Constraints2.5 Assumptions and dependencies

3. Specific requirements3.1 External interface requirements3.2 Functional requirements3.3 Performance requirements3.4 Design constraints3.5 Software system attributes

AppendicesIndex

Page 34: 單元 2 :軟體處理程序與需求分析 2-2 軟體需求

Software Engineering for Digital Home

34

Exercise• 為什麼我們通常都用 scenario 詢問客戶而不用 use case?

• Scenario 通常已經充分敘述了系統功能,為什麼我們還需要 use case?

• 請寫出 學生繳交作業 的 Detail use case.

• 請劃出 學生繳交作業 的 use case diagram.