1、Software Engineering软 件 工 程,李 宣 东 南京大学计算机科学与技术系 http:/ Methods for Software Engineering 传统软件工程方法Object-Oriented Software Engineering 面向对象软件工程Software Process, Management, and Quality 软件过程、管理与质量,Reference 参考文献,Roger S. Pressman Software Engineering: A Practitioners Approach McGraw-Hill 1982(1/e), 198
2、7(2/e), 1992(3/e) 1997(4/e), 2001(5/e) 可视化面向对象建模技术 刘超 张莉 编著 北京航空航天大学出版社http:/,Conventional Methods for Software Engineering,What,How,Do it,Test,Use,Conventional Methods for Software Engineering,System engineering,Analysis,Testing,Design,Maintenance,Code,系统定义,分析,设计,编码,测试,维护,Basic Concepts 基本概念,Softwa
3、re isinstructions (computer programs) that when executed provide desired function and performance,data structures that enable the programs to adequately manipulate information, anddocuments that describe the operation and use of the programs.,Basic Concepts,软件 计算机系统中的程序及其有关文件。程序 计算任务中的处理对象和处理规则的描述。文
4、件 为了便于了解程序所需的资料说明。,Basic Concepts,Software CharacteristicsSoftware is developed or engineering, it is not manufactured in the classical sense. 软件是由开发或工程化而形成的,而不是传统意义上由制造产生的。Software doesnt “wear out”. 软件不会“磨损”。Although the industry is moving toward component-based assembly, most software continues t
5、o be custom build. 大多数软件是自定的,而不是通过已有的构件组装起来的。,Basic Concepts,Software ApplicationsSystems softwareReal-time softwareBusiness softwareEngineering and scientific softwareEmbedded softwarePersonal computer softwareWeb-based softwareArtificial intelligence software,Basic Concepts,Generic Category for So
6、ftware:系统软件支撑软件(中间件middleware)应用软件,Basic Concepts,硬件平台,系统软件,支撑软件,硬件平台,系统软件,支撑软件,中间件,应用软件,应用软件,Basic Concepts,Evolution of Software 软件的发展过程第一阶段:从第一台计算机上的第一个程序的出现到实用的高级程序设计语言出现之前(1946-1956);第二阶段:从实用的高级程序设计语言出现到软件工程出现之前(1956-1968);第三阶段:软件工程(1968- )。,Basic Concepts,Software crisis 软件危机供求关系失调开发费用失控,进度拖延可
7、靠性差难以维护,Basic Concepts,产生软件危机的原因软件本身的特点管理人员的错误观点用户的错误观点软件开发人员的错误观点,Basic Concepts,产生软件危机的原因(软件本身的特点)软件开发进展情况较难衡量软件开发质量难以评价管理和控制软件开发过程相当困难软件没有“磨损”概念,软件维护通常意味着该进或修改原来的设计,Basic Concepts,产生软件危机的原因(管理人员的错误观点)We already have a book thats full of standards and procedures for building software, wont that pr
8、ovidemy people with everything they need to know? 我们 已经有了关于开发软件的标准和规范的书籍,难道它们不能给人们提供所有其需要知道的信息吗?,Basic Concepts,产生软件危机的原因(管理人员的错误观点)My people have state-of-the-art software development tools, after all, we buy them the newest computers. 我们已经有了很好很多的软件开发工具,而且,我们拥有最新的计算机。If we get behind schedule, we c
9、an add more programmers and catch up. 如果我们已经落后于计划,可以增加更多的程序员来赶上进度。,Basic Concepts,产生软件危机的原因(用户的错误观点)A general statement of objectives is sufficient to begin writing programs - we can fill in the details later. 有一个对目标的概括描述就足以着手编写程序了,许多细节可以在以后再补充。Project requirements continually change, but change can
10、 be easily accmodated because software is flexible. 用户对软件的要求不断变化,然而软件是柔软而灵活的,可以轻易地改动。,Basic Concepts,产生软件危机的原因(软件开发人员的错误观点)Once we write the program and get it to work, our job is done. 所谓软件开发就是编写程序并设法使它运行。Until I get the program “running” I have noway of assessing its quality. 在程序真正运行之前,没有办法评估其质量。,
11、Basic Concepts,产生软件危机的原因(软件开发人员的错误观点)The only deliverable work product for a successful project is the working program. 一个成功项目唯一应该提交的就是可运行的程序。Software engineering will make us create voluminous and unnecessary documentation and will invariably slow us down. 软件工程就是建立庞大无用的文档,这必将降低我们的软件开发效率。,Basic Conc
12、epts,产生软件危机的原因(共有的错误观点)软件投入生产性运行以后需要的维护工作并不多,而且维护是一件很容易做的简单工作。,Basic Concepts,Software EngineeringThe establishment and use of sound engineering principles in order to obtain economically software that is reliable and works efficiently on real machines. (NATO Science Committee),Basic Concepts,软件工程应用
13、计算机科学、数学及管理科学等原理,以工程化原则、方法解决软件问题的工程。其中,计算机科学、数学用于构造模型与算法,工程科学用于制定规范、设计范型、降低成本及确定权衡,管理科学用于计划、资源、质量、成本等管理。(大百科全书),Basic Concepts,软件工程的基本内容:软件设计方法论软件工具软件工程标准和规范软件工程管理软件工程理论,Basic Concepts,软件工程的基本原理:严格按照计划进行管理坚持进行阶段评审实行严格的产品控制采用现代的程序技术结果要能清晰地审计开发小组人员素质要好,数量不宜多要承认不断改善软件工程实践的必要性,Basic Concepts,Software Li
14、fe Cycle 软件生存期(Software Process 软件过程)模型: 软件生存期是软件产品或系统一系列相关活动的全周期。从形成概念开始,经过研制,交付使用,在使用中不断增补修订,直到最后被淘汰,让位于新的软件产品的过程。对软件生存期的不同划分,形成了不同的软件生存期模型。,Basic Concepts,System engineering,Analysis,Testing,Design,Maintenance,Code,系统定义,分析,设计,编码,测试,维护,强调阶段的划分及其顺序性、各阶段工作及其文档的完备性,是一种严格线性的、按阶段顺序的、逐步细化的开发模式。,Waterfal
15、l Model,Basic Concepts,瀑布式软件生存期模型把软件开发过程划分成若干阶段,每个阶段的任务相对独立,便于不同人员分工协作,从而降低了整个软件开发工程的困难程度。在软件生存期的每个阶段都采用科学的管理技术和良好的方法与技术,而且每个阶段结束之前,都从技术和管理两个角度进行严格的审查,经确认之后才开始下一阶段的工作。,Basic Concepts,瀑布式模型的特点:结构简单明了;历史较长、应用面广泛、为广大软件工作者所熟悉;已有与之配套的一组十分成熟的开发方法和丰富的支撑工具。确定了需求分析的绝对重要性,但是在实践中要想获得完善的需求说明是非常困难的;反馈信息慢。,Basic
16、Concepts,Software Quality Factors 软件质量要素:Correctness 正确性:软件产品准确执行软件规格说明中所规定的能力。Robustness 健壮性:在异常条件下软件仍能运行的能力。Reliability 可靠性:软件在给定的时间内和规定的环境条件下,按规格说明的规定成功地运行的概率。可靠性理解为正确性和健壮性之和。,System Engineering,What is it? Before software can be engineered, the “system” in which it resides must be understood. To
17、 accomplish this, the overall objective of the system must be determined; the role of hardware, software, people, database, procedures, and other system elements must be identified; and operational requirements must be elicited, analyzed, specified, modeled, validated, and managed. These activities
18、are the foundation of system engineering.,System Engineering,Who does it?A system engineer works to understand system requirements by working with the customer, future users, and other stakeholders.,System Engineering,Why is it important?There is an old saying:“You cannot see the forest for the tree
19、s.”In this context, the “forest”is the system, and the trees are the technology elements (include software) that are required to realize the system. If you rush to build technology elements before you understand the system, you will undoubtedly make mistakes that will disappoint your customer. Befor
20、e you worry about the trees, understand the forest.,System Engineering,What are the steps?Objectives and more detailed operational requirements are identified by eliciting information from the customer.Requirements are analyzed to assess their clarity, completeness, and consistency.A specification,
21、often incorporating a system model, is created and then validated by both practitioners and customers.System requirements are managed to ensure that changes are properly controlled.,System Engineering,What is the work product?A effective representation of the system must be produced as a consequence
22、 of system engineering. This can be a prototype, a specification or even a symbolic model, but it must communicate the operational, functional, and behavioral characteristics of the system to be built and provide insight into the system architecture.,System Engineering,How do I ensure that I have do
23、ne it right?Perform requirements engineering steps, including requirements elicitation, that lead to a solid specification. Then review all system engineering work products for clarity, completeness, and consistency. As important, expect changes to the system requirements and manage them using solid
24、 SCM (Software Configuration Management).,System Engineering,Instead of concentrating solely on software, system engineering focuses on a variety of elements, analyzing, designing, and organizing those elements into a system that can be a product, a service, or a technology for the transformation of
25、 information or control.,System Engineering,Computer - Based SystemsA set or arrangement of elements that are organized to accomplish some predefined goal by processing information.,System Engineering,Computer - Based SystemsSoftwareHardwarePeopleDatabaseDocumentationProcedures,System Engineering,Bu
26、siness or product domain,World view,Domain view,Element view,Detailed view,Domain of interest,System element,System Engineering,System engineering hierarchyThe world view (WV) is composed of a set of domain (Di), which can be system or system of systems in its own right. WV = D1, D2, D3, , DnEach do
27、main is composed of specific element (Ej) each of which serves some role in accomplishing the objective and goals of the domain or component. Di = E1, E2, E3, , EmEach element is implemented by specifying the technical componets (Ck) that achieve the necessary function for an element. Ej = C1, C2, C
28、3, , Ck,System Engineering,System ModelingSystem Simulations,System Engineering,System engineering is a modeling process:Define the processes that serve the needs of the view under consideration.Represent the behavior of the processes and the assumptions on which the behavior is based.Explicitly def
29、ine both exogenous and endogenous input to the model.Represent all linkages (including output) that will enable the engineer to better understand the view.,System Engineering,To construct a system model, the engineer should consider a number of restraining factors:AssumptionsSimplificationsLimitatio
30、nsConstraintsPreferences,System Engineering,System SimulationMany computer -based systems interact by the real world in a reactive fashion.Real-time and embedded systems often fall into the reactive systems category.,System Engineering,System engineering process:Business process engineering The syst
31、em engineering process is called business process engineering when the engineering work focuses on a business enterprise. Product engineering The system engineering process is called product engineering when a product is to be built.,System Engineering,Business process engineeringThe goal of busines
32、s process engineering is to define architectures that will enable a business to use information effectively.Three different architectures must be analyzed and designed within the context of business objectives and goals: - data architecture - application architecture - technology infrastructure,Syst
33、em Engineering,Business process engineeringThe data architecture provides a framework for the information needs of a business or business function.The application architecture encompasses those elements of a system that transform objects within the data architecture for some business purpose.The tec
34、hnology infrastructure provides the foundation for the data and application architectures.,System Engineering,The enterprise,A business area,Informationsystem,Business area,Processing requirement,Business system design (element view),Business area analysis(domain view),Informationstrategy planning (
35、world view),Construction & integration(detailed view),Softwareengineer,System Engineering,Product engineeringThe goal of product engineering is to translate the customers desire for a set of defined capability into a working product.To achieve this goal, product engineering must derive architecture
36、and infrastructure. The architecture encompasses four distinct system components: software, hardware, data (databases), and people.A support infrastructure is established and includes the technology to tie the components together and the information that is used to support the components.,System Eng
37、ineering,The complete product,Hardware,Software,Data,Function,Behavior,Capabilities,Processing requirements,Programcomponent,Construction & integration(detailed view),Requirements engineering (world view),Component engineering(domain view),Softwareengineer,Analysis & design modeling (element view),S
38、ystem Engineering,Product engineeringSystem AnalysisIdentification of NeedFeasibility Study Economic feasibility Technical feasibility Legal feasibility Alternatives Economic AnalysisTechnology Analysis,System Engineering,Requirements engineeringThe outcome of the system engineering process is the s
39、pecification of a computer-based system or product at the different levels.But the challenge facing system engineers (and software engineers) is profound: How can we ensure that we have specified a system that properly meets the customers needs and satisfies the customers expectations? There is no f
40、oolproof answer to this difficult question, but a solid requirements engineering process is the best solution we currently have.,System Engineering,Requirements engineeringRequirements engineering provides the appropriate mechanism for understanding what the customer wants, analyzing need, assessing
41、 feasibility, negotiating a reasonable solution, specifying the solution unambiguously, validating the specification, and managing the requirements as they are transformed into an operational system.,System Engineering,Requirements engineering processrequirements elicitationrequirements analysis and
42、 negotiationrequirements specificationsystem modelingrequirements validationrequirements management,System Engineering,How to model systemsEvery computer-based system can be modeled as an information transform using an input-processing-output template.To develop the system model, a system model temp
43、late is used. The system engineer allocates system elements to each of five processing regions within the template: - user interface - input - system function and control - output - maintenance and self test,System Engineering,User interface processing,Inputprocessing,Outputprocessing,Process and co
44、ntrolfunctions,Maintenance and self-test,System model template,System Engineering,System specificationIntroduction A. Scope and purpose of Document B. Overview 1. Objectives 2. ConstraintsFunctional and Data Descriptions A. System architecture 1. System context diagram 2. SCD Description,System Engi
45、neering,System specificationSubsystem Descriptions A. Architecture Diagram Specification for Subsystem n B. Architecture Dictionary C. Architecture Interconnect Diagrams and DescriptionSystem Modeling and Simulation Results A. System Model Used for Simulation B. Simulation Results C. Special Perform
46、ance IssuesProject Issues A. Projecte Development Costs B. Project ScheduleAppendices,Software Requirements Analysis,Software requirements engineering is a process of discovery, refinement, modeling, and specification.Both the software engineer and customer take an active role in software requirements engineering.,Software Requirements Analysis,Requirements analysis is a software engineering task that bridges the gap between system level requirements engineering and software design.,Systemengineering,Softwaredesign,