资源预览内容
第1页 / 共51页
第2页 / 共51页
第3页 / 共51页
第4页 / 共51页
第5页 / 共51页
第6页 / 共51页
第7页 / 共51页
第8页 / 共51页
第9页 / 共51页
第10页 / 共51页
亲,该文档总共51页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Chapter 6 Software EngineeringComputer EnglishvChapter 6 Software Engineering1计算机专业英语计算机专业英语Chapter 6 Software Engineering 掌握软件的生命周期的基本术语与知识;掌握软件的生命周期的基本术语与知识; 了解软件工程的发展趋势;了解软件工程的发展趋势; 了解软件设计方法;了解软件设计方法; 了解软件安全的有关知识;了解软件安全的有关知识; 掌握复杂定语掌握复杂定语(从句从句)的翻译技巧。的翻译技巧。Requirements:2Chapter 6 Software EngineeringNew Words & Expressionsmanufactured products 工业产品工业产品 lieu n.场所场所software life cycle 软件生命周期软件生命周期 versus prep. 与与.相对相对nondescriptive adj. 非描述性的非描述性的 community n.团体团体, 社会社会authorized adj.权威认可的权威认可的, 经授权的经授权的leverage n.杠杆作用杠杆作用generic adj. 一般的一般的, 普通的普通的potential adj.潜在的潜在的, 可能的可能的in terms of adv.根据根据, 按照按照, 用用.的话的话terminology n.术语学术语学personnel n.人员人员, 职员职员inventory n.详细目录详细目录, 财产清册财产清册adhere to v.粘附粘附, 粘着粘着, 坚持坚持, 追随追随password n.密码密码, 口令口令specification n.详述详述, 说明书说明书, 规范规范encrypt v.加密加密,将将.译成密码译成密码preprocess vt.预加工,预处理预加工,预处理routine n.程序程序modular adj.模块的模块的, 有标准组件的有标准组件的well-established 充分证实的充分证实的decomposition n.分解分解breakdown n. 分解,故障分解,故障pertaining to 与与.有关的有关的maintenance n.维护维护, 保持保持imperative adj.强制性的,命令式强制性的,命令式paradigm n.范例,模式范例,模式approach vt.接近接近,解决解决;n.近似近似,途径途径 conducive adj.有助于有助于.的的evasive adj.逃避的;回避的;推托的逃避的;回避的;推托的framework n.构架构架, 框架框架, 结构结构3Chapter 6 Software EngineeringNew Words & Expressionstake the form of 采取采取.形式形式 entity n.实体实体; 统一体统一体modular design 标准设计标准设计, 模块化设计模块化设计 object-oriented 面向对象的面向对象的stub n.树桩树桩, 桩模块桩模块give way to 让路让路,让步让步trial-and-error n.试错,反复试验试错,反复试验malfunction n.故障,出错故障,出错waterfall model 瀑布模型瀑布模型analogy n.类似类似, 类推类推after all adv.毕竟毕竟stark adv.完全地完全地trial-and-creative 试验并创造的试验并创造的nonstructure 非结构性非结构性intuition n.直觉直觉, 直觉的知识直觉的知识contradiction n.反驳反驳, 矛盾矛盾incremental model 增量式模型增量式模型update v.修正修正, 更新;更新;n.更新更新stepwise adj.楼梯式的楼梯式的, 逐步的逐步的prototype n.原型原型evolutionary prototyping 演化式原型演化式原型 in favor of adv.赞同赞同, 有利于有利于throwaway prototyping 抛弃原型抛弃原型iron out 消除;解决困难等消除;解决困难等documentation n.文件文件debugging n.调试调试spreadsheet n.电子制表软件电子制表软件, 电子数据表电子数据表AbbreviationsCASE (computer-aided software engineering) 计算机辅助软件工程计算机辅助软件工程GUI (Graphical User Interfaces) 图形用户界面图形用户界面4Chapter 6 Software Engineering6.1 The Software Life Cycle6.1.1 The Cycle as a WholeFigure 6-1 The software life cycleThe most fundamental concept in software engineering is the software life cycle.软件生命周期是软件工程中最基本的概念。软件生命周期是软件工程中最基本的概念。5Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe software life cycle is shown in Figure 6-1. This figure represents the fact that once software is developed, it enters a cycle of being used and modified that continues for the rest of the softwares life. Such a pattern is common for many manufactured products as well. The difference is that, in the case of other products, the modification phase is more accurately called a repair or maintenance phase because other products tend to move from being used to being modified as their parts become worn. 在图在图6-1中展示了软件的生命周期。这个图说明了一个事实:一旦软件开发中展示了软件的生命周期。这个图说明了一个事实:一旦软件开发完成,它就进入了使用和修改的循环,并且这个循环将在软件生命期的剩完成,它就进入了使用和修改的循环,并且这个循环将在软件生命期的剩余时间中不断进行。这样的模式对机器制造的产品而言也是很普通的。不余时间中不断进行。这样的模式对机器制造的产品而言也是很普通的。不同之处在于,对于其他产品,软件工程中的修改阶段要被更精确地称作修同之处在于,对于其他产品,软件工程中的修改阶段要被更精确地称作修理或者维护阶段,因为其他产品由于部件的磨损会有从使用到修改的过程。理或者维护阶段,因为其他产品由于部件的磨损会有从使用到修改的过程。6Chapter 6 Software Engineering6.1.1 The Cycle as a WholeSoftware, on the other hand, does not wear out. Instead, software moves into the modification phase because errors are discovered, because changes in the softwares application occur that require corresponding changes in the software, or because changes made during a previous modification are found to induce problems elsewhere in the software. For example, changes in tax laws may require modifications to payroll programs that calculate withholding taxes, and all too often these changes may have adverse effects in other areas of the program that may not be discovered until some time later.当然,软件不存在磨损的问题。但是,软件进入修改阶段或者是因为错误当然,软件不存在磨损的问题。但是,软件进入修改阶段或者是因为错误被发现,或者是因为要在软件的应用程序中进行修改从而修改了软件,或被发现,或者是因为要在软件的应用程序中进行修改从而修改了软件,或者是因为先前的改变又引起了软件其他地方出现了新的问题。例如,税务者是因为先前的改变又引起了软件其他地方出现了新的问题。例如,税务法案的改变导致对计算扣税的工资程序进行修改,而太频繁的修改则会在法案的改变导致对计算扣税的工资程序进行修改,而太频繁的修改则会在软件的其他地方引起反面的作用,而这些是不会被立即发现的。软件的其他地方引起反面的作用,而这些是不会被立即发现的。7Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRegardless of why software enters the modification phase, the process requires that a person (often not the original author) study the underlying program and its documentation until the program, or at least the pertinent part of the program, is understood. Otherwise, any modification could introduce more problems than it solves. Acquiring this understanding can be a difficult task even when the software is well-designed and documented. In fact, it is often within this phase that a piece of software is finally discarded under the pretense (too often true) that it is easier to develop a new system from scratch than to modify the existing package successfully 不管因为什么原因软件进入了修改阶段,这个过程需要人们(通常不是原不管因为什么原因软件进入了修改阶段,这个过程需要人们(通常不是原始的作者)研究程序及其文档,直到程序或者至少是相关部分的程序能够始的作者)研究程序及其文档,直到程序或者至少是相关部分的程序能够被理解。否则,任何的修改将导致比它所解决问题还要更多的问题出现。被理解。否则,任何的修改将导致比它所解决问题还要更多的问题出现。即使软件有优秀的设计和齐备的文档,理解也是一个很困难的工作。事实即使软件有优秀的设计和齐备的文档,理解也是一个很困难的工作。事实上,常常是在这个阶段,一个有用的软件片段最终就被放弃了(常常是这上,常常是在这个阶段,一个有用的软件片段最终就被放弃了(常常是这样),而开发一个新的系统比成功地修改现有软件更容易。样),而开发一个新的系统比成功地修改现有软件更容易。8Chapter 6 Software Engineering6.1.1 The Cycle as a WholeExperience has shown that a little effort during the development of software can make a tremendous difference when modifications in the software are required. 经验告诉我们经验告诉我们,软件开发过程中的一丁点付出,会在软件需要软件开发过程中的一丁点付出,会在软件需要修改的时候带来巨大的不同。修改的时候带来巨大的不同。In turn, most of the research in software engineering focuses on the development stage of the software life cycle, with the goal being to take advantage of this effort-versus-benefit leverage.反过来,大多数软件工程的研究都集中于软件生命周期的开发反过来,大多数软件工程的研究都集中于软件生命周期的开发阶段,它们的目标是要利用这个付出与收益的杠杆作用。阶段,它们的目标是要利用这个付出与收益的杠杆作用。9Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseThe stages within the development phase of the software life cycle are analysis, design, implementation, and testing (Figure 6-2).软件生命周期的开发阶段包括分析、设计、实现与测试等步骤(如图软件生命周期的开发阶段包括分析、设计、实现与测试等步骤(如图6-2所所示)。示)。10Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseAnalysis The development phase of the software life cycle begins with analysis-a major goal being to identify the needs of the user of the proposed system. If the system is to be a generic product sold in a competitive market, this analysis would involve a broad-based investigation to identify the needs of potential customers. If, however, the system is to be designed for a specific user, then the process would be a more narrow investigation.分析分析 软件生命周期的开发阶段以分析开始软件生命周期的开发阶段以分析开始主要目标是确定用户对所提主要目标是确定用户对所提出系统的需求。如果系统是一个在竞争的市场上销售的通用产品,这个分出系统的需求。如果系统是一个在竞争的市场上销售的通用产品,这个分析将会包括一个广泛的调查来发现潜在用户的需要。但是,如果系统是为析将会包括一个广泛的调查来发现潜在用户的需要。但是,如果系统是为特殊用户设计的,那么这个过程就是一个更专业的调查。特殊用户设计的,那么这个过程就是一个更专业的调查。11Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseAs the needs of the potential user are identified, they are compiled to form a set of requirements that the new system must satisfy. These requirements are stated in terms of the application rather than in the technical terminology of the data processing community. One requirement might be that access to data must be restricted to authorized personnel. Another might be that the data must reflect the current state of the inventory as of the end of the last business day or that the arrangement of the data as displayed on the computer screen must adhere to the format of the paper forms currently in use.当潜在用户的要求被确定之后,要将这些要求汇编成新系统必须满足的需当潜在用户的要求被确定之后,要将这些要求汇编成新系统必须满足的需求。这些需求是从应用的角度来表述,而不是用数据处理界的技术术语来求。这些需求是从应用的角度来表述,而不是用数据处理界的技术术语来表达。一种需求可能是对数据的存取必须限制在有权限的人员,另一种可表达。一种需求可能是对数据的存取必须限制在有权限的人员,另一种可能是当一个工作日结束时,数据必须反映目前的清单状态,或者可能是在能是当一个工作日结束时,数据必须反映目前的清单状态,或者可能是在计算机屏幕上的数据必须按照用户目前使用的格式来显示。计算机屏幕上的数据必须按照用户目前使用的格式来显示。12Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseAfter the system requirements are identified, they are converted into more technical system specifications. For example, the requirement that data be restricted to authorized personnel might become the specification that the system will not respond until an approved eight-digit password has been typed at the keyboard or that data will be displayed in encrypted form unless preprocessed by a routine known only to authorized personnel.系统的需求被确定以后,它们就转化为更具技术性的说明书。例如,关于系统的需求被确定以后,它们就转化为更具技术性的说明书。例如,关于数据须限制在某些有权限的人的需求,就可能转化为以下规范数据须限制在某些有权限的人的需求,就可能转化为以下规范直到从直到从键盘输入一个被认可的键盘输入一个被认可的8位密码,系统才开始响应,或者除非经过只有授权位密码,系统才开始响应,或者除非经过只有授权的人才知道的例程预处理,否则数据将以加密的形式显示在屏幕上。的人才知道的例程预处理,否则数据将以加密的形式显示在屏幕上。13Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseDesign Whereas analysis concentrates on what the proposed system should do, design concentrates on how the system will accomplish those goals. It is here that the structure of the software system is established. 设计设计 分析关注这个系统应该做什么,而设计关注这个系统应分析关注这个系统应该做什么,而设计关注这个系统应该怎样来实现目标。正是通过设计建立了软件系统的结构。该怎样来实现目标。正是通过设计建立了软件系统的结构。14Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseIt is a well-established principle that the best structure for a large software system is a modular one. Indeed, it is by means of this modular decomposition that the implementation of large systems becomes a possibility. Without such a breakdown, the technical details required in the implementation of a large system would exceed a humans comprehensive powers. 大型软件系统最好的结构是模块化系统,这是一条被充分证实大型软件系统最好的结构是模块化系统,这是一条被充分证实的原则。确实,正是借助模块化的分解方法,大型系统的实现的原则。确实,正是借助模块化的分解方法,大型系统的实现才成为可能。没有这样的分解,在大型系统实现过程中所需要才成为可能。没有这样的分解,在大型系统实现过程中所需要的技术细节可能会超过一个人的理解能力。的技术细节可能会超过一个人的理解能力。15Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseWith a modular design, however, only the details pertaining to the module under consideration need be mastered. This same modular design is also conducive to future maintenance because it allows changes to be made on a modular basis. (If a change is to be made to the way each employees health benefits are calculated, then only modules dealing with health benefits need be considered.)然而,有了这种模块化设计,仅仅需要熟悉与在考虑中的模块然而,有了这种模块化设计,仅仅需要熟悉与在考虑中的模块相关的细节。同样,模块化设计对未来的维护是有益的,因为相关的细节。同样,模块化设计对未来的维护是有益的,因为它允许对基本的模块进行修改。(如果要对每个雇员的医疗福它允许对基本的模块进行修改。(如果要对每个雇员的医疗福利计算方法进行修改,那么仅仅需要考虑处理医疗福利模块。)利计算方法进行修改,那么仅仅需要考虑处理医疗福利模块。)16Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseThere are, however, distinctions regarding the concept of a module. If one approaches the design task in terms of the traditional imperative paradigm, modules consist of procedures and the development of a modular design takes the form of identifying the various tasks that the proposed system must perform. In contrast, if one approaches the design task from the object-oriented perspective, modules are seen as objects and the design process becomes that of identifying the entities (objects) in the proposed system as well as how these entities should behave.但是,有关模块的概念也是有差别的。如果一个人以传统的命令式语言范但是,有关模块的概念也是有差别的。如果一个人以传统的命令式语言范式的方法来进行设计工作,模块由不同程序组成,而模块化设计则以确定式的方法来进行设计工作,模块由不同程序组成,而模块化设计则以确定有待实现系统的不同任务的方式进行。相反地,如果一个人从面向对象的有待实现系统的不同任务的方式进行。相反地,如果一个人从面向对象的角度来完成设计工作,模块就被看成了对象,而设计过程变成了确定有待角度来完成设计工作,模块就被看成了对象,而设计过程变成了确定有待实现系统中的实体(对象)以及确定这些实体是如何工作的。实现系统中的实体(对象)以及确定这些实体是如何工作的。17Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseImplementation Implementation involves the actual writing of programs, creation of data files, and development of databases. 实现实现 实现包括程序的实际编写、数据文件的建立以及数据库实现包括程序的实际编写、数据文件的建立以及数据库的开发等过程。的开发等过程。18Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseTesting Testing is closely associated with implementation, because each module of the system is normally tested as it is implemented. Indeed, each module in a well-designed system can be tested independently of the other modules by using simplified versions of the other modules, called stubs, to simulate the interaction between the target module and the rest of the system. Of course, this testing of components gives way to overall system testing as the various modules are completed and combined.测试测试 测试与实现紧密联系,因为系统中的每一个模块都要在实现的过程中测试与实现紧密联系,因为系统中的每一个模块都要在实现的过程中进行正常测试。确实,通过使用其他模块的简化版本进行正常测试。确实,通过使用其他模块的简化版本有时称为桩模块,有时称为桩模块,来模拟目标模块和系统其他部分的交互,从而使设计良好的系统中的每一来模拟目标模块和系统其他部分的交互,从而使设计良好的系统中的每一个模块都可以被独立地测试。当然,在各种模块都开发完成并且整合在一个模块都可以被独立地测试。当然,在各种模块都开发完成并且整合在一起之后,这个组件的测试将让路给整个系统的测试。起之后,这个组件的测试将让路给整个系统的测试。19Chapter 6 Software Engineering6.1.1 The Cycle as a WholeThe Traditional Development PhaseUnfortunately, the testing and debugging of a system is extremely difficult to perform successfully. Experience has shown that large software systems can contain numerous errors, even after significant testing. Many of these errors may go undetected for the life of the system, but others may cause major malfunctions. The elimination of such errors is one of the goals of software engineering. The fact that they are still prevalent means that a lot of research remains to be done.不幸的是,成功地进行系统的测试和调试是极其困难的。经验表明,大型不幸的是,成功地进行系统的测试和调试是极其困难的。经验表明,大型的软件系统可能包含众多的错误,甚至是经过关键测试之后。许多这样的的软件系统可能包含众多的错误,甚至是经过关键测试之后。许多这样的错误在软件的生命期中一直潜伏着,但是也有一些会导致关键性的错误。错误在软件的生命期中一直潜伏着,但是也有一些会导致关键性的错误。减少这样的错误是软件工程的一个目标。这些错误的普遍存在说明了在这减少这样的错误是软件工程的一个目标。这些错误的普遍存在说明了在这方面还有许多的研究工作要做。方面还有许多的研究工作要做。20Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsEarly approaches to software engineering insisted on performing analysis, design, implementation, and testing in a strictly sequential manner. The feeling was that too much was at risk during the development of a large software system to allow for trial-and-error techniques. 软件工程的早期方法坚持要严格地遵守分析、设计、实现以及软件工程的早期方法坚持要严格地遵守分析、设计、实现以及测试的顺序。在大型软件系统的开发过程中,感觉到采用试错测试的顺序。在大型软件系统的开发过程中,感觉到采用试错法是在冒着很大的风险进行开发的。法是在冒着很大的风险进行开发的。21Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsAs a result, software engineers insisted that the entire analysis of the system be completed before beginning the design and, likewise, that the design be completed before beginning implementation. The result was a development process now referred to as the waterfall model, an analogy to the fact that the development process was allowed to flow in only one direction.因此,软件工程师坚持应当在设计之前进行完整的系统分析,因此,软件工程师坚持应当在设计之前进行完整的系统分析,同样,设计应该在实现之前完成。这就形成了一个现在称为瀑同样,设计应该在实现之前完成。这就形成了一个现在称为瀑布模型的开发过程,这是对开发过程只允许以一个方向进行的布模型的开发过程,这是对开发过程只允许以一个方向进行的事实的模拟。事实的模拟。22Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsYou will notice a similarity between the four problem-solving phases identified by Polya and the analysis, design, implementation, and testing phases of software development. After all, to develop a large software system is to solve a problem. 你将注意到由你将注意到由Polya提出的解决问题的提出的解决问题的4个阶段与软件开发的分个阶段与软件开发的分析、设计、实现和测试阶段的类似性。毕竟,开发一个大型的析、设计、实现和测试阶段的类似性。毕竟,开发一个大型的软件系统是去解决一个问题。软件系统是去解决一个问题。23Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsOn the other hand, the traditional waterfall approach to software development is in stark contrast to the free-wheeling , trial-and-creative problem solving. Whereas the waterfall approach seeks to establish a highly structured environment in which development progresses in a sequential fashion, creative problem solving seeks a nonstructured environment in which one can drop previous plans of attack to pursue sparks of intuition without explaining why. 另一方面,传统软件开发的瀑布模型法与随心所欲的反复试验并创另一方面,传统软件开发的瀑布模型法与随心所欲的反复试验并创造性地解决问题的方法是完全相反的。瀑布模型法寻求建立一个高造性地解决问题的方法是完全相反的。瀑布模型法寻求建立一个高度结构化的环境,希望在这个环境中的开发可以顺利地进行,而创度结构化的环境,希望在这个环境中的开发可以顺利地进行,而创造性的问题解决要寻找一个非结构化的环境,希望在这个环境中可造性的问题解决要寻找一个非结构化的环境,希望在这个环境中可以抛弃先前的计划,来追逐思维的火花,而不用解释为什么。以抛弃先前的计划,来追逐思维的火花,而不用解释为什么。24Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsIn recent years, software engineering techniques have begun to reflect this underlying contradiction as illustrated by the emergence of the incremental model for software development. Following this model, the desired software system is constructed in increments-the first being a simplified version of the final product with limited functionality. 近年来,软件工程技术已经开始反映这种本质的对立了,这可近年来,软件工程技术已经开始反映这种本质的对立了,这可以由软件开发中出现的增量式模型来说明。根据这个模型,所以由软件开发中出现的增量式模型来说明。根据这个模型,所需的软件系统是通过增量模式来构造的需的软件系统是通过增量模式来构造的首先开发最终产品首先开发最终产品的简化版本,它只有有限的功能。的简化版本,它只有有限的功能。25Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsOnce this version has been tested and perhaps evaluated by the future user, more features are added and tested in an incremental manner until the system is complete. For example, if the system being developed is a student records system for a university register, the first increment may incorporate only the ability to view student records. Once that version is operational, additional features, such as the ability to add and update records, would be added in a stepwise manner.一旦这个版本经过测试、并且也许经过了未来用户的评估,更一旦这个版本经过测试、并且也许经过了未来用户的评估,更多的特性就可以添加进去并且进行测试,这样就以一种增量的多的特性就可以添加进去并且进行测试,这样就以一种增量的方式进行,直到完成系统。例如,如果正在开发的系统是为大方式进行,直到完成系统。例如,如果正在开发的系统是为大学登记员设计的学生记录系统,第一次迭代版本仅仅包括浏览学登记员设计的学生记录系统,第一次迭代版本仅仅包括浏览学生记录的功能。一旦这个版本可以运行了,其他特性,诸如学生记录的功能。一旦这个版本可以运行了,其他特性,诸如增加和更新记录的功能,就可以分阶段地添加到系统中了。增加和更新记录的功能,就可以分阶段地添加到系统中了。26Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsThe incremental model is evidence of the trend in software development toward prototyping in which incomplete versions of the proposed system, called prototypes, are built and evaluated. In the case of the incremental model these prototypes evolve into the complete, final system-a process known as evolutionary prototyping. In other cases, the prototypes may be discarded in favor of a fresh implementation of the final design. This approach is known as throwaway prototyping. 这种增量式模型是软件开发向原型法发展趋势的一个证据这种增量式模型是软件开发向原型法发展趋势的一个证据在这种方法在这种方法中,建立并测试的是不完善系统,它也被称为原型中,建立并测试的是不完善系统,它也被称为原型,被评估和测试。在增量被评估和测试。在增量式模型中,这些原型进化为一个完整的最终系统式模型中,这些原型进化为一个完整的最终系统这个过程称为演化式这个过程称为演化式原型。对于其他情况,原型的抛弃会有利于新的最终设计的实现,这种方原型。对于其他情况,原型的抛弃会有利于新的最终设计的实现,这种方法就是抛弃原型。法就是抛弃原型。27Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsAn example that normally falls within this throwaway category is rapid prototyping in which a simple example of the proposed system is quickly constructed in the early stages of development. Such a prototype may consist of only a few screen images that give an indication of how the system will interact with the user and what capabilities it will have. 一个抛弃原型的例子就是快速原型法,在这个方法中,系统的一个抛弃原型的例子就是快速原型法,在这个方法中,系统的简单版本在开发的早期就被很快搭建起来。这样的原型也许仅简单版本在开发的早期就被很快搭建起来。这样的原型也许仅仅包含少量界面图片来展示系统怎样与用户交互以及它将具有仅包含少量界面图片来展示系统怎样与用户交互以及它将具有的功能。的功能。28Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsThe goal is not to produce a working version of the product but to obtain a demonstration tool that can be used to clarify communication between the parties involved. For example, rapid prototypes have proved advantageous in ironing out system requirements during the analysis stage or as aids during sales presentations to potential clients.我们的目标不是制作产品的有效版本,而是获得一个示范工具,以便阐明我们的目标不是制作产品的有效版本,而是获得一个示范工具,以便阐明有关方面之间的沟通。例如,在分析阶段解决系统的需求问题,或在销售有关方面之间的沟通。例如,在分析阶段解决系统的需求问题,或在销售阶段作为向潜在客户演示的辅助阶段作为向潜在客户演示的辅助, 快速原型具有很大的优势快速原型具有很大的优势 29Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsAnother development in software engineering has been the application of computer technology to the software development process itself, resulting in what is called computer-aided software engineering (CASE). 软件工程领域中另一个发展是计算机技术在软件开发过程本身软件工程领域中另一个发展是计算机技术在软件开发过程本身的应用,这导致了称为计算机辅助软件工程(的应用,这导致了称为计算机辅助软件工程(CASE)的出现。)的出现。30Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsThese computerized systems are known as CASE tools and include project planning tools (that assist in cost estimation, project scheduling, and personnel allocation), project management tools (that assist in monitoring the progress of the development project), documentation tools (that artist in writing and organizing documentation), prototyping and simulation tools (that assist in the development of prototypes), interface design tools (that assist in the development of GUIs), and programming tools (that assist in writing and debugging programs). 这些计算机化系统就是知名的这些计算机化系统就是知名的CASE工具,且包括项目计划工具(帮助成工具,且包括项目计划工具(帮助成本估计、项目调度,以及人力资源分配)、项目管理工具(帮助管理开发本估计、项目调度,以及人力资源分配)、项目管理工具(帮助管理开发项目的进程)、文档工具(帮助撰写和组织文档)、界面设计工具(帮助项目的进程)、文档工具(帮助撰写和组织文档)、界面设计工具(帮助开发开发GUI)以及程序设计工具(帮助编写和调试程序)。)以及程序设计工具(帮助编写和调试程序)。31Chapter 6 Software Engineering6.1.1 The Cycle as a WholeRecent TrendsSome of these tools are little more than the word processors, spreadsheet systems, and e-mail communication systems used in other applications. However, others are quite sophisticated packages designed primarily for the software engineering environment. For example, some CASE tools include code generators that, when given specifications for a part of a system, produce high-level language programs that implement that part of the system.这些工具也许仅仅就是在其他的应用程序中的文字处理软件,或者是表格这些工具也许仅仅就是在其他的应用程序中的文字处理软件,或者是表格处理软件,或者是电子邮件通讯系统。一些则是相当复杂的软件,它们主处理软件,或者是电子邮件通讯系统。一些则是相当复杂的软件,它们主要是为了软件工程环境来设计的。例如,一些要是为了软件工程环境来设计的。例如,一些CASE工具包括了代码生成工具包括了代码生成器,当给出一个系统局部的说明书时,它可用来生成实现这个系统局部的器,当给出一个系统局部的说明书时,它可用来生成实现这个系统局部的高级语言程序。高级语言程序。32Chapter 6 Software Engineering6.2 Design Methodologies The development of methodologies for designing software systems is a major quest within software engineering. In this section we discuss a variety of the techniques that have been developed as well as directions of current research.设计软件系统的方法学是软件工程领域主要探索的方向之一。设计软件系统的方法学是软件工程领域主要探索的方向之一。本节我们将讨论一些已经形成的方法以及当前的研究方向。本节我们将讨论一些已经形成的方法以及当前的研究方向。33Chapter 6 Software Engineering6.2.1 Top-Down Versus Bottom-Up Perhaps the most well-known strategy associated with system design is the top-down methodology. The point of this methodology is that one should not try to solve a complex problem in a single step. Instead, ones first stop should be to break the problem into smaller, more manageable subproblems. Then, one should proceed by breaking these subproblems into still smaller problems. In this manner, a complex problem becomes a collection of simpler problems whose solutions collectively solve the original problem.也许最著名的系统设计策略就是自顶向下的方法学了。这个方法学的要点也许最著名的系统设计策略就是自顶向下的方法学了。这个方法学的要点就是人们不要试图一下子就将一个复杂问题解决,而是应当将问题分解成就是人们不要试图一下子就将一个复杂问题解决,而是应当将问题分解成更小的、可以管理的子问题。然后,将这些子问题分解成更小的问题。以更小的、可以管理的子问题。然后,将这些子问题分解成更小的问题。以这种方式,一个复杂的问题变成了相对小的问题的集合,而所有小问题的这种方式,一个复杂的问题变成了相对小的问题的集合,而所有小问题的解决就是原问题的解决。解决就是原问题的解决。 34Chapter 6 Software Engineering6.2.1 Top-Down Versus Bottom-Up The result of top down design tends to be a hierarchical system of refinements that often can be translated directly into a modular structure that is compatible with the imperative programming paradigm. The solutions to the smallest problems in the hierarchy become procedural modules that perform simple tasks and are used as abstract tools by more superior modules to solve the more complex problems in the system. 自顶向下设计的结果是一个逐步求精的层次系统,这个结构通自顶向下设计的结果是一个逐步求精的层次系统,这个结构通常可以被直接翻译成与命令式语言兼容的模块结构。对层次结常可以被直接翻译成与命令式语言兼容的模块结构。对层次结构中最小问题的解决变成了执行简单任务的程序模块,这个模构中最小问题的解决变成了执行简单任务的程序模块,这个模块被较高层用作抽象工具来解决系统中更为复杂的问题。块被较高层用作抽象工具来解决系统中更为复杂的问题。35Chapter 6 Software Engineering6.2.1 Top-Down Versus Bottom-Up In contrast to the top-down design methodology is the bottom-up approach, in which one starts the design of a system by identifying individual tasks within the system and then considers how solutions to these tasks can be used as abstract tools in the solution to more complex problems. For many years, this approach was considered inferior to the top down design paradigm. 相对于自顶向下的设计方法学,自底向上的方法确定系统中的相对于自顶向下的设计方法学,自底向上的方法确定系统中的每一个具体任务来开始系统的设计。然后,它考虑如何将这些每一个具体任务来开始系统的设计。然后,它考虑如何将这些任务的解决用做解决更复杂问题的抽象工具。多年来,这个方任务的解决用做解决更复杂问题的抽象工具。多年来,这个方法被认为不如自顶向下的设计范式。法被认为不如自顶向下的设计范式。36Chapter 6 Software Engineering6.2.1 Top-Down Versus Bottom-Up Today, however, the bottom-up methodology has gained support. One reason for this shift is that the top-down methodology seeks a solution in which a dominant module uses submodules, each of which relies on subsubmodules, and so on. 但是,今天,自底向上的方法学又获得了支持。这种转变的一但是,今天,自底向上的方法学又获得了支持。这种转变的一个原因就是自顶向下的方法寻求一个支配模块使用子模快,而个原因就是自顶向下的方法寻求一个支配模块使用子模快,而每一个支配模块依赖于子模块的解决,等等。每一个支配模块依赖于子模块的解决,等等。37Chapter 6 Software Engineering6.2.1 Top-Down Versus Bottom-Up However, the best design for many systems is not of a hierarchical nature. Indeed, a design consisting of two or more modules interacting as equals, as exemplified by the client-server model as well as general parallel processing applications, may be a better solution than a design consisting of a superior module that relies on subordinates to perform its task.但是,对于许多系统来说,最好的设计不是一个层次的结构。但是,对于许多系统来说,最好的设计不是一个层次的结构。确实,一个设计包括两个或更多模块确实,一个设计包括两个或更多模块它们平等交互,这也它们平等交互,这也是被包含通用并行处理应用程序的客户是被包含通用并行处理应用程序的客户/服务器模型或者系统所服务器模型或者系统所例证了的,比起依赖于从属模块来执行任务的较高级模块构成例证了的,比起依赖于从属模块来执行任务的较高级模块构成的设计,它也许是一个更好的解决方案。的设计,它也许是一个更好的解决方案。38Chapter 6 Software Engineering6.2.1 Top-Down Versus Bottom-Up Another reason for increased interest in bottom-up design is that it is more consistent with the goal of building complex software systems from preconstructed, off-the-shelf components-an approach that is a current trend in soft- ware engineering. 对自底向上设计产生更多兴趣的另一个原因,就是它与从预先对自底向上设计产生更多兴趣的另一个原因,就是它与从预先构建的现成组件中构建复杂软件系统的目标更加一致构建的现成组件中构建复杂软件系统的目标更加一致这体这体现了软件工程当前的趋势。现了软件工程当前的趋势。39Chapter 6 Software Engineering6.2.2 Design Patterns In an effort to find ways by which software can be constructed from off-the-shelf components, software engineers have turned to the field of architecture for inspiration. Of particular interest is the book A Pattern Language by Christopher Alexander et al., which describes a set of patterns for designing communities. 每种模式都包括了一个问题描述以及建议性的解决方案。这些每种模式都包括了一个问题描述以及建议性的解决方案。这些问题是很普遍的,而这个建议性的解决方案也是一般性的问题是很普遍的,而这个建议性的解决方案也是一般性的旨在强调他们阐述的是问题的一般的本质而不是仅仅为一个特旨在强调他们阐述的是问题的一般的本质而不是仅仅为一个特殊的例子提出一个解决方案。殊的例子提出一个解决方案。40Chapter 6 Software Engineering6.2.2 Design Patterns Each pattern consists of the statement of a problem followed by a proposed solution. The problems are intended to be universal, and the proposed solutions are generic in the sense that they address the universal nature of the problem rather than proposing a solution for a particular case.每种模式都包括了一个问题描述以及建议性的解决方案。这些每种模式都包括了一个问题描述以及建议性的解决方案。这些问题是很普遍的,而这个建议性的解决方案也是一般性的问题是很普遍的,而这个建议性的解决方案也是一般性的旨在强调他们阐述的是问题的一般的本质而不是仅仅为一个特旨在强调他们阐述的是问题的一般的本质而不是仅仅为一个特殊的例子提出一个解决方案。殊的例子提出一个解决方案。41Chapter 6 Software Engineering6.2.2 Design Patterns For example, one pattern, called Quiet Backs, addresses the need to escape the commotion of a business center for short periods of refreshment. The proposed solution is to design quiet backs into business districts. In some cases, the district could be designed around a main street to which all buildings face-thus, providing for quiet side streets behind the buildings. In other cases, quiet backs can be obtained by means of parks, rivers, or cathedrals. 例如,一个模式,叫做例如,一个模式,叫做“安静的后面安静的后面”,阐述了躲避商业中心的喧嚣,阐述了躲避商业中心的喧嚣而寻求短暂的精力恢复的需求。其建议性的解决方案就是在商业区而寻求短暂的精力恢复的需求。其建议性的解决方案就是在商业区中设计一个中设计一个“安静的后面安静的后面”。在某些情况下,这个商业区要设计在所。在某些情况下,这个商业区要设计在所有建筑都要朝向的主要街道周围有建筑都要朝向的主要街道周围因此可以将安静的辅路铺在建因此可以将安静的辅路铺在建筑的后面。在其他的情况下,筑的后面。在其他的情况下,“安静的后面安静的后面”可以采用公园、河流或可以采用公园、河流或者是教堂的形式。者是教堂的形式。42Chapter 6 Software Engineering6.2.2 Design Patterns The important point for our discussion is that Alexanders wok attempted to identify universal problems and provide templates for solving them. Today, many software engineers are attempting to apply this same approach to the design of large software systems. In particular, researchers are applying design patterns as a means of providing generic building blocks with which software systems can be constructed.我们所讨论的重点就是我们所讨论的重点就是Alexander在著作中试图确定的一般性在著作中试图确定的一般性问题并且提供解决它们的模板。今天,许多软件工程师也试图问题并且提供解决它们的模板。今天,许多软件工程师也试图应用同样的方法来设计大型的软件系统。特别地,研究人员正应用同样的方法来设计大型的软件系统。特别地,研究人员正在应用设计模式作为提供软件构建所需通用单元的方法。在应用设计模式作为提供软件构建所需通用单元的方法。43Chapter 6 Software Engineering6.2.2 Design Patterns An example of such a pattern is the publisher-subscriber pattern, consisting of a module (the publisher) that must send copies of its “publications” to other modules (the subscribers). As a specific example, consider a collection of data that is being displayed on a computer screen in more than one format-perhaps as a pie graph as well as a bar graph-simultaneously. In this setting, any change in the data should be reflected in both graphs. Thus the software modules in charge of drawing the graphs should be notified when changes in the data occur. In this case, then, the software module maintaining the data plays the role of the publisher that must send update messages to the subscribers, which are the modules charged with drawing the graphs.这种模式的一个例子就是出版商和订户的模式:一个模块(出版商)将其出版物发这种模式的一个例子就是出版商和订户的模式:一个模块(出版商)将其出版物发送给其他模块(订户)。作为一个特殊的例子,考虑在计算机屏幕上同时显示多种送给其他模块(订户)。作为一个特殊的例子,考虑在计算机屏幕上同时显示多种格式的数据集,如饼图和条形图。这样,任何对数据的修改都将会被反映在两张图格式的数据集,如饼图和条形图。这样,任何对数据的修改都将会被反映在两张图上。因此,当数据发生更改的时候,这个负责画图的软件模块将会被告知。在这种上。因此,当数据发生更改的时候,这个负责画图的软件模块将会被告知。在这种情况下,维护数据的软件模块就会扮演出版商的角色情况下,维护数据的软件模块就会扮演出版商的角色它必须要给订户发送更新它必须要给订户发送更新的消息,而这些订户也是模块,它们负责画图。的消息,而这些订户也是模块,它们负责画图。44Chapter 6 Software Engineering6.2.2 Design Patterns Another example of software design pattern is the container-component pattern. It captures the generic concept of a container that contains components that are themselves containers. Such a pattern is exemplified by the directories or folders used by an operating systems file manager. Each of these directories typically contains other directories, which may contain still other directories. In short, the container-component pattern is meant to capture the recursive concept of containers that contain containers.软件设计模式的另一个例子是容器组件模式。它阐述了容器包括一些组件,软件设计模式的另一个例子是容器组件模式。它阐述了容器包括一些组件,而组件本身又是容器的一般性概念。这种模式的例子就是操作系统的文件而组件本身又是容器的一般性概念。这种模式的例子就是操作系统的文件管理器使用的目录或者文件夹。每个这样的目录都包括了其他目录,而这管理器使用的目录或者文件夹。每个这样的目录都包括了其他目录,而这个被包含了的目录可能又包含了其他的目录。简而言之,容器组件模式可个被包含了的目录可能又包含了其他的目录。简而言之,容器组件模式可以描述容器包含容器的递归概念。以描述容器包含容器的递归概念。45Chapter 6 Software Engineering6.2.2 Design Patterns Once a pattern such as publisher-subscriber or container-component has been identified, software engineers propose the development of skeletal program units, called frameworks, that implement the pertinent features of the patterns solution while leaving features specific to particular applications as slots to be filled in later. To accompany frameworks, software engineers propose documentation that describes how the framework can be filled in to obtain a complete implementation of the underlying pattern in a particular setting. Such documentation is called a recipe. Collections of frameworks along with their recipes are fondly known as cookbooks.一旦像出版商与订户或者是容器和组件这样的模式被确定,软件工程师就一旦像出版商与订户或者是容器和组件这样的模式被确定,软件工程师就会计划开发一组程序单元作为骨架,这称为框架,它实现模式方法所要解会计划开发一组程序单元作为骨架,这称为框架,它实现模式方法所要解决的主要特征,而将特殊应用程序的特性作为缺口,留待以后填入。为了决的主要特征,而将特殊应用程序的特性作为缺口,留待以后填入。为了补充框架,软件工程师提出了如何填充框架的描述文档。这种文挡被称为补充框架,软件工程师提出了如何填充框架的描述文档。这种文挡被称为处方,与处方在一起的框架集被昵称为菜谱。处方,与处方在一起的框架集被昵称为菜谱。46Chapter 6 Software Engineering6.2.2 Design Patterns Researchers hope that by means of cookbooks, software engineers will finally be able to construct large, complex software systems from off-the-shelf components-the components being frameworks. Early results have indicated that such an approach can significantly reduce the amount of programming required in the development of a new system. 研究人员希望:借助菜谱,软件工程师最终可以从现成的组件研究人员希望:借助菜谱,软件工程师最终可以从现成的组件组件就是框架组件就是框架构建大型的复杂软件系统。早期的结果构建大型的复杂软件系统。早期的结果表明,这种方法可以大大减少开发新系统所需的编程工作量。表明,这种方法可以大大减少开发新系统所需的编程工作量。47Chapter 6 Software Engineering6.2.2 Design Patterns With all the excitement that has been generated in the software engineering community over design patterns, it is interesting to note that Alexander was not pleased with the results of his patterns in architecture. In short, he found that the systems designed from his patterns were lacking in character, and his work since the early 1980s has focused on ways to capture this evasive quality. However, software engineers argue that the goal in software development does not involve such qualities as beauty and character, but instead accuracy and efficiency. Thus, they continue, design patterns will prove to be more successful in the field of software engineering than in architecture.设计模式在软件工程领域中引起了极大的热情,而对于设计模式在软件工程领域中引起了极大的热情,而对于Alexander而言,而言,他对自己应用于建筑学的模式却不是很满意,这是十分有趣的事。他发现他对自己应用于建筑学的模式却不是很满意,这是十分有趣的事。他发现根据自己的模式所设计的系统缺乏个性,并且从二十世纪八十年代初开始根据自己的模式所设计的系统缺乏个性,并且从二十世纪八十年代初开始他主要致力于捕获这个遗漏性质的方法。但是,软件工程师认为软件开发他主要致力于捕获这个遗漏性质的方法。但是,软件工程师认为软件开发的目标不是去追求诸如美观和个性的特性,而是追求准确和高效。因此,的目标不是去追求诸如美观和个性的特性,而是追求准确和高效。因此,他们将这种方法发扬光大,设计模式在软件工程领域中将比在建筑领域中他们将这种方法发扬光大,设计模式在软件工程领域中将比在建筑领域中更加成功。更加成功。48Chapter 6 Software Engineering复杂定语复杂定语(从句从句)的翻译技巧之一的翻译技巧之一 科技英语中,科技英语中,句子的某个中心词常常被若干个后置定语或定语句子的某个中心词常常被若干个后置定语或定语从句所修饰。从句所修饰。这是因为这是因为英语句法结构重英语句法结构重“形合形合”,任何一个名词,任何一个名词或名词词组,为了对它进行完整而明确的阐述,可以借助各种或名词词组,为了对它进行完整而明确的阐述,可以借助各种修饰结构修饰结构(介词短语、不定式短语、分词短语、定语或同位语介词短语、不定式短语、分词短语、定语或同位语从句等从句等)像滚雪球那样引出一长串修饰成分。而像滚雪球那样引出一长串修饰成分。而汉语讲汉语讲“意合意合”,各个成分用意义串联,往往不需要连接词,一般句子较短。,各个成分用意义串联,往往不需要连接词,一般句子较短。汉语中,对于一个名词,通常不用汉语中,对于一个名词,通常不用“叠床架屋叠床架屋”式的多重修饰语,式的多重修饰语,因为过长的前置定语会使句子拖泥带水、冗长臃肿、晦涩难懂。因为过长的前置定语会使句子拖泥带水、冗长臃肿、晦涩难懂。由于英汉两种语言的修饰方式有很大差别,所以对于科技英语由于英汉两种语言的修饰方式有很大差别,所以对于科技英语中含有多重定语或长定语从句的中心词中含有多重定语或长定语从句的中心词(组组)没有现成的对应译没有现成的对应译法,也就难以用规范的汉语,简练地译出原文复杂的修饰关系。法,也就难以用规范的汉语,简练地译出原文复杂的修饰关系。49Chapter 6 Software Engineering复杂定语复杂定语(从句从句)的翻译技巧之一的翻译技巧之一 一、先提后述法一、先提后述法适用于结构复杂的并列长定语适用于结构复杂的并列长定语(从句从句)。翻译时,首先用。翻译时,首先用“这样这样(的的)”、“这样一些这样一些”、“下列下列(的的)”等词语概括所有修饰成分,然后分别叙述各个修饰内容。用这种方法翻译等词语概括所有修饰成分,然后分别叙述各个修饰内容。用这种方法翻译的译文,重点突出、条理清楚。在许多情况下,这是一种翻译并列长定语的译文,重点突出、条理清楚。在许多情况下,这是一种翻译并列长定语(从句从句)行行之有效的方法。之有效的方法。例例1. A computer is an electronic device that can receive a set of instructions, or program, and then carry out this program by performing calculations on numerical data or by compiling and correlating other forms of information.译文:计算机是一种电子装置,它能接受一套指令或程序,并通过数据运算,或收译文:计算机是一种电子装置,它能接受一套指令或程序,并通过数据运算,或收集和联系其他形式的信息来执行该程序。集和联系其他形式的信息来执行该程序。(比较:计算机是一种能接受一套指令或程序,并通过数据运算,或收集和联系其他比较:计算机是一种能接受一套指令或程序,并通过数据运算,或收集和联系其他形式的信息来执行该程序的电子装置形式的信息来执行该程序的电子装置)例2. A sound card is a printed circuit board that can translate digital information into sound and back, that plug into a slot on the motherboard (the main circuit board of a computer) and is usually connected to a pair of speakers.译文:声卡是一块印刷电路板,它能把数字信息译为声音,也能把声音变为数字信息,它插在母板(计算机主电路板)上的槽内,而且通常连接一对喇叭。(比较:声卡是一块能把数字信息译为声音,也能把声音变为数字信息,插在母板(计算机主电路板)上的槽内,而且通常连接一对喇叭的印刷电路板。)50Chapter 6 Software Engineering复杂定语复杂定语(从句从句)的翻译技巧之一的翻译技巧之一 二、先述后提法二、先述后提法 此译法是此译法是“先提后述法先提后述法”的倒置。也就是先叙述中心词的倒置。也就是先叙述中心词(组组)的修饰内容的修饰内容,最后用最后用“这样这样的的”、“这一切这一切”、“这种这种”、“这些这些”等词语予以呼应。等词语予以呼应。例例1. The fact that the Government may have formulated, furnished, or in any way supplied the said drawings, specifications, or other data is not to be regarded by implication 译文:政府可能已经系统地阐述、提供或以某种方式供应了上述图纸、规范或其他译文:政府可能已经系统地阐述、提供或以某种方式供应了上述图纸、规范或其他资料,但这样的事实并非暗示资料,但这样的事实并非暗示(比较:政府可能已经系统地阐述、提供或以某种方式供应了上述图纸、规范或其他比较:政府可能已经系统地阐述、提供或以某种方式供应了上述图纸、规范或其他资料的这一事实,并非暗示是资料的这一事实,并非暗示是)例例2. The way in which a number of processor units are employed in a single computer system to increase the performance of the system in its application environment above the performance of single processor is an organizational technique.译文:将许多处理器组成单一的计算机系统,从而提高该系统在其运行环境中的性译文:将许多处理器组成单一的计算机系统,从而提高该系统在其运行环境中的性能,使其超过单个处理器的性能,这种方法称为组织技术。能,使其超过单个处理器的性能,这种方法称为组织技术。(比较:将许多处理器组成单一的计算机系统,从而提高该系统在其运行环境中的性比较:将许多处理器组成单一的计算机系统,从而提高该系统在其运行环境中的性能,使其超过单个处理器的性能的方法称为组织技术。能,使其超过单个处理器的性能的方法称为组织技术。) 51
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号