Software Engineering for Digital Home 單元 2 :軟體處理程序與需求分析 2-3 需求工程處理程序 Presenter: Away
Software Engineering for Digital Home 2 Outline Introduction Analysis model –Object Model –Dynamic Model Analysis activities –Identifying entity objects –Identifying boundary objects –Identifying control objects –Mapping use cases to sequence diagram –Modeling interactions among objects with class diagram
Software Engineering for Digital Home 3 Software life cycle Development cycle Design ImplementationTesting Maintenance Requirements Engineering Requirements Elicitation System design Object designAnalysis Use CasesProblem statementAnalysis Model
Software Engineering for Digital Home 4 Requirements engineering Analysis Problem statement Requirements elicitation Nonfunctional requirements Dynamic model Object model Function model (Use case) Analysis Model Specification Requirements
Software Engineering for Digital Home 5 Analysis model Items Models Purpose Representation Object modelSpecifying properties and relationship of individual concepts that are manipulated by the system. ( 指出系統的所有物及關係 ) Class diagrams Dynamic modelRepresenting the behaviors and interactions among a set of objects. ( 表示出物件間的行為及互動 ) Sequence diagrams
Software Engineering for Digital Home 6 Object model The object model consists of: –Entity objects Representing the persistent information tracked by the system. ( 和系統有關的資料實體 ) –Boundary objects Representing the system interface with the actors. ( 表示系統和使用者的介面 ) –Control objects Control objects are responsible for coordinating boundary and entity objects. (entity object 和 boundary object 溝通的 object) Modeling interactions among objects with class diagrams. (class diagram 來表示 object 間的相互作用 )
Software Engineering for Digital Home 7 Dynamic model Sequence diagrams represent the interactions among a set of objects from object model during a single use case. ( 表示物件的互動關係 ( 有時間順序的 ) ) 可以幫助我們確認 use case
Software Engineering for Digital Home 8 Analysis Analysis activities Use Cases Dynamic model Identifying entity objects Identifying boundary objects Mapping use cases to sequence diagram Modeling interactions among objects with class diagram Sequence diagrams Analysis Model Identifying control objects Object model Class diagrams
Software Engineering for Digital Home 9 Use case (input) Use case name 建立作業 Participating actors Initiated by 老師 Flow of events 1. 老師要建立作業. 2. 老師輸入作業的名稱 (50 字元 ), 作業的要求 (2000 字元 ), 截止 日期 ( 日期格式 ). 3. 系統檢查輸入的作業名稱, 作業的要求, 截止日期是否正確. 4. 如果正確, 系統就建立作業. Exceptions 3.1 如果所輸入的資料不正確, 系統要求使用者重新輸入. Entry condition 老師己登入教學網站. Exit conditions 老師在教學網站上建立了一個新的作業.
Software Engineering for Digital Home 10 Heuristics for identifying entity objects Terms that developers or users need to clarify in order to understand the use case.( 清楚了解及 use case) Recurring nouns in the use case.( 找出名詞 ) Real-world entities that the system needs to track.( 現實中的實 體 ) Real-world activities that the system needs to track.( 現實中的 活動 / 行為 ) Data sources or sinks.( 資料 ) Recurring Adjective in the use case, it is Attribute of object( 屬性 )
Software Engineering for Digital Home 11 Identifying Entity Object (found out the class name) Use case name 建立作業 Participating actors Initiated by 老師 Flow of events 1. 老師要建立作業. 2. 老師輸入作業的名稱 (50 字元 ), 作業的要求 (2000 字元 ), 截止 日期 ( 日期格式 ). 3. 系統檢查輸入的作業名稱, 作業的要求, 截止日期是否正確. 4. 如果正確, 系統就建立作業. Exceptions 3.1 如果所輸入的資料不正確, 系統要求使用者重新輸入. Entry condition 老師己登入教學網站. Exit conditions 老師在教學網站上建立了一個新的作業. 老師作業系統
Software Engineering for Digital Home 12 Identifying Entity Object (found out the attribute) Use case name 建立作業 Participating actors Initiated by 老師 Flow of events 1. 老師要建立作業. 2. 老師輸入作業的名稱 (50 字元 ), 作業的要求 (2000 字元 ), 截止 日期 ( 日期格式 ). 3. 系統檢查輸入的作業名稱, 作業的要求, 截止日期是否正確. 4. 如果正確, 系統就建立作業. Exceptions 3.1 如果所輸入的資料不正確, 系統要求使用者重新輸入. Entry condition 老師己登入教學網站. Exit conditions 老師在教學網站上建立了一個新的作業. 作業 名稱 作業要求 截止日期
Software Engineering for Digital Home 13 Heuristics for identifying boundary objects Identity user interface controls that the user needs to initiate the use case. (user 怎樣去開始 use case) Identity forms the user needs to enter data into the system. ( 使用者要給系統的資料 ) Identity notices and message the system uses to respond to the user. (user 怎樣和系統溝通 )
Software Engineering for Digital Home 14 Heuristics for identifying control objects Identity one control object per use case. ( 從 use case 去找出一個 control object) Identity one control object per actor in the use case. ( 從 actor 去找出一個 control object)
Software Engineering for Digital Home 15 Heuristics for drawing sequence diagrams The first column should correspond to the actor who initiated the use case.( 第一行是 actor) The second column should be a boundary object (that the actor used to initiate the use case).( 第二行是 boundary object) The third column should be the control object that manages the rest of the use case.( 第三行是 control object) Control objects are created by boundary objects initiating use cases. (control object 是被 boundary 所建立 ) Boundary objects are accessed by control objects. (boundary object 是存取 control object) Entity objects are accessed by control and boundary objects. (entity object 是被 control object 和 boundary object 存取 )
Software Engineering for Digital Home 16 Sequence diagram(1) AA Form BB Control CC Entity DD Entity actor boundary object control objectEntity objects
Software Engineering for Digital Home 17 Sequence diagram(2) 老師 建立作業 () «new» 建立作業 Form 建立作業 Control 作業 輸入 ( 名稱, 要求, 截止日期 ) 檢查 (..) UML sequence diagram for AnnounceTournament, tournament creation workflow 1. 老師要建立作業. 2. 老師輸入作業的名稱 (50 字元 ), 作業的要求 (2000 字 元 ), 截止日期 ( 日期格式 ). 3. 系統檢查輸入的作業名稱, 作業的要求, 截止日期是 否正確. 4. 如果正確, 系統就建立作業. «new»
Software Engineering for Digital Home 18 Fill the operation to class diagram 作業 名稱 作業要求 截止日期 建立作業 Form 建立作業 () 輸入 (….) 建立作業 Control 檢查 (…) Assignment name context Due date CreateAssignmentForm createAssignment() set(….) CreateAssignmentControl check(…)
Software Engineering for Digital Home Exercise 請以 Ch.4 所寫下之學生繳交作業的 use case 為例. 劃出 class diagram & sequence diagram. 19