logo资料库

软件工程第九版中文部分答案(手动翻译).pdf

第1页 / 共96页
第2页 / 共96页
第3页 / 共96页
第4页 / 共96页
第5页 / 共96页
第6页 / 共96页
第7页 / 共96页
第8页 / 共96页
资料共96页,剩余部分请下载后查看
Software Engineering 9 – Solutions Manual 1 Software Engineering 9 Solutions Manual IAN SOMMERVILLE These solutions are made available for instructional purposes only. Neither the author nor the publisher warrants the correctness of these solutions nor accepts any liability for their use. Solutions may only be distributed to students and it is a condition of distribution that they are only distributed by accredited instructors using ‘Software Engineering, 9thedition’ as a textbook. The solutions may be made available to students on a password-protected intranet but must not be made available on a publicly-accessible WWW server. ©Ian Sommerville 2010
2 Software Engineering 9 – Solutions Manual ©Ian Sommerville 2010
Software Engineering 9 – Solutions Manual 3 Preface This solutions manual is intended to help teachers of software engineering courses in marking homework questions for students. Each chapter in the book has 10 exercises of different types, which you may set for students either as is or in a modified form. I have supplied answers to 50% of the exercises in this manual. The exercises for which answers have not been supplied are, generally, of 2. 3. one of three types: 1. Simple exercises whose answers can be found in the text of the chapter. There are typically one or two of these questions in each chapter and they are intended to stimulate students to read the chapter. Design problems for which there is a range of solutions and you have to use your judgment to decide if the solution is appropriate. Supplying a solution here would imply that there is only one right answer to the question. Ethics-related questions as the aim of these questions is to encourage students to think about the ethics issues involved. The notion of a right and wrong answer does not apply in this case as the student’s response to the question depends both on their cultural background and on their particular views on a topic. I suggest that these questions should be used to stimulate class discussions rather than as part of class tests. It is important when marking the student’s answers to exercises to see the supplied solutions as a guide only rather than a definitive statement of the only possible answer to the question. It is generally good educational practice to give students credit for what they know and if they produce credible answers that reveal they have thought about the exercise and have some knowledge of the topic, then this should be rewarded. This solutions manual may be used in conjunction with the associated quiz book, which lists short questions and answers for each chapter in the book. These can be used for short class tests to assess if students have read the material or as self-assessment tests which the students complete in their own time. If you think that I have made a mistake in some of these answers (quite possible), please let me know. In some cases, there are obviously several possible answers and you may disagree with my solutions. I’d be delighted to consider including your alternative solutions but I do not have time to engage in detailed email discussions about the exercises in the book. Ian Sommerville January 2010 ©Ian Sommerville 2010
4 Software Engineering 9 – Solutions Manual 1 Introduction 1.3所有专业软件应 具备的四个重要属性 是什什么?建议有时可 能很重要的其他四个 属性。 四个重要属性是可维 护性,可靠性,性能 和可⽤用性。其他可能 重要的属性可能是可 重⽤用性(可以在其他 应⽤用程序中重⽤用), 可分发性(可以通过 处理理器器⽹网络分布), 可移植性(可以在多 个平台上运⾏行行,例例如 笔记本电脑和移动平 台)和互操作性(它 可以与各种其他软件 系统⼀一起使⽤用)。 1.2通⽤用软件产品开发和定 制软件开发之间最重要的 区别是什什么?这对通⽤用软 件产品的⽤用户来说意味着 什什么? 本质区别在于,在通⽤用软 件产品开发中,规范由产 品开发⼈人员拥有。对于定 制产品开发,规范由客户 拥有和控制。这意味着很 重要 - 开发⼈人员可以快速 决定更更改规范以响应某些 外部变更更(例例如竞争产 品),但是,当客户拥有 规范时,必须在客户和开 发⼈人员之间协商变更更,并 且可能有合同影响。 对于通⽤用产品的⽤用户,这 意味着他们⽆无法控制软件 规范,因此⽆无法控制产品 的发展。开发⼈人员可能决 定包含/排除功能并更更改⽤用 户界⾯面。这可能会对⽤用户 的业务流程产⽣生影响,并 在安装新版本的系统时增 加额外的培训成本。它还 可能限制客户改变⾃自⼰己业 务流程的灵活性。 1.2 What is the most important difference between generic software product development and custom software development? What might this mean in practice for users of generic software products? The essential difference is that in generic software product development, the specification is owned by the product developer. For custom product development, the specification is owned and controlled by the customer. The implications of this are significant – the developer can quickly decide to change the specification in response to some external change (e.g. a competing product) but, when the customer owns the specification, changes have to be negotiated between the customer and the developer and may have contractual implications. For users of generic products, this means they have no control over the software specification so cannot control the evolution of the product. The developer may decide to include/exclude features and change the user interface. This could have implications for the user’s business processes and add extra training costs when new versions of the system are installed. It also may limit the customer’s flexibility to change their own business processes. 1.3 What are the four important attributes that all professional software should have? Suggest four other attributes that may sometimes be significant. Four important attributes are maintainability, dependability, performance and usability. Other attributes that may be significant could be reusability (can it be reused in other applications), distributability (can it be distributed over a network of processors), portability (can it operate on multiple platforms e.g laptop and mobile platforms) and inter-operability (can it work with a wide range of other software systems). Decompositions of the 4 key attributes e.g. dependability decomposes to security, safety, availability, etc. is also a valid answer to this question. ©Ian Sommerville 2010
1.4除了了异构性,商业和社 会变⾰革以及信任和安全的 挑战外,还要确定软件⼯工 程在21世纪可能⾯面临的其 他问题和挑战(提示:思 考环境)。 软件⼯工程的问题和挑战 可以发现许多可能的挑 战。这些包括: 开发节能系统。这使它们 在低功耗移动设备上更更有 ⽤用,并有助于减少IT设备 的总体碳⾜足迹。 开发模拟系统的验证技术 (这对于预测⽓气候变化的 范围和规划⾄至关重要)。 开发多⽂文化使⽤用系统 开发可以快速适应新业务 需求的系统 设计外包开发系统 开发抵抗攻击的系统 开发可由最终⽤用户调整和 配置的系统 寻找测试,验证和维护最 终⽤用户开发系统的⽅方法 Software Engineering 9 – Solutions Manual 5 1.4 Apart from the challenges of heterogeneity, business and social change and trust and security, identify other problems and challenges that software engineering is likely to face in the 21st century (hint: think about the environment). Problems and challenges for software engineering There are many possible challenges that could be identified. These include: 1. Developing systems that are energy-efficient. This makes them more usable on low power mobile devices and helps reduce the overall carbon footprint of IT equipment. Developing validation techniques for simulation systems (which will be essential in predicting the extent and planning for climate change). Developing systems for multicultural use Developing systems that can be adapted quickly to new business needs Designing systems for outsourced development Developing systems that are resistant to attack Developing systems that can be adapted and configured by end-users Finding ways of testing, validating and maintaining end-user developed systems 2. 3. 4. 5. 6. 7. 8. 1.5 Based on your own knowledge of some of the application types discussed in section 1.1.2, explain, with examples, why different application types require specialized software engineering techniques to support their design and development. Different application types require the use of different development techniques for a number of reasons: 1. Costs and frequency of change. Some systems (such as embedded systems in consumer devices) are extremely expensive to change; others, must change frequently in response to changing requirements (e.g. business systems). Systems which are very expensive to change need extensive up- front analysis to ensure that the requirements are consistent and extensive validation to ensure that the system meets its specification. This is not cost- effective for systems that change very rapidly. The most important ‘non-functional’ requirements. Different systems have different priorities for non-functional requirements. For example, a real-time 2. ©Ian Sommerville 2010 1.5根据您⾃自⼰己对1.1.2 节中讨论的某些应⽤用程 序类型的了了解,通过示 例例说明为什什么不不同的应 ⽤用程序类型需要专⻔门的 软件⼯工程技术来⽀支持其 设计和开发。 由于多种原因,不不同的 应⽤用程序类型需要使⽤用 不不同的开发技术: 成本和变化频率。⼀一些 系统(例例如消费者设备 中的嵌⼊入式系统)变化 ⾮非常昂贵;其他⼈人,必 须经常改变以响应不不断 变化的要求(例例如业务 系统)。变更更成本⾮非常 ⾼高的系统需要进⾏行行⼴广泛 的前期分析,以确保要 求是⼀一致的和⼴广泛的验 证,以确保系统符合其 规范。对于变化⾮非常快 的系统⽽而⾔言,这不不符合 成本效益。 最重要的“⾮非功能性”要 求。不不同的系统对⾮非功 能性要求具有不不同的优 先级。例例如,⻜飞机中的 实时控制系统以安全为 主要优先级;互动游戏 以响应性和可⽤用性为优 先考虑。互动游戏不不需 要⽤用于实现安全的技 术;安全关键控制系统 不不需要游戏所需的⼴广泛 UI设计。 软件⽣生命周期和交付计 划。⼀一些软件系统具有 相对短的寿命(许多基 于⽹网络的系统),其他 软件系统具有数⼗十年年的 寿命(⼤大型命令和控制 系统)。如果某些系统 有⽤用,则必须快速交 付。⽤用于开发短寿命, 快速传送系统(例例如, 使⽤用脚本语⾔言,原型制 作等)的技术不不适⽤用于 需要允许诸如设计建模 之类的⻓长期⽀支持的技术 的⻓长寿命系统。
6 Software Engineering 9 – Solutions Manual 3. control system in an aircraft has safety as its principal priority; an interactive game has responsiveness and usability as its priority. The techniques used to achieve safety are not required for interactive gaming; the extensive UI design required for games is not needed in safety-critical control systems. The software lifetime and delivery schedule. Some software systems have a relatively short lifetime (many web-based systems), others have a lifetime of tens of years (large command and control systems). Some systems have to be delivered quickly if they are to be useful. The techniques used to develop short-lifetime, rapid delivery systems (e.g. use of scripting languages, prototyping, etc.) are inappropriate for long-lifetime systems which require techniques that allow for long-term support such as design modelling. 1.8 Discuss whether professional engineers should be certified in the same way as doctors or lawyers. These are possible discussion points - any discussion on this will tend to be wide ranging and touch on other issues such as the nature of professionalism, etc. Advantages of certification • Certification is a signal to employers of some minimum level of competence. Certification improves the public image of the profession. Certification generally means establishing and checking educational standards and is therefore a mechanism for ensuring course quality. Certification implies responsibility in the event of disputes. Certifying body is likely to be accepted at a national and international level as ‘speaking for the profession’. Certification may increase the status of software engineers and attract particularly able people into the profession. • • • • Disadvantages of certification • Certification tends to lead to protectionism where certified members tend not to protect others from criticism. Certification does not guarantee competence merely that a minimum standard was reached at the time of certification. Certification is expensive and will increase costs to individuals and organisations. Certification tends to stultify change. This is a particular problem in an area where technology developments are very rapid. • • • ©Ian Sommerville 2010 1.8讨论专业⼯工程师是否 应该以与医⽣生或律律师相 同的⽅方式获得认证。 这些都是可能的讨论要 点 - 任何关于此的讨论 都会涉及范围⼴广泛,并 涉及其他问题,如专业 性质等。 认证的优点 • • • • • 认证能⼒力力。 对⼀一些雇主来说是⼀一个 信号 最低⽔水平 认证改善了了专业的公众 形象。 认证通常意味着建⽴立和 检查教育标准,因此是 确保课程质量量的机制。 认证意味着在发⽣生争议 时承担责任。认证机构 很可能在国家和国际层 ⾯面被接受为“为专业发 ⾔言”。 认证可以提⾼高软件⼯工程 师的地位,并吸引特别 有能⼒力力的⼈人进⼊入该⾏行行 业。 认证的缺点 • • • • 认证倾向于导致保护主 义,认证成员往往不不会 保护他⼈人免受批评。 认证不不保证能⼒力力仅仅是 在认证时达到最低标 准。 认证费⽤用昂贵,会增加 个⼈人和组织的成本。 认证倾向于改变。在技 术发展⾮非常迅速的领 域,这是⼀一个特殊问 题。
Software Engineering 9 – Solutions Manual 7 2 Software Processes 2.1 2.1根据正在开发的系统类型 给出答案的理理由,建议最合 适的通⽤用软件过程模型,该 模型可⽤用作管理理以下系统开 发的基础: ⽤用于控制汽⻋车防抱死制动的 系统⽀支持软件维护的虚拟现 实系统取代现有系统的⼤大学 会计系统交互式旅⾏行行计划系 统,帮助⽤用户计划最低环境 影响的⾏行行程 防抱死制动系统这是⼀一个安 全关键系统,因此在实施前 需要进⾏行行⼤大量量的前期分析。 1. 它当然需要⼀一种计划驱动的 开发⽅方法,并仔细分析需 求。因此,瀑布模型是最合 适的使⽤用⽅方法,也许是在不不 同开发阶段之间进⾏行行正式转 换。 2. 虚拟现实系统这是⼀一个需求 将发⽣生变化的系统,并且将 有⼀一个⼴广泛的⽤用户界⾯面组 件。或许,⼀一些UI原型设计 3. 的增量量开发是最合适的模 型。可以使⽤用敏敏捷过程。 ⼤大学会计系统这是⼀一个系 4. 统,其要求相当⼴广为⼈人知, 并将与许多其他系统(如研 究补助⾦金金管理理系统)结合使 ⽤用。因此,基于重⽤用的⽅方法 可能适合于此。 交互式旅⾏行行计划系统具有复 杂⽤用户界⾯面但必须稳定可靠 的系统。增量量开发⽅方法是最 合适的,因为系统需求将随 着系统的真实⽤用户体验⽽而变 化。 2.3 Giving reasons for your answer based on the type of system being developed, suggest the most appropriate generic software process model that might be used as a basis for managing the development of the following systems: • • • • with the lowest environmental impact A system to control anti-lock braking in a car A virtual reality system to support software maintenance A university accounting system that replaces an existing system An interactive travel planning system that helps users plan journeys Anti-lock braking system This is a safety-critical system so requires a lot of up-front analysis before implementation. It certainly needs a plan-driven approach to development with the requirements carefully analysed. A waterfall model is therefore the most appropriate approach to use, perhaps with formal transformations between the different development stages. Virtual reality system This is a system where the requirements will change and there will be an extensive user interface components. Incremental development with, perhaps, some UI prototyping is the most appropriate model. An agile process may be used. University accounting system This is a system whose requirements are fairly well-known and which will be used in an environment in conjunction with lots of other systems such as a research grant management system. Therefore, a reuse-based approach is likely to be appropriate for this. Interactive travel planning system System with a complex user interface but which must be stable and reliable. An incremental development approach is the most appropriate as the system requirements will change as real user experience with the system is gained. Consider the reuse-based process model shown in Figure 2.3. Explain why it is essential to have two separate requirements engineering activities in the process. ©Ian Sommerville 2010
8 Software Engineering 9 – Solutions Manual 考虑基于重⽤用的流程模型,如图2.3所示。解释为什什么在流程中有两个单独的需求⼯工程活动是必不不可少的。在 基于重⽤用的过程中,您需要两个需求⼯工程活动,因为必须根据要重⽤用的系统/组件的功能来调整系统需求。这 些活动是 初始活动,您可以了了解系统的功能,并对系统应执⾏行行的操作提出⼴广泛的要求。这些应该⾜足够详细地表达,您可 以将它们⽤用作决定系统/组件满⾜足某些要求的基础,因此可以重复使⽤用。 选择系统/组件后,您需要更更详细的需求⼯工程活动,以检查重⽤用软件的功能是否满⾜足业务需求,并确定所需的 更更改和添加。 In a reuse based process, you need two requirements engineering activities because it is essential to adapt the system requirements according to the capabilities of the system/components to be reused. These activities are: 1. An initial activity where you understand the function of the system and set out broad requirements for what the system should do. These should be expressed in sufficient detail that you can use them as a basis for deciding of a system/component satisfies some of the requirements and so can be reused. Once systems/components have been selected, you need a more detailed requirements engineering activity to check that the features of the reused software meet the business needs and to identify changes and additions that are required. 2. 2.4建议为什什么在需求⼯工程过 程中区分开发⽤用户需求和开 发系统需求是很重要的。 ⽤用户和系统要求之间存在根 本区别,这意味着它们应该 单独考虑。 1。 2。 ⽤用户要求旨在从⽤用户的⻆角度 描述系统的功能和特性,⽤用 户必须了了解这些要求。它们 应该⽤用⾃自然语⾔言表达,并且 可能不不会⾮非常详细地表达, 以允许⼀一些实现灵活性。参 与该过程的⼈人员必须能够了了 解⽤用户的环境和应⽤用程序 域。 系统要求⽐比⽤用户要求更更加详 细,并且旨在成为可能是系 统合同⼀一部分的系统的精确 规范。它们也可以⽤用于开发 外包的情况,开发团队需要 完整规范应该开发的内容。 系统要求是在建⽴立⽤用户要求 后开发的。 2.4 Suggest why it is important to make a distinction between developing the user requirements and developing system requirements in the requirements engineering process. There is a fundamental difference between the user and the system requirements that mean they should be considered separately. 1. The user requirements are intended to describe the system’s functions and features from a user perspective and it is essential that users understand these requirements. They should be expressed in natural language and may not be expressed in great detail, to allow some implementation flexibility. The people involved in the process must be able to understand the user’s environment and application domain. The system requirements are much more detailed than the user requirements and are intended to be a precise specification of the system that may be part of a system contract. They may also be used in situations where development is outsourced and the development team need a complete specification of what should be developed. The system requirements are developed after user requirements have been established. 2. 2.6 Explain why change is inevitable in complex systems and give examples (apart from prototyping and incremental delivery) of software process activities that help predict changes and make the software being developed more resilient to change. Systems must change because as they are installed in an environment the environment adapts to them and this adaptation naturally generates new/different ©Ian Sommerville 2010
分享到:
收藏