软件工程复习整理
Software crisisis a term used in the early days ofcomputing sciencefor the difficulty of writing useful and efficient computer programs in the required time.软件危机就是早期软件工程很难在规定时间内完成有用、高效率的计算机系统。
Software Engineering:
(1) The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software; that is, the application of engineering to software.
系统化、规范化、量化的方式来开发、操作和维护软件的应用,应用于软件的工程化
(2) The study of approaches as in (1).对1中方法的研究
Tools
Provides automated or semiautomated support for the process and the methods
A process is a collection of activities, actions, and tasks that are performed when some work product is to be created.完成软件的一系列活动、步骤和任务
Deployment
Think!
a process was defined as
a collection of work activities, actions, and tasks that are performed when some work products is to be created.
Process flow describes how the framework activities and the actions and the tasks that occur within each framework activity are organized with respect to sequence and time.
软件过程流就是框架活动、步骤和任务如何依据时间和顺序出现在框架活动中
Execute the activities in a “circular” manner
Execute one or more activities in parallel with other activities
用于评价软件机构的软件过程能力成熟度的模型。发展到后来,又同时被软件组织用于改进其软件过程。
Prescriptive process models (sometimes called “traditional” process models)
strive for structure and order in software development软件开发的结构和顺序
基于软件生命周期的线性工作模型,提出了系统、顺序地开发软件。从用户规格说明书开始,通过策划、建模、构建、部署,提供完整软件和持续的软件支持
Merits
Demerits
A working version of the program will not be available until late in the project time-span. 在项目最后才能使用软件
v-model改进了瀑布模型,在软件开发的生存期,开发活动和测试活动几乎同时的开始,这两个并行的动态的过程就会极大的较少bug和error出现的几率。在v-model中关键词就是parallel,是v-model的核心。
软件体系结构必须是开放的,即向现有产品中加入新构件的过程必须简单、方便
The spiral model
原型是指模拟要开发的系统的原始模型。在软件过程中,原型是软件早期一个可运行的版本,它反映最终系统的部分重要特性,如界面、功能或者性能等等。
Merits:
Demerits
Developers often make implementation compromises in order to get a prototype working quickly. Finally, the less-than-ideal choices has now become an integral part of the system.开发者为了更快构建原型而用不好的数据结构、算法,不太理想的选择变成系统部分
Originally proposed by Barry Boehm[Boe88], the spiral model is an evolutionary process model that couples the iterative nature of prototyping with the controlled and systematic aspects of the waterfall model.
螺旋模型是一种演化软件开发过程模型,它兼顾了快速原型的迭代的特征以及瀑布模型的系统化与严格监控。
螺旋模型最大的特点在于引入了其他模型不具备的风险分析,使软件在无法排除重大风险时有机会停止,以减小损失。同时,在每个迭代阶段构建原型是螺旋模型用以减小风险的途径。螺旋模型更适合大型的昂贵的系统级的软件应用。
增加了风险分析
The challenge for software team is to establish a proper balance between these critical project and product parameters and customer satisfaction.
The concurrent model is often more appropriate for product engineering projects where different engineering teams are involved.适用于有不同的软件工程团队的软件工程
and closely aligned with the Unified Modeling Language(UML).
PSP and TSP emphasize measurement, planning, and self-direction as a key ingredients for a successful software process.
理解需求是软件工程师所面临的最困难的任务之一
1997年IEEE在《软件工程标准词汇表》中对需求 (requirement)作出的定义为
(1) 用户为解决某一问题或为达到某个目标所需要的条件或能力。(需方)
(2) 系统或系统部件为满足合同、标准、规格说明或其他正式的强制性文档所必须具有的条件或能力。(供方)
对(1)和(2)中所描述的条件或能力的文档化说明。
Business requirements
业务需求反映了组织或客户高层次的目标要求,通常问题定义本身就是业务需求。
业务需求从总体上描述了为什么要开发系统(why),组织希望达到什么目标。
User requirements
用户需求描述了要求系统必须完成的任务,即用户能使用系统来做些什么(what)。
Functional requirements
功能需求描述开发人员应在产品中实现的软件功能,用户利用这些功能来完成任务,满足业务需求。
Requirements engineering establishes a solid base for design and construction.
Without it, the resulting software has a high probability of not meeting customers’ needs需求工程建立起从设计到构建的根基,从而满足客户需求
Inception起始Q&A+分类+决策
Establish basic understanding of
the problem,
the people who want a solution,
the nature of the solution that is desired, and
the effectiveness of preliminary communication and collaboration between the customer and the developer
Establish basic understanding,Identifying Stakeholders,Asking the First Questions,Recognizing Multiple Viewpoints,Working toward Collaboration,Working toward Collaboration,Nonfunctional Requirements,Traceability
Elicitation启发
Ask the customer, the users, and others
what the objectives for the system or product are,
what is to be accomplished,
how the system or product fit into the needs of the business, and,
how the system or product is to be used on a day-to-day basis.
QFD identifies three types of requirements
Developing Use Cases:Use case diagram provides a big picture of the functionality of the system
Elaboration精化
Develop a refined requirements model(Chapters 9-11) that identifies various aspects of software information, function, and behavior
Use case
Use case diagram
Activity diagram(8/e,P155
Sequence diagram
Flow-oriented elements
Data flow diagram(DFD) represents how data objects are transformed at they move through the system.
数据对象在系统中流动时是如何转换的
Negotiation谈判
Reconcile conflicts
defines a set of negotiation activities:
Specification具体化
Describe the requirements formally or informally.
Specification can be any one (or more) of the following:
Validation确认
Assess work products of requirement engineering for quality.
Management管理
Help the project team identify, control, and track requirements and changes to requirements
establishes constraints that software must meet建立起约束
and flow-oriented models.
to define a set of requirements that can be validated once the software is built.
The goal of domain analysis is to find or create those analysis classes and/or analysis pattern that are broadly applicable so that they may be reused.
Object-oriented Analysis
focus on the definition of classes and the manner in which they collaborate with one another
Scenario-Based Modeling:Requirements modeling with UML begins with the creation of scenarios in the form of
use cases,
activity diagrams, and
swimlane diagrams.
Swimlane diagram
collaborations that occur between the classes that are defined
collaboration diagrams, and
packages.
Establish basic class relationships and collaborations
the collaborators on the right.
Static elements
Class-based models
Sequence diagrams indicate how events cause transitions from object to object.
顺序图
Configuration model
Data flow diagram (DFD) is the diagrammatic form that is used
五个框架活动
设计创建了软件的表示或模型,但与需求模型(注重描述所需的数据、功能和行为)不同的是,设计模型提供了软件体系结构、数据结构、接口和构件的细节,这些是实现系统所必需的。
数据/类设计创造一个模块和信息代表着高水平模块抽象
is equivalent to the floor plan(平面图) of house
The interface design describes how the software communicates with systems that interoperate with it , and with humans who use it.
An interface implies a flow of information (e.g., data and /or control) and a specific type of behavior.
Therefore, **usage scenarios and behavioral models** provide much of the information required for interface design.
The component-level design transforms structural elements of the software architecture into a procedural description of software components.
Information obtained from the class-based models, and behavioral models serve as the basis for component design.
良好的设计应该有以下几个特征
低耦合:Low coupling
Firmness,
Commodity,
Delight.
设计提供软件的全貌,从实现角度说明数据域、功能域、行为域
质量属性(FURPS)
Design approaches
任务集
Architecture—the overall structure of the software
the structure or organizationof program components,
the manner in which these components interact, and
the structure of data that used by the components.
Patterns—”conveys the essence” of a proven design solution
A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design
Separation of concerns—any complex problem can be more easily handled if it is subdivided into pieces
A concern is a feature or behavior that is specified as part of the requirements model for the software
模块化是关注点分离最常见的表现。
Cohesion is an indication of the relative functional strength of a module.
- A cohesive module performs a single task, requiring little interaction with other components in other parts of a program.
- Stated simply, a cohesive module should (ideally) do just one thing.
Coupling is an indication of the relative interdependence among modules.
- Coupling depends on the interface complexity between modules, the point at which entry or reference is made to a module, and what data pass across the interface.
Refinement—elaboration of detail for all abstractions(逐步求精)
Stepwise refinement is a top-down design strategy.
Design for Test
“Advocates of test-driven development(TDD) write tests before implementing any other code.”
Polymorphism
多态性是指相同的操作或函数可作用于多种类型的对象上并获得不同的结果。
不同的对象,收到同一消息可以产生不同的结果,这种现象称为多态性。
Polymorphism is a characteristic that greatly reduces the effort required to extend the design.
内聚(cohesion)和耦合(couping)
好的设计应该高内聚低耦合
数据设计创建在高抽象级上(从用户的观点)表示的数据模型和(或)信息模型,之后该模型被逐步精化为系统能够处理的表示。
The architectural design for software is the equivalent to the floor plan of a house.Architectural design elements give us an overall view of the software.
The architectural model [Sha96] is derived from three sources:
architectural patterns and styles
The interface design for software is analogous to a set of detailed drawings for the doors, windows, and external utilities of a house.
Three important elements
The component-level design for software is the equivalent to a set of detailed drawings (and specifications
The component-level design defines
an interface that allows access to all component operations
Deployment-level design elements indicate how software functionality and subsystems will be allocated within the physical computing environment.
软件体系结构是指系统中的一个或多个结构,结构中包括构件、构件的可见外部属性和他们之间的联系,体系构建不是可运行的程序
体系结构描述实际上是一组工作产品,这些产品反映了不同的利益相关者从不同的角度对系统的理解
The IEEE Standard defines an architectural description (AD) as a “a collection of products to document an architecture
Each style describes a system category that encompasses:
体系结构风格:
Layered architectures
Describing Instantiations of the System
描述系统实例
UML
Pattern-Based Architecture Review
“… a modular, deployable, and replaceable part of a system that encapsulates implementation and exposes a set of interfaces.”一个模块,可部署、可替换的系统部分能够实现并且暴露一系列接口
--- OMG UML Specification [OMG01]
Object-Oriented view
A component contains a set of collaborating classes
Further elaborationTraditional view
A traditional component, also called a module
The Liskov Substitution Principle (LSP)
“Subclasses should be substitutable for their base classes.”
子类可以替换它们的基类。
LSP是使OCP成为可能的主要原则之一。
正是由于子类型的可替换性才使得使用基类类型的模块在无需修改的情况下就可以扩展。
Dependency Inversion Principle (DIP)
“Depend on abstractions. Do not depend on concretions.”
依赖于抽象,而不是依赖于具体实现。
The Interface Segregation Principle (ISP)
“Many client-specific interfaces are better than one general purpose interface.”
多个客户专用接口比一个通用接口更好。
The Common Reuse Principle (CRP)
共同复用原则
Identify Classes
Describe persistent data sources
Describe persistent data sources (databases and files) and identify the classes required to manage them.
描述持久数据源(数据库和文件)并确定管理数据源所需要的类
Elaborate behavioral representations
It is sometimes necessary to model the behavior of a design class
The best designers will consider many alternative design solutions before settling on the final design model.
Structured design uses a set of constrained logical constructs
sequence
condition
repetition
Traditional component-level design requires the representation of data structures, interfaces, and algorithms for a program module in sufficient detail.
用户界面分析框架活动:用户、任务环境分析和建模,接口设计,接口构建,接口确认。
Testing is the process of exercising a program with the specific intent of finding errors prior to delivery to the end user
Verification(验证) refers to the set of tasks that ensure that software correctly implements a specific function.
确保软件正确地实现某一特定功能的一系列任务
Validation(确认) refers to a different set of tasks that ensure that the software that has been built is traceable to customer requirements.
确保开发的软件可追溯到客户需求的另外一系列任务
security