资源描述
软件体系结构 体系结构评审 Architectural Reviews 孙志岗 2 2021/4/6 Architectural Reviews Architectural reviews are a key step in architecture- based development. They include a method (such as SAAM or ATAM), but the full practice includes more than that. 体系结构评审是开发过程中的一个重要环节。有专门的评 审方法 (SAAM、 ATAM),但在实践中并不仅仅是这些 We will discuss cost/benefits of architectural reviews different architectural review techniques preconditions for an architectural review architectural review activities outputs from an architectural review 3 2021/4/6 Costs of Architectural Reviews There are three different types of costs of holding regular architectural reviews. direct staff costs 直接员工开销 organizational overhead 组织管理开销 indirect staff costs 间接员工开销 4 2021/4/6 Examples of Direct Staff Costs AT each has a different cost and provides different information. 有很多种评审技术。每种需要不同的开销,提供不同的信 息 These techniques fall into one of two categories. questioning techniques: applied to evaluate any aspect of an architecture for any given reason 提问技术 :用来评价体系结构的任何方面 measuring techniques: applied to answer questions about a specific quality 度量技术 :回答关于某项质量的问题 15 2021/4/6 Questioning Techniques Scenario-based techniques describes a specific interaction between stakeholders and a system 描述角色与系统交互的过程 example: SAAM, ATAM (partially) Questionnaire-based techniques(基于问卷的技术) Some questions apply to all architectures (especially those in a single domain). 有些问题被用于所有的体系结构,尤其是在单一领域内 Some questions ask about details of a specific architecture. 有些问题询问一个特定结构的细节 Some ask about the development process. “Is there a single architect?” “How do you ensure conformance?” “你们怎样保证一致性?” 16 2021/4/6 Questioning Techniques Questionnaires are reused; they reflect more maturity or experience within a domain. 问卷可以重用;它们体现了在一个领域内 的成熟度和经验是否丰富 Scenarios must be developed anew for each system. 场景必须为每个系统重新开发 17 2021/4/6 Measuring Techniques Metrics: quantitative interpretations of observable measures 量度:可测质量的定量说明 complexity metrics identify areas where modifications may be difficult 复杂度的测量指明在哪个区域修改会很困难 performance metrics suggest areas where bottlenecks may occur 性能的测量提示瓶颈会在哪里发生 Reviews tend to focus on results of metrics 度量的结果 assumptions underlying the interpretation of the metrics (e.g., assumed event distribution) 对度量的解释中的潜在假定 18 2021/4/6 Measuring Techniques Simulations, prototypes, experiments: domain specific models of an architecture or performance model 仿真、原型、实验:建立体系模型或者性能模型 are expensive to create often exist as part of development anyway May answer issues raised by questioning technique 可以回答提问技术提出的问题 “ What evidence do you have that performance is adequate?” “你凭什么说可以达到这个性能?” 19 2021/4/6 Properties of Review Techniques 评审技术 通用性 细节等级 阶段 被评审对象 提问 技术 问卷 通用 粗糙 早期 设计和过程 场景 特定系统 中等 中期 设计 度量 技术 度量 通用或者特定领域 好 中期 设计 仿真 原型 实验 特定领域 不定 早期 设计 20 2021/4/6 Review Process An architectural review has three major elements. preconditions: the set of necessary assets and conditions that must be in place before a review can be performed successfully 前提 :评审成功进行之前,必要的资源和条件必须到 位 activities of the review itself 活动 :评审本身 outputs: the report of review results 输出 :评审结果报告 21 2021/4/6 Review Preconditions Understand the context of the review 理解评审的上下文 Assemble the right people 集合正确的人 Set organizational expectations and support 期望和支持 Prepare for review 为评审做准备 Obtain representation of the architecture 获得体系结构文档 22 2021/4/6 Preconditions: Context Planned review part of normal development activity 正常开发活动的一部分 non-adversarial(非敌对性的) scheduled well in advance(事先安排好日程) built into projects schedule and budget 包含在项目日程和预算之内 Unplanned usually occurs when project is in trouble 通常在项目出现问题时采用 often devolves into finger-pointing 导致互相责备 can be painful for project already struggling 对于已经苦苦挣扎了很久的项目而言,有些痛苦 23 2021/4/6 Preconditions: Context Timing of the review early “architecture discovery review” is done after requirements are set, but before the architecture is firm 需求分析之后,体系结构还没有确定之前进行 is used to understand implications of requirements on architecture 用来理解需求在体系结构方面的隐含内容 checks for requirements feasibility(检查需求的可行性) prioritizes architectural goals(为质量目标排序) full architectural review is done when architectural documentation is available 体系结构文档可用时进行 is used to evaluate qualities of proposed architecture 评价被评体系结构的质量 24 2021/4/6 Preconditions: People Representatives of project(项目代表) architect designers of major modules stakeholders representatives Review team members (ideally, a separate unit) 评审团成员 (理想情况下是一个独立组织 ) at least one domain expert included 至少有一个领域专家 someone to handle logistics (e.g., meeting rooms, supplies) 后勤人员 (会议室、茶水、食品 ) librarian to organize documentation 文档管理员 “ apprentice reviewer” for growth 成长中的评审员学徒 25 2021/4/6 Preconditions: Review Team The review team must be assembled so that members are perceived as impartial, objective, and respected 成员要公正、客观和被尊重 members devote their full-time effort to the review 成员全心加入评审 members are fluent in architecture and architectural issues 成员要训练有素而且口才好 it is located close to artifacts being examined 有足够的权限检查被评审材料 26 2021/4/6 Preconditions: Review Team The team must have access to applicable domain knowledge (perhaps via consultants to the team) 适当的领域知识 design documents 设计文档 review criteria 评审标准 support staff 支持人员 27 2021/4/6 Preconditions: Organizational Expectations A contract between the review team and the sponsor of the review must be established. Who will be told what upon completion? 结束后,哪些内容可以被告诉哪些人 What will (not) be the review criteria? 什么是 (不是 )评审标准? What/who will be made available to team? 哪些人和物是评审团可以使用的? What follow-up is expected? 希望评审的结果如何? How long will the review take? 要评审多久? 28 2021/4/6 Preconditions: Organizational Expectations Organizational culture and support must be considered. Are reviews part of the standard project life cycle? 评审是项目的基本生命周期的一部分吗? Is serving on a review team considered good for ones career? 为评审团服务是份好差事吗? Will the organization allow its superior designers time off from their projects to serve on review teams? 企业允许它的高级设计师把他的项目放在一边来参加评审吗? Is there a standing review organization (even though members may rotate on and off)? 有常设的评审组织吗 (即便成员常进进出出 )? 29 2021/4/6 Preconditions: Read-Ahead Material For project being reviewed questionnaires scenarios (These are created as part of the review, but time should be allowed for project members to digest the information.) For review team description of architecture rationale for architecture Ideally, material will address the review questions. (Passing this test because the questions were known in advance is not cheating, but good engineering!) 理想情况,材料要能说明评审时的问题 30 2021/4/6 Preconditions: Ranked Quality and Behavioral Requirements Plan to examine three to five quality and behavioral requirements. 计划检查 3到 5个质量和行为需求 A particular representation medium (language) for the architecture is not necessary. As long as the information can be extracted (using project members as necessary), the form of the representation is not important. 一个专门的体系结构表述媒体 (语言 )目前并不是 必须的。由项目成员来讲解信息,表述的形式并 不重要 31 2021/4/6 Review Activities Evaluate “Run” the scenarios and ask the questions, or answer the items in the checklist. 按场景执行,并询问相关问题;或者回答问卷里的问 题 Perform the experiments.(演示实验) Execute the prototypes or simulations. 运行原型或仿真程序 Record critical issues highlighted in the review 评审中发现的严重问题 comments of project members on these issues 项目成员对这些问题的说明 32 2021/4/6 Review Activities Rank the issues project-threatening(生死攸关) major minor Each issue raised should be addressed in terms of changing the architecture relaxing the requirements 33 2021/4/6 Review Activities Warning signs architecture forced to match organization 组织模式影响体系结构 top-level components number over 25 顶层组件数超过 25个 one requirement drives entire design 一项需求决定整个设计 architecture depends on alternatives in the operating system 体系受操作系统选择的影响 34 2021/4/6 Review Activities Warning signs choice of software components is dictated by hardware personnel 由硬件人员选择软件组件 redundancy not needed for reliability 面对可靠性时,不考虑冗余手段 design is exception driven 零散的小的事件影响设计 no identifiable architect 没有确定的架构师 35 2021/4/6 Output from Review Set of ranked issues supporting data contained in formal report feedback to project Enhanced system documentation 增强的系统文档 Set of scenarios for future use 将来会用到的场景集 Identification of potentially reusable components 认定潜在的可重用组件 Estimation of costs and benefits 估算成本和收益 36 2021/4/6 SAAM: Software Architecture Analysis Method 一种简单的基于场景的评审技术 37 2021/4/6 Qualities Are Too Vague for Analysis Is the following system modifiable? 这个系统具有适应性吗? Background color of the user interface is changed merely by modifying a resource file. 通过修改资源文件,可以改变界面的背景色 Dozens of components must be changed to accommodate a new data file format. 必须修改许多组件才能适应新的文件格式 A reasonable answer is 一个合理的答案: yes with respect to changing background color 有 ,从改变背景色的角度来看 no with respect to changing file format 没有 ,从改变文件格式的角度来看 38 2021/4/6 Qualities Are Too Vague for Analysis Qualities only have meaning within a context. 质量因素只在一定的上下文里才有意义 SAAM specifies context through scenarios. SAAM通过场景指定上下文 39 2021/4/6 Scenarios A scenario is a brief description of a stakeholders interaction with a system. 场景就是一个角色与系统交互过程的简单描述 When creating scenarios, it is important to consider all stakeholders. 建立场景的时候,一定要考虑到所有的角色 Customer、 User、 Developer、 Maintainer、 Attacker The scenarios that are of most interest in a SAAM evaluation are change scenarios. SAAM最关心的是 变化 场景 40 2021/4/6 Steps of a SAAM Evaluation Identify and assemble stakeholders 确认和召集角色 Develop and prioritize scenarios 制定场景,并排好优先级 Describe candidate architecture(s) 描述候选的体系结构 Classify scenarios as direct or indirect 把场景分类为 直接场景 和 间接场景 Perform scenario evaluation 进行场景评估 Reveal scenario interactions 展现场景间的相互影响 Generate overall evaluation 整体评估 41 2021/4/6 Step 1: Identify and Assemble Stakeholders Stakeholder Interest Customer Schedule and budget; usefulness of system; meeting customers (or markets) expectations End User Functionality, usability Developer Clarity and completeness of architecture; high cohesion and limited coupling of parts; clear interaction mechanisms Maintainer Maintainability; ability to locate places of change 42 2021/4/6 Step 1: Identify and Assemble Stakeholders Stakeholder Interest System Administrator Ease in finding sources of operational problems Network Administrator Network performance, predictability Intergrator Clarity and completeness of architecture; high cohesion and limited coupling of parts; clear interaction mechanisms 43 2021/4/6 Step 1: Identify and Assemble Stakeholders Stakeholder Interest Tester Integrated, consistent error handling; limited component coupling; high component cohesion; conceptual integrity Application Builder Architectural clarity, completeness; interaction mechanisms; simple tailoring mechanisms Representative of the domain Interoperability 44 2021/4/6 Step 2: Stakeholders Develop and Prioritize Scenarios Scenarios should be typical of the kinds of evolution that the system must support: 场景应该是系统必须支持的各种演化的典型: functionality development activities change activities Scenarios should represent tasks relevant to all stakeholders. 所有角色都应该能在场景中体现出来 Rule of thumb: 10-15 prioritized scenarios 应该有 10-15个优先的场景 45 2021/4/6 Step 3: Describe Candidate Architectures It is frequently necessary to elicit appropriate architectural descriptions. 通常,对体系结构进行适当的描述是非常 重要的 Structures chosen to describe the architecture will depend on the type of qualities to be evaluated. 以我们需要的质量为依据,选择用来描述 体系结构的结构 46 2021/4/6 Step 4: Classify Scenarios There are two classes of scenarios. Direct scenarios are those that can be executed by the system without modification. 直接场景是那些不需要修改系统就能执行的场景 Indirect scenarios are those that require modifications to the system. 间接场景是那些需要修改系统的场景 The classification depends upon both the scenario and the architecture. 场景的类型因系统而异 For indirect scenarios we gauge the order of difficulty of each change: e.g. a person-day, person- week, person-month, person-year. 对间接场景,我们要度量适应每个变化的难度(工作量) 47 2021/4/6 Step 5: Perform Scenario Evaluation For each indirect scenario identify the components, data connections, control connections, and interfaces that must be added, deleted, or modified 明确其组件、数据连结件、控制连结件和要被增加、删除或修改 的接口 estimate the difficulty of modification 估算修改的难度 Difficulty of modification is elicited from the architect and is based on the number of components to be modified and the effect of the modifications. 修改的难度体现在被修改的组件个数和修改的效果 A monolithic system will score well on this step, but not on next step. 只有一个模块的系统在此项评估可以得到高分,但是 48 2021/4/6 Step 6: Reveal Scenario Interactions When multiple indirect scenarios affect the same components, this could indicate a problem. 当多个间接场景影响同一个组件时,可能引发问题 could be good, if scenarios are variants of each other 可能是好事,当场景是彼此的变体 change background color to green change background color to red could be bad, indicating a potentially poor separation of concerns 可能是坏事,说明模块划分有问题 change background color to red port system to a different platform 49 2021/4/6 Step 7: Generate Overall Evaluation Not all scenarios are equal. 场景生来不平等 The organization must determine which scenarios are most important. 必须明确哪些场景是最重要的 Then the organization must decide as to whether the design is acceptable “as is” or if it must be modified. 评审团得出结论,当前的体系结构设计可行,还 是必须要修改
展开阅读全文