n 课后习题:
n What are the differences between generic software product development and custom software development?
n Solution:
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 by the customer. Of course, there may be differences in development processes but this is not necessarily the case.
重要区别为:在通用软件的开发过程中,详细说明(规格说明书)由产品开发者来制定,在定制软件产品开发过程中,详细说明(规格说明书)由客户来制定。
n What are the four important attributes which all software products should have? Suggest four other attributes that may sometimes be significant.
n Solution:
For important attributes are maintainability可维护性, dependability 可靠性, performance(efficiency)有效性 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) and inter-operability互用性 (can it work with a wide range of other software systems).
n What is the difference between a software process model and a software process? Suggest two ways in which a software process model might be helpful in identifying possible process improvements.
n Solution:
A software process is what actually goes on when software is developed. A software process model is an abstraction and simplification of a process. Process models can be used to help understand real processes and to identify which aspects of these processes could be supported by CASE tools. 软件过程就是指在软件开发过程中所做的一些事情。软件过程模型是过程的抽象和简化。过程模型可用于帮助理解真正的过程,并可用于识别过程中的哪些方面可用CASE工具支持。
n 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 follow systems:
1) Anti-lock braking system
2) Virtual reality system
3) University accounting system
4) Interactive timetable
Solution:
(a) Anti-lock braking system: Safety-critical 安全鉴定system so method based on formal transformations with proofs of equivalence等价 between each stage.
(b) Virtual reality system: System whose requirements cannot be predicted预知 in advance预先地 so exploratory programming model is appropriate.
(c) University accounting system: System whose requirements should be stable because of existing system therefore waterfall model is appropriate.
(d) Interactive timetable交互式时间表: System with a complex user interface but which must be stable and reliable. Should be based on throw-away prototyping to find requirements then either incremental development or waterfall model.
n Why a software system that is used in a real world environment must change or become progressively(日益增多地) less useful?
n Solution:
Systems must change because as they are installed in an environment the environment adapts to them and this adaptation naturally generates new/different system requirements. 这种适应自然生成新的系统需求
Furthermore, the system\'s environment is dynamic and constantly generates new requirements as a consequence of changes to the business, business goals and business policies.商务的目标以及政治相关Unless the system is adapted to reflect these requirements, its facilities will become out-of-step with the facilities needed to support the business and, hence, it will become less useful.
n Why a good programmers is not always be a good software managers?
n Solution:
Management activities such as proposal writing, project planning and personal selection require a set of skill including presentation 表述能力and communication skills交流的能力. Organizational skills组织能力 and the ability to communicate with other project team members.
Programming skills are distinct from these, it is common that they lack human communication skills他们缺乏交流技巧是一个普遍的事实. So it does not follow that good programmers can re-orient their abilities to be good managers.
管理活动包括提出书面建议,项目规划和进度,人员选择和评价,项目监督和评审,和其他队友的交流能力等。程序设计者的任务就不是这些,他们不需要和人交流的能力,如果按照做好一个程序设计者的要求去做管理者的话,他肯定不是一个号的管理者。
n Why the process of project planning is iterative and why a plan must be continually不断地 reviewed during a software project.
n Solution:
Project planning can only be based on available information. At the beginning of a project, there are many uncertainties in the available information and some information about the project and the product may not be available. As the project develops, more and more information becomes available and uncertainties are resolved. The project plan therefore must be reviewed and updated regularly to reflect this changing information environment.
软件项目地规划取决于有用地信息。在项目进行期间不断产生新的信息,所以必须经常性的修改原有的计划。原本有用的信息可能会不再有用,而原本一些不确定的信息反而会变得有用。最初对象目本身的估算是实验性的,所以计划需要不断的修改。
n Suggest who might be stakeholders in a university student records system.
The stakeholders in a student records system include:
University central administration including those responsible for registration, payment of fees, exams and assessment and graduation. 大学管理中心,包括报到,交纳学费,考试,作业和毕业等
The students whose details are recorded in the system. 记录在这个系统中的学生
University departmental administrators who supply information to the system and use information from it. 大学部门管理者,需要提供和使用这些信息
Academic staff that use information from the system. 使用系统信息的学院成员
Data protection officers (local and national). 数据保护工作者
Potential employers of students(who may require information from the system). 潜在的学生中的雇佣者
在学生记录系统中的参与者包括:
。学校管理中心包括负责学生注册,缴费,考试,评估,毕业事宜的相关人员
。那些被记录具体信息的学生
。把学生信息录入到系统并使用系统信息的学校部门人员
。使用这些信息的学术人员
。数据安全人员(本地和国家的)
。潜在的雇用学生的人(或许需要用到这个系统里面的信息)
7.3 For three of the viewpoints identified in the library system. LIBYSY, suggest three requirement that could be suggested by stakeholders associated with that viewpoint.
Solution:
You can tackle this problem using a brainstorming approach. Obviously, there are many alternatives to the solutions suggested here. Note the printing conflict is deliberate.
Viewpoint: Library manager
Requirement: Access to the LIBSYS system shall be restricted to accredited users of the library.
Requirement: The LIBSYS system shall provide a reporting facility that allows usage reports (who used the system, how often, what libraries were accessed) to be created and printed.
Requirement: The LIBSYS system shall be configured so that only document printing on specific library servers is permitted.
Viewpoint: Users
Requirement: The LIBSYS system shall be accessible from any location, including locations away from the university campus.
Requirement: It shall be possible to save LIBSYS queries, recall them and modify them for subsequent use.
Requirement: The LIBSYS system shall allow documents to be printed on user printers.
Viewpoint: System managers
Requirement: The restart time of the LIBSYS system after failure shall not exceed 5 minutes.
Requirement: The LIBSYS system shall provide a backup facility for user’s personal workspaces.
Requirement: The LIBSYS system shall be available for a range of platforms including Windows 2000, Windows XP and Mac OS X.
7.4 The LIBSYS system has to include support for cataloguing new documents where the system catalog may be distributed across several machines. What are likely to be the most important types of non-function requirement associated with the cataloguing facilities?
n Solution:
Important non-functional attributes for the cataloging services might be:
• Availability (because the system may be required at any time)
• Security (because the books data base musn’t be corrupted)
• Efficiency (because the system must respond quickly to each transaction)
For the browsing services, usability is also very important as these services should be easy to use without extensive training.
n Discuss an example of a type of system where social and political factors might strongly influence the system requirement. Explain why these factors are important in your example.
n Solution:
An example of a system where social and political factors influence system requirements is a system to manage the costs of public healthcare. Politicians are anxious both to control costs and to ensure that the best public image of the healthcare system is provided. There is a potential conflict in such a system between administrators who are driven by treatment costs and doctors who are (or should be) driven by treatment effectiveness. The requirements for the system might therefore embed particular policies which are included as a result of organizations factors (e.g. ensure that administrators can vet treatment costs) rather than technical requirements.
社会和政治因素影响系统需求的一个例子是管理成本和公共卫生保健的系统。政治家们对控制成本和确保提供最好的卫生保健系统都很关心。在这样一个系统中这本来就是一对潜在的矛盾,系统管理人员关心的治疗成本而医生们关心的治疗效果。此时系统需求可能要建立在特殊的包括一系列组织因素的政策上而不是技术需求。
n 11.1 Why it may be necessary to design the system architecture before the specification are written?
Solution:
The architecture may have to be designed before specifications are written to provide a means of structuring the specification and developing different sub-system specifications concurrently, to allow manufacture of hardware by sub-contractors and to provide a model for system costing.
体系结构设计过程输出了一个体系结构的设计文档,这样的设计文档包含了一系列图形化的系统模型描述和一些相关的描述文本。该文当描述了系统如何有子系统构成以及每个子系统如何有模块构成。
11.4 Giving reasons for your answer, suggest an appropriate structural model for the following systems:
1. an automated ticket-issuing system used by passengers at a railway station
2. a computer-controlled video conferencing system that allows video, audio and computer data to be visible to several participants at the same time.
3. a robot floor-cleaner that is intended to clean relatively clear spaces such as corridors, the cleaner must be able to sense walls and other sbstructions.
Solution:
Ticket issuing system . The most appropriate architectural model is a centralised model with a shared repository of route and pricing information. This means that changes are immediately available to all machines. As little local processing is necessary, there is no real advantage in
a client-server architecture. The centralised system also allows global information and route use to be collected and processed.
Video conferencing system. The most appropriate is a client-server model. The reason for this is the need for a lot of local processing to handle multimedia data.
Robot floor cleaner. The most appropriate model is a repository model where all sub-systems place information in the repository for other sub-systems to use. In the case of AI systems as this would be, a special kind of repository called a blackboard is normally used.
n 11.4.1一个在铁路站旁,供乘客使用的自动售票系统
答:自动售票系统。最合适的架构模型是有共享数据仓库和定价信息的集中式控制模型。当使用这种模型时,所有机子能立即获取改变的信息。由于没有局部处理的必要,所以使用客户/服务架构没有什么优势。 集中式控制系统允许全局信息和路径被收集和处理。
n 11.4.2一个允许在同一时间段,视频,音频,计算机数据对很多参与者是可见的计算机控制视频会议系统
答:视频会议系统。最合适的是使用客户/服务模型。很多局部过程用来处理多媒体数据。
n 11.4.3一个清洁机器人,主要用来清理一些地方比如走廊。该清洁机器人必须能感应墙和其他的障碍物。
答:清洁机器人。最适合的模型是贮藏式模型。这时所有的子系统把信息存放在其他子系统得贮藏室,以备后用。以AI系统为例,一种特殊的贮藏室叫做“黑板”被使用
n 11.8 Discuss their advantages and disadvantages as far as distributability is concerned of the data-flow model and the object model. Assume that both single machine and distributed versions of an application are required.
n 就分布性讨论数据流模型和对象模型的优点和缺点。假设应用程序的淡季和分布式版本都是必需的。
n Solution:
Both models can be distributed where each transformation in a DFD is implemented as a separate process and each object is implemented as process. Problem with functional decomposition is the need for shared state which must also be implemented as one or more processes. In the object model, distributing objects is a problem if inheritance is involved as this creates a lot of network traffic.
两种模型都能作为分布式,数据流程图中的每个转换都可以看作是个分离的过程,而每个对象也可以作为过程实现。函数的分解需要共享状态,并表示为一个或多个过程。在对象模型中分布对象是个问题,对象如果继承的话就如同它的创建一样会造成很多网络阻塞。
n 14.2 Using examples, explain the difference between an object and an object class.
n Solution:
n 用例子,解释对象和对象类之间的不同。
An object class is a generic description of a set of entities (or objects) which have common characteristics and which are recognizably the same in some or all respects. Objects are specific instances in the real-world or in a system where values have been assigned to the characteristics defined in the object class. The set of values assigned to the object characteristics may distinguish that object from all other objects but need not do so. In the real-world, we only see objects and construct object classes as abstract entities. In programs, we often only define object classes and construct objects whose lifetime is no longer than the execution time of the program.
对象类就是定义实体(或者说对象)的类型说明,包含可以被识别的相似的公共特征。对象是真实世界或是在系统中的通过对象类对其属性进行赋值的特殊实例。给对象的赋值操作可用于识别与其他所有对象的区别,尽管不需如此。在现实世界中,我们只能看到对象和作为抽象实体的构造对象类。在程序中,我们通常可以定义对象类和构造对象,它们的声明周期不超过程序的执行时间。
n An example of an object class is a BOOK which has attributes (characteristics) such as AUTHOR, TITLE, PUBLISHER, DATE OF PUBLICATION, etc.
一个叫做“BOOK”的对象类的例子,属性有诸如……
n An example of an object or instance of this object class is the specific book:
一个关于这个对象类的对象的例子“specific book”
n AUTHOR: Ian Sommerville
n TITLE: Software Engineering
n EDITION: 7
n PUBLISHER Addison-Wesley
n DATE 2004
n If we wished to define a book object which was distinct from all other objects, we would need to add another characteristic to the object class such as OWNER.
n 16.2 Suggest situations where it is unwise or impossible to provide a consistent user interface.
n 说明在什么情况下提供前后一致的用户界面是不明智的或是不可能的。
n Solution:
A consistent user interface may be impossible to produce for complex systems with a large number of interface options. In such systems, there is a wide imbalance between the extent of usage of different commands so for frequently used commands, it is desirable to have short cuts. Unless all commands have short cuts, then consistency is impossible.
It may also be the case in complex systems that the entities manipulated are of quite different types and it is inappropriate to have consistent operations on each of these types.
An example of such a system is an operating system interface. Even MacOS which has attempted to be as consistent as possible has inconsistent operations that are liked by users.
For example, to delete a file it is dragged to the trash but dragging a disk image to the trash does not delete it but unmounts that disk.
一致性的用户界面也许不可能提供给拥有大量选项的复杂系统。在这样的系统中,经常使用的不同命令的使用程度有很大差异,因此我们希望用快捷方式。除非所有的命令都有快捷方式,否则一致性的界面是不可能的。
此外在复杂的操作界面中有不同类型的操作实体,这些不同类型的操作实体拥有相同的操作是不可能的。
开放型操作系统就是这样一个系统的例子。甚至是竭力做到尽可能一致性界面的苹果操作系统(MacOS)都会根据不同的用户喜好而由此产生矛盾。
再举个例子,用户要删除一个文件,只要把它拉到垃圾回收站,而删掉一个磁盘映像可不能这样,那要卸载那个磁盘。
n 16.3 What factors have to be taken into account in the design of menu-based interface for ‘walk-up’ system such as bank ATMs? Write a critical commentary on the interface of an ATM that you use.
n 在为“临街的”系统(如ATM机)涉及基于菜单的界面时,必须考虑哪些因素?请对你所使用的ATM机的界面提出批评意见。
Solution:
Factors to be taken into account when designing \'walk up and use\' systems are:
• System users may be infirm, or disabled so will not be able to respond quickly to requests.
• Users may not be able to speak the native language of the country where the machine is installed.
• System users may be completely unfamiliar with technology and may make almost any kind of error in using the machine. The interface must minimise the number of possible errors and must be resilient to any possible error.
• Some system users are likely to be intimidated by many options. On the other hand, as users gain familiarity with the system, they may expect to use it for a wider range of banking services.
• Different people may understand the meaning of icons in different ways.
• If the system has navigation options, users are almost certain to become lost.
• Most users will want to use the system for very simple functions (e.g. withdraw cash from an ATM) and will want to do this as quickly as possible.
There are many different ATM interfaces so each must be considered separately. Problems which I have found are:
When is it possible to cancel a transaction? What happens when I do so? What will I have to re-input if I restart the transaction?
There is not usually any way of saying give me the maximum amount of money I may withdraw today.
Some machines only support single transactions - there is no way of saying I will be making several transactions and the same validation process is applicable to all of them.
n 16.5 Discuss the advantages of graphical information display and suggest four applications where it would be more appropriate to use graphical rather than digital displays of numeric information.
n Solution:
n 试述图形显示的优点,指出适合用图形显示数值而不适合用数字显示的四种应用。
Advantages are ‘at a glance’ magnitude indication and relative magnitude indication. Any applications where these are important might be mentioned:
• Temperature control
• Speed indicators
• Weather statistics
• Relative comparisons of cars, etc.
优点是匆匆一眼就能获得数值暗示和相对数值暗示。
这里有四个适于图形显示信息,而不适用于数字显示信息的例子.
温度计 速度指示器 气候统计表 一些相关的比较表格.
n 17.3 When would you recommend against the use of an agile method for developing a software system?
n 你在什么情况下会建议不采用敏捷方法进行软件系统开发?
Agile methods should not be used when the software is being developed by teams who are not co-located – if any of these teams use agile methods, it is very difficult to coordinate their work with other teams. Agile methods should probably also be avoided for critical systems where the consequences of a specification error are serious. In those circumstances, a system specification that is available before development starts makes a detailed specification analysis possible. However, some ideas from agile approaches such as test first development are certainly applicable to critical systems.
当几个软件开发团队不在同一个地方时不可用敏捷方法。如果其中一个团队用了敏捷方法,就很难跟其它团队协调工作.敏捷方法也要避免用在关键系统,在规格错误的情况下如果用这个方法,会导致严重的后果.在开发系统之前规格就可以用的情况下,可以做详细的规格分析使用敏捷方法成为可能.然而,一些敏捷方法中的思想像 测试优先开发(Test First Development–TFD 又称先行测试开发)当然是可以适用于关键系统的.
n 17.5 Explain why test-first development helps the programmers develop a better understanding of the system requirements. What are the potential difficulties with test-first development?
n 解释为什么测试优先开发能帮助程序员获得对系统需求的更好的理解。测试优先的开发有什么潜在的困难。
Test-first development helps with understanding the requirements because, in order to write a test, you have to analyse the requirements in detail to discover what is intended. In many cases, you may find that writing a test is impossible because the requirements are incomplete.
The problem with test-first development is that some tests are very difficult to write because they require a system infrastructure to be in place before anything can be tested.
n 测试优先开发帮助我们更好地理解需求,因为你要写一个测试程序,就需要分析需求,探究详细意图。
n 有时候,在需求不全的情况下,你会发现写一个测试是不可能的。测试优先开发的问题就在于是一些测试很难写,因为在任何一个测试之前都要一个就绪的系统底层结构.
n 17.6 Suggest four reasons why the productivity rate of programmers working as a pair is roughly the same as two programmers working individually.
n 给出四个理由说明为什么结对编程和单个程序员编程的软件生产率基本上是一样的。
Reasons why pair programming is as efficient as the same number of programmers working individually:
Pair programming leads to continuous informal reviewing. This discovers bugs more quickly than individual testing.
Information sharing in pair programming is implicit – it happens during the process.
Individual programmers have to spend time explicitly sharing information.
Pair programming encourages refactoring (the code must be understandable to another person). This reduces the costs of subsequent development and change.
In pair programming, people are likely to spend less time in fine-grain optimization as this does not benefit the other programmer.
结对编程和同等数量的编程人员单独编程一样有效的原因:
1.结对编程会引发连续非正式地复查,这样会比单独编程更快地发现错误。
2.结对编程过程中,信息是共享的。单独编程中,人们不得不花时间来共享信息。
3.结对编程鼓励重构(代码需要让其他人看懂),这样减少了后期开发和变动的成本。
4.结对编程可能花更少的时间在细节优化上,因为这对其他程序员来说没有好处。(译者注:没看懂)
n 17.8 A software manager is involved in the project development of a software design support system
n that supports the translation of software requirements to a form software specification. Comment on the advantages and disadvantages of the following development strategies:
n 假设一个软件管理者参与了一个开发某个软件设计支持系统的项目,此系统是要支持将软件需求翻译成形式化软件描述。请评论下列开发策略的优点和缺点。
a)* Develop a throw-away prototype, evaluate, it then review the system requirements. Develop the final system using C.
开发抛弃式原型,评估,然后审查系统需求。用C语言开发此系统。
Throw-away prototyping
Fast development and rapid feedback from users.
Likely to result in reasonable requirements.
Needs multiple development languages.
Costs more.
丢弃原型化方法:
快速的开发和快速的用户反馈.
可以带来合理的需求.
需要多种开发语言.
花费更高.
n b)* Develop the system from the existing requirements using Java, the modify it to adapt to any changed user requirements.
n 适用java从现存的需求开始开发系统,然后修改它使之适应任何变更的用户需求。
Develop using C and X-windows
Fewer problems with training.
Known management strategy.
Requirements likely to be wrong so needs post-delivery modification.
训练几乎没问题
已知的管理策略.
需求可能的错误的,所以要交付修改.
n c)* Develop the system using incremental development with a user involved in the development team.
n 适用增量式方法并让用户参与到开发团队来开发此系统。
Evolutionary prototyping
Fast feedback from users.
Rapid system delivery.
Readily adapted to evolving requirements.
Hard to manage.
Lack of standards for portability etc.
Likely to be unstructured causing future maintenance problems.
进化的方法.
快速的用户反馈.
快速的系统交付.
容易适应改变的需求.
很难管理
缺少可移植性的标准.
无特定系统结构,将导致以后的维护困难.
n 18.2 Suggest why the saving in cost from reusing existing software is not simply proportional to the size of the components that are reused.
n 解释下为什么通过复用已有的软件所节省的成本并不简单地与所适用的组件规模成比例。
n Solution:
If savings from reuse were proportional to the amount of code reused, then reusing 2000 lines of code would save twice as much as reusing 1000 lines of code. However, to reuse 2000 lines of code, that code must be understood and the costs of program understanding are not linear – the more code to be understood, the more effort it takes to understand it.
Furthermore, more changes may be required, the larger the amount of code reused so this also adds to the costs of reusing more code.
Of course, all this is only true if the code has to be understood before it is reused. If it can be reused without change, then savings from reusing large chunks of code tend to be proportionally greater than savings from reusing small code fragments.
如果复用节约的成本和复用的代码成比例,那么复用2000行代码就相当于复用两次1000行代码了。然而,复用2000行代码,那些代码必须要被理解,程序理解的费用不是线性的——越多的代码,就需要越多的努力去理解的。
而且,当需要更多的改动时,就需要更大量的代码复用,这也增加了成本。
n 18.3 Give four circumstances where you might recommend against software reuse.
n 给出你认为不应该适用软件复用的4种情况。
Solution:
Circumstances where software reuse is not recommended:
If the business status of the code provider is dubious. If the provider goes out of business, then no support for the reused code may be available.
In critical applications where source code is not available. Testing the code to the required standards may be very difficult.
In small systems where the costs of reuse are comparable to the savings that result if code is reused.
In systems where performance is a critical requirement – specially developed code can usually be made more efficient.
n 一如果代码提供商的运作状况不确定,或者提供商歇业,不支持代码的复用。
n 二关键部分的代码不可用。要测试这些代码以达到所需标准,可能非常困难。
n 三再利用所花的成本和再利用所节省下来的差不多的小型系统
四在一些关键需求在于性能的系统里,专门开发的代码通常更有效率。
n 18.4 Why are patterns an effective form of design reuse? What are the disadvantages to this approach to reuse?
n 为什么模式是一种有效的设计复用形式?这种复用方式的缺点是什么?
Patterns are an effective form of design reuse because the reflect accumulated wisdom that has been collected over several applications rather than a single application (By definition, a pattern is something that should appear in more than one application). There are two problems with patterns for reuse. The first is knowing which patterns actually have been documented and then finding these patterns - the time taken to do this can be significant. The second is that patterns are by their nature generalisations so their performance is likely to be limited. If performance is critical, then a special-purpose tailored approach to a problem will almost always be more effective.
n 模式是一种有效的再利用设计,是因为它是很多人在应用中积累出来的智慧.这种方法有两种缺点:
n 知道哪一个模式被存档,找到这些模式所花的时间是必要的.
n 2.很多模式是一般化的,很多性能可能被限制.如果性能是主要要求的话,那么为某一个问题问题特别研究的方法总是更有效率的.
n Identify six possible risks that can arise when systems are constructed using COTS. What steps can a company take to reduce these risks?
n Risks that can arise when systems are constructed using COTS include:
n Vendor risks: Failure of vendor to provide support when required
n Vendor goes out of business or drops product from its portfolio
n Product risks: Incompatible event/data model with other systems
n Inadequate performance when integrated with other systems
n Product is undependable in intended operating environment
n Process risk: Time required to understand how to integrate product is higher than expected.
n The risks can be addressed by only dealing with vendors that use an escrow system so that source code is available if they go out of business, by extensive research and testing of product capabilities before use, discussion with other users etc. In general though, because
n COTS are provided by external vendors, risk reduction is difficult.
n 卖主风险:卖方无法提供必要的支持,卖方歇业或结束产品开发.
n 产品风险:和其它系统不兼容,和其它系统组装时性能下降,在特定环境下,产品不可靠.
n 过程风险:理解如何组装产品的时间超出预期.
n 可以通过使用第三方系统来解决.这样的话,可以通过深入的研究,投入使用前的产品兼容性的测试,和其它用户讨论等方法来保证源代码的可用,如果卖方歇业的话.
n 通常,COST是由卖方提供的,要减少风险是困难的.
n 19.1 Why is it important that all component interactions are defined through “requires” and “provides” interfaces?
n It is important to define all interactions through requires and provides interfaces so that the use of the component is completely independent of its implementation. If component interactions use some knowledge of the components that is not defined in the requires/provides interfaces then the coupling between the components is increased and it is harder to interchange one component for an equivalent component with the same interfaces.
n 19.3 What are the fundamental differences between components and web services (see Chapter 12).
n Once a component is purchased, it is owned by the user whereas the web service is always owned by the provider. This is significant because it means that the owner has no control over changes to the service – if it changes (or disappears) then this may have adverse consequences for the user. With components, however, the user decides when newer versions are to be used.
n Payment for services is by utilization so that users don’t have to buy an expensive component that is only occasionally used.
n Component interactions can use much more efficient protocols than web services so components are better suited to high throughput/performance applications.
n There is a single standard for services against several competing standards for components so service inter-operability is (should be) much better.
Web服务只有单一的一个标准,组件则有多个标准,因此服务的内部操作性会更好。
服务的付费是按使用权计算的(你要用时再付费,不用时,可以停止付费),这样用户就不用为一个偶尔使用的组件,支付昂贵的费用。
组件的交互可以作用比Web服务更有效的协议,因此组件更适用于高吞吐量/高性能要求的应用。
一旦一个组件被购买,它就属于用户所有。而与此相反,Web服务总是被提供商拥有,这就意味着用户对于服务的更改永远没有控制权,如果服务变更(或消失),那么可能对用户很不利。而组件不同,用户可以决定什么时候使用新版本。
n 19.6 Explain why it is very difficult to validate a reusable component without the component source code. In what ways would a formal component specification simplify the problems of validation?
n Component validation without source code is very difficult because there is no way of assessing how the component handles exceptions (and this is rarely defined in a component specification). The only validation method that can be used is black-box testing so static techniques cannot be used. Component specifications are rarely complete and this increases the problems of black-box testing. Formal specifications would help because they would precisely define what the component was supposed to do and its actual behaviour could be compared to the specification. However, formal specification rarely cover all exceptions and they do not help with testing performance, dependability or other non-functional characteristics.
因为在没有源代码的情况下,我们无法知道该组件是如何处理异常的。唯一的办法就是黑盒测试。因为组件的详细规格说明书很少是完整的,黑盒测试也有很大的困难。标准的详细规格说明书定义了组件的功能,尽管能提供一定的帮助,但是标准的说明书也很少说明全部的异常,它并不能帮助我们测试组件的性能,可靠性或其它的非功能性特征。
n 19.8 Using examples, illustrate the different types of adaptors needed to support sequential composition, hierarchical composition and additive compositions.
n In sequential composition, Component C is created by composing A and B in sequence i.e. A; B. In hierarchical composition, Component C is created from Component B calling component C. In additive composition, Component C is created by integrating the interfaces of component A and component B to create the interface of component C.
n 顺序组合的例子:部件C是由部件A和部件B依次组合而成的。
n 附加组合的例子:部件C是由部件A的界面和部件B的界面组成的。
层次组合的例子:部件C是由部件B组成的,而部件B是由部件C组成的。
n 23.1 Explain why testing can only detect the presence of errors, not their absence.
n Assume that exhaustive testing of a program, where every possible valid input is checked, is impossible (true for all but trivial programs). Test cases either do not reveal a fault in the program or reveal a program fault. If they reveal a program fault then they demonstrate the presence of an error. If they do not reveal a fault, however, this simply means that they have executed a code sequence that – for the inputs chosen – is not faulty. The next test of the same code sequence – with different inputs – could reveal a fault.
n 23.3 What is regression testing? Explain hoe the use of automated tests and a testing framework such as Unit simplifies regression testing.
n Regression testing is the process of running tests for functionality that has already been implemented when new functionality is developed or the system is changed. Regression tests check that the system changes have not introduced problems into the previously implemented code. Automated tests and a testing framework radically simplify regression testing as the entire test set can be run automatically each time a change is made. The automated tests include their own checks that the test has been successful or otherwise so the costs of checking the success or otherwise of regression tests is low.
回归测试是指修改了旧代码后,重新进行测试以确认修改没有引入新的错误或导致其他代码产生错误。如果设置了自动回归测试,在每次修改代码之后都会自动进行测试,简化了回归测试的工作。一个自动化的测试包括成功的自身测试和其他测试。这样成功的测试成本和回归测试成本较低。
n 23.6 What are the problems in developing performance tests for a distributed database system such as the LIBSYS system?
n The major problems in developing performance tests for such a system are:
n Because it is impossible to replicate the real use of the system in practice, you have to write a simulator that simulates its use under load. However, as you don’t have experience of the load, then its hard to test the accuracy of the simulator.
n 2. The LIBSYS system will not necessarily run on dedicated computers – they may be running other applications at the same time. The performance of the overall distributed system is affected by these other applications. During testing, this situation cannot be replicated.
n The distribution in data in practice is unknown. The data distribution affects the number of hits on a particular server so the initial assumptions about data may be inaccurate.
n 在软件测试一个系统中碰到的主要问题是:
n 在实际中你不能重复测试一个系统,所以你必须用一个模拟器来模拟系统的使用。然而,你没有系统实际工作的经验,用一个模拟器很难测试系统工作时的准确性。
n2.LIBSYS系统不一定在专用的电脑上工作――该系统也可以同时在其他应用系统上工作。其他应用系统也会影响整个分布式系统的工作。在测试的时候,这些情况不会重复发生。
n3.事实上数据的分布是未知的。数据分布受到特定的服务器的影响,所以对于数据的最初的假设可能是错误的。
n 23.7 Explain why interface testing is necessary even when individual component have been extensively validated through component testing and program inspection.
n There are several reasons why interface testing is a necessary stage after unit testing:
n • The interface to the module may have been incorrectly specified. The validation process is based on this
n
n specification rather than actual usage of the module or sub-system.
n • The assumptions made by other modules about the behaviour of a given module (A say) in response to particular
n
n interface stimuli may be incorrect. That is, these modules expect A to behave in a way in which it was never
n
n designed to operate.
n • Interface testing can reveal omissions in the interface design. It may be discovered, when integrated with other
n modules, that the interface must be augmented in some way.
n 在单元测试后接口测试的重要性:
n ①单元的接口可能没有明确的说明。确认这个单元的接口是以他的详细规格说明书为基础而不是以单元或者子系统在实践中的使用为基础的。
n ②假设了某些单元的操作,接口测试可以检测由这些单元组成的接口是否正确,有效。
n ③接口测试可以揭示在接口设计时的遗漏和错误。当接口和其他的单元组合在一起的时候这些错误会被发现,那么这些遗漏和错误可以被加到这个接口中。
n 26.1 Under what circumstance might a company charge a much higher price for a software system than that suggested by the cost estimate plus a normal profit margin?
n Circumstances where a high price might be charged:
n Where a customer expects the developer to take on a considerable amount of project risk.
n (b) Where the customer has special requirements e.g. for very rapid delivery.
n (c) When the work is not central to the companies business and so diverts people from other more business-focused activities. The high price is intended to compensate for this.
n (d) When the customer has no alternative! Think about the ethics of excessive pricing in this situation.
n ①客户要开发者自己承担大部分的项目风险。
n ②客户有一些苛刻的要求,比如开发的时间比较短,要快速开发。
n ③开发软件这个工作不是公司主要的业务,所以为了开发项目必须从其他的业务上调派人手过来,那么就需要补偿给这些人更多的钱。
n ④客户很自私,只考虑到自己不能承担太多的钱。
n 26.2 Description two metrics that have been used to measure programmer productivity. Comment briefly on the advantages and disadvantages of each these metrics.
n Solution:
n Metrics that have been used for productivity measurement are:
n • Lines of source code produced per unit time
n • Object code instructions per unit time
n • Pages of documentation per unit time
n Other possibilities are:
n • Number of data dictionary entries made per unit time (may be useful if CASE tools are used)
n • Number of mathematical definitions produced per unit time (formal specification)
n • Number of requirements written per unit time
n • Number of design diagrams produced per unit time
n All of these, of course, suffer from the same problem as other metrics, that is, they don’t take quality into account.
n 26.8 Explain how the algorithmic approach to cost estimation may be used by project managers for option analysis. Suggest a situation where managers may choose an approach that not based on the lowest project cost.
n • Produce worst, best and most likely cost estimates using simple model.
n • Identify process and product variables such as team experience, possibility of hardware upgrade, possibility of tool purchase, etc.
n • Build a spreadsheet model allowing the effects of these variables on the cost estimates to be computed.
n When there are organisational reasons, some approach which is relatively more expensive may be chosen. For example, software engineers whose experience is not ideal may be available so they may be used rather than recruit new staff.
n 使用算法模型进行项目估算,估算者应该做一系列估算(最坏估算,期望估算和最好估算)而不是单一估算,并用成本计算公式都计算一遍。管理者要估算软件的开发周期以及其他过程和产品因素的估算,比如团队队员的工作经验,硬件设备的更新,购买开发工具等。建立一张工作表,这张表包括了这些变化所产生的影响,并对这些影响进行估算。
n 由于一些组织机构方面的原因,管理者可能会选择一些相对比较贵的技术或者方法。比如软件工程师的经验相对比较丰富,但是工资也会比较高,但是开发人员还是会选择软件工程师来作为自己团队的成员而不使用新人。
28.6 Describe three types of software process metric that may be collected as part of a process improvement process. Give one example of each type of metric.(试列举三个为支持机构过程改善项目而开发的专门软件工具)
n Solution:
n Elapsed time. How long it takes to do something. Many possible examples e.g. time taken to carry out design review.
n Resource utilisation. The amount of resources used. E.g. the effort required to test a module.
n Events which occur. E.g. The number of defects discovered after a system has been delivered.
29.1 Explain why you should not use the title of a document to identify the document in a configuration management system. Suggest a standard for a document identification scheme that may be used for all projects in an organization. (解释为什么在明确配置管理系统的文档时不用文档的名字,提出一个标准文档识别目录可用于组织中的所有工程。)
n Solution:
n The title should not be used as it is not a unique identifier (several documents from different sub-projects could have the same title). A possible numbering scheme could have the form <project>: <subproject>: <task>: <doc type>: <document number>: <version>: <date>
n 标题不是唯一的,所以不能用来标识文档。不同的子项目中的文档可能含有相同的标题。
n 文档标识的标准:<项目名称><子项目名称><任务名称><文档类型><文档号码><版本号><数据>
n 二.课外复习题
n 简答题
n What is the critical difference between a milestone and deliverable?
Milestones are the end-point of a process activity. At each milestone, there should be a formal output, such as a report, that can be presented to management. Milestones reports need not be large documents. They may simply be a short report of what has been completed. Milestones should represent the end of a distinct, logical stage in the project.
Deliverables are project results delivered to customers. It is usually delivered at the end of some major project phase such as specification or design. Deliverables are usually milestones, but milestones need not be deliverables.
n Why risk management is important to a software project?
n Risk management is particularly important for software projects because of the inherent uncertainties that most projects face. These stem from loosely defined requirements, difficulties in estimating the time and resources required for software development, dependence on individual skills and requirements changes due to changes in customer needs.
n What does a feasibility study to solve?
feasibility study decides whether or not the proposed system is worthwhile.
If the system contributes to organisational objectives;
If the system can be engineered using current technology and within budget;
If the system can be integrated with other systems(可能是计算机系统,也可以是手工的系统?) that are used.
n Describe the principles of user interface design.P364
n User familiarity熟悉
n Consistency一致性
n Minimal surprise(最小诧异)
n Recoverability(可复原性)
n User guidance(指导性)
n User diversity(多样性)
n Describe the overall UI design process.P376
n
n The 3 core activities in this process are:
n User analysis. Understand what the users will do with the system;
n System prototyping. Develop a series of prototypes for experiment;
n Interface evaluation. Experiment with these prototypes with users.
n How to analysis the user activities in the UI design process?P378
n What are advantages of the incremental approach in software development? P393
1. Accelerated delivery of customer services. Each increment delivers the highest priority functionality to the customer.
n User engagement with the system. Users have to be involved in the development which means the system is more likely to meet their requirements and the users are more committed to the system.
n Discuss the distinct between incremental development and prototyping?P395
The objective of incremental developmentis to deliver a working system to end-users. The development starts with those requirements which are best understood.
The objective of throw-away prototyping is to validate or derive the system requirements. The prototyping process starts with those requirements which are poorly understood.
n What is advantages of pair programming?P404
n The use of pair of programming has a number of advantages:
n It helps develop common ownership of code and spreads knowledge across the team.
n It serves as an informal review process as each line of code is looked at by more than 1 person.
n It encourages refactoring as the whole team can benefit from this.
n How the prototype can be used in the software development process? What is the benefits of using prototyping?P409-411
n A prototype can be used in:
n The requirements engineering process to help with requirements elicitation and validation;
n In design processes to explore options and develop a UI design;
n In the testing process to run back-to-back tests
n Benefits of prototyping
n Improved system usability.
n A closer match to users’ real needs.
n Improved design quality.
n Improved maintainability.
n Reduced development effort.
n Discuss the four problems with COTS system integration.P430
n Lack of control over functionality and performance
n COTS systems may be less effective than they appear
n 2.Problems with COTS system inter-operability
n Different COTS systems may make different assumptions that means integration is difficult
n No control over system evolution
n COTS vendors not system users control evolution
n Support from COTS vendors
n COTS vendors may not offer support over the lifetime of the product
n What is characteristics of a reusable componet?P443
n What is goal of software testing? Describe the differences between validation testing and defect tesing??538
n Validation testing:
To demonstrate to the developer and the system customer that the software meets its requirements;A successful test shows that the system operates as intended.
n Defect testing:
To discover faults or defects in the software where its behaviour is incorrect or not in conformance一致 with its specification;A successful test is a test that makes the system perform incorrectly and so exposes a defect in the system.
n Why interface testing is particularly important for object-oriented and component-based development? P549
--Objects and components are defined by their interfaces and may be reused in combination with other components in different systems…………
n What must be considered in computing the number of object points in a program?P618
n The number of object points in a program is a weighted estimate of:
The number of separate screens that are displayed;
The number of reports that are produced by the system;
The number of program modules that must be developed to supplement the database code;
n Describe the three stages in the process improvement?P666
n Process measurement
Attributes of the current process are measured. These are a baseline for assessing improvements.
n Process analysis
The current process is assessed and bottlenecks and weaknesses are identified.
n Process change
Changes to the process that have been identified during the analysis are introduced.
n What may affect product quality?P668
n Four main factors affect product quality:
n
n What may be collected in the process metric?P672
n Time taken for process activities to be completed
n Resources required for processes or activities
n Number of occurrences of a particular event
n Consider driving to the airport to catch a plane on and airline that you have not used before.What risks might be unique to this trip to the airport,and which ones might be managed as part of the normal trip to the airport?
n ANS: Normal risks: running out of gas, flat tires, weather delays, traffic accidents, forgetting suitcases
n Unique risks: Construction on highway to airport, possibly different terminal, check in delays specific to this airline
n Why is path testing usually impractical?
n ANS: most programs have an infinite number of possible paths through the program.
n (2)分析设计题
l Draw a use case diagram based on your experience with the ATM.
n
n Draw a forms-based interface for the search function of library system.
n
n Draw a interface for the ATM.
n Draw a component model of a data collector component.P445
n
n Draw a sequence diagram for collect weather data.P546
n
n Giving that a program accepts 5 to 10 inputs that six-digit integers between 100 to1000, design the testing partitions. P555
n
n Design a process model for the union testing.
n
n Draw a process model for the task of painting the walls in the room. Include the following tasks: choose color, buy paint, clean the walls, stir the paint and paint the wall.
n
n Draw data-flow diagram for the unit testing
n
n Draw a data flow diagram for the simple library.
n
n Draw a sequence for the scenario: Fred goes to the library and checks out a book. Two months later, he brings the overdue liberty book back to the library.
n
n Draw a state diagram for a graphical user interface that has a main menu, a file menu with a file open command , and quit commands at each menu. Assume that only one file can be open at a time.
n
n Draw an activity chart showing the project schedule.
n
n Draw an activity chart showing the project schedule.
n
n Draw a use case and a state diagram for following problem:
n Tom is starting a bed-and –breakfast in a town. There are three bedroom for guests. He wants a system to manage the reservations and to monitor expenses and profits. When a potential customer calls for a reservation, he will check the calendar, and if there is a vacancy, he will enter the customer name, address, phone, dates, agreed upon price, credit card number, and room numbers. Reservations must be guaranteed by 1 day’s payment. Reservations will be held without guarantee for an agreed upon time. If not guaranteed by that date, the reservation will be dropped.
n
n
n Draw a user case diagram for the notepad editor.
n
n Draw a class diagram for the library
n
n A binary search routine searches a list of names in alphabetical order and returns true if the name is in the list and returns false otherwise,Construct functional tests.
n ANS:
n The first name in the list
n The last name in the list
n A name before the first name
n A name after the last name
n A name in the middle
n A name not in the list right after the first name
n A name not in the list right before the last name
用例图:确定系统中所包含的参与者、用例和两者之间的对应关系,用例图描述的是关于系统功能的一个概述
n 由参与者(Actor)、用例(Use Case)、系统边界、箭头组成
n 参与者:用简笔人物画来表示,人物下面附上参与者的名称
n 用例:参与者想要系统做的事情,一般为带有动作性的词。用例在画图中用椭圆来表示,椭圆下面附上用例的名称。
n 系统边界:是用来表示正在建模系统的边界。在画图中方框来表示,同时附上系统的名称,参与者画在边界的外面,用例画在边界里面。在画图时可省略。
箭头:表示参与者和系统通过相互发送信号或消息进行交互的关联关系。箭头尾部用来表示启动交互的一方,箭头头部用来表示被启动的一方,其中用例总是要由参与者来启动。
n ATM用例图:
n
n 图书馆:
n
状态图:显示出了对象可能的状态以及由状态改变而导致的转移。
n 状态:用圆角矩形来表示的。
n 转移:则是使用带箭头的连线表示。触发转移的事件或者条件写在箭头的旁边
n 初始状态(黑色圆圈):开始动作的虚拟开始。
n 结束状态(带边缘的黑色圆圈):动作的虚拟结束
n 状态机由状态组成,各状态由转移链接在一起。状态是对象执行某项活动或等待某个事件时的条件。转移是两个状态之间的关系,它由某个事件触发,然后执行特定的操作或评估并导致特定的结束状态。
n
n 编辑器的状态机:
n
序列图:是按时间顺序描述了对象间的交互模式
n 序列图是一种强调消息的时序交互图,它由活动者(Actor)、对象、消息(Message)、生命线(Lifeline)和控制焦点(Focus of control)组成。
n 对象表示为一个矩形,其中对象名称标有下划线;
n 消息在序列图中由有标记的箭头表示;
n 生命线由虚线表示;
n 控制焦点由薄薄的矩形表示。
n 纵向是时间轴,时间沿竖线向下延伸;
n 横向轴代表了在协作中各独立对象,活动用生命线表示。当对象存在时,生命线用一条纵向虚线表示,当对象的过程处于激活状态时,生命线是一个双道线
类图:被划分成三块的方框:类名,属性,和操作;类之间的关系是连接线
n 继承:从子类(要继承行为的类)拉出一条闭合的,单键头(或三角形)的实线指向超类。
类图有三种关系。
关联association-表示两种类的实例间的关系。如果一个类的实例必须要用另一个类的实例才能完成工作时就要用关联。在图中,关联用两个类之间的连线表示。
聚合aggregation-当一个类属于一个容器是的一种特殊关系。聚合用一个带菱形的连线,菱形指向具有整体性质的类。
泛化generalization-一个指向以其他类作为超类的继承连线。泛化关系用一个三角形指向超类。
关联上的方向性navigability箭头表示该关联传递或查询的方向。箭头方向同样可以告诉你哪个类拥有这个关联的实现;没有方向性的箭头的关联是双向。
关联尾端的数字表示该关联另一边的一个实例可以对应的数字端的实例的格数
组件接口建模:
n 末端有一个完整的圆周的接口符号代表组件提供的接口
n 在末端只有半个圆的接口(又称插座)符号代表组件要求的接口
n
数据流图:
n 基本符号:
n
数据加工(P) |
外部项(S) |
数据流(F) |
数据存储(D) |
n
F3不合格订单 |
F2汇总订单 |
F1订单 |
订单检查 |
P1 |
S1顾客 |
S2出版社 |
订单处理 |
P2 |
发送订单 |
P3 |
D1 |
图书目录 |
D4 |
出版社要求 |
D3 |
待发出订单 |
D2 |
合格订单 |