Professional Documents
Culture Documents
1 上课 10 上机练习
2 上课 11 上课
3 上课 12 上机练习
4 上机练习 13 上课
5 上课 14 上机练习 / 测试
6 上机练习 15 上课
7 上课 16 上机练习
8 上机练习 / 测试 17 上课
9 上课 18 上机练习 / 测试
Overview ---- about our course
This course is an introduction to software engineering.
Including the principles and practices that contribute to
producing better software
making software development more predictable and economical.
You will learn about
how software development practices have changed in the last few
decades( 面向过程 – 面向对象 )
the different phases that a software product goes through.
You will study
specific techniques for improving the quality of products, for each
phase of software development
You will read about
the interactions and expectations of groups and organizations that
participate in the software development process.
course organization
The course is organized into
eight units, each with several sections.
All units have
a multiple-choice quiz (sum. 8 )
a practical exercise (but the first unit, sum. 9).
The exercises are part of the project for the course and lead
you to create a software product from start to finish.
There are also three in-class exams.
Prerequisites
SSD4 User-Centered Design and Testing
SSD7 Database Systems
Course Textbook
The required textbook for the course is:
Schach, Stephen. Object-Oriented and Classical
Software Engineering. 6th ed
Reference books
软件工 程:实 践者 的研究 方法 (第 6 版) , (美)
ROGER S.PRESSMAN
软件工 程导论 (第 四版) , 张海藩
人月神 话 , (美 ) Frederick P. Brooks , Jr.
MySQL 使用 指南
Java/jdbc 程序设 计
大量专 门针对 开发 各阶段 的技 术与方 法书 籍
需求工程
OOA/OOD
编程实践
个人 / 小组过程
测试
……
Assigned Reading
A complete list of SSD9 Required Readings has
been compiled for your reference.
SSD9 Required Readings
Section Sixth Edition Fifth Edition
1.2 1.1 1.1
1.3 1.2–1.10 1.2–1.6
1.4 1.11 1.7 and 2.1
2.1 3.1–3.2
2.1.2 3.3–3.4, 10.1–10.4 2.2, 2.3, and 10.1
2.1.3 3.5 2.4
2.1.4 3.6 2.5
2.1.5 3.7 2.6
2.1.6 3.8 2.7
2.2 2.1–2.8
2.2.1 2.9.1 3.1
SSD9 Required Readings
Section Sixth Edition Fifth Edition
2.2.2 2.9.2 3.2
2.2.3 2.9.3, 10.12–10.14 3.3, 10.3–10.7
2.2.4 3.4
2.2.5 2.9.5 3.6
2.2.6 2.9.6 3.7
2.2.7 3.8
2.2.8 2.10 3.9
3.1.1 11.1–11.2 11.1–11.2
3.1.2 11.3 11.3
3.1.3 11.7 11.6
3.2 11.6 11.5
SSD9 Required Readings
Section Sixth Edition Fifth Edition
4.1.1 12.1–12.2 12.1
4.1.2 12.3–12.4 12.2–12.3
4.1.3 12.5 12.4
4.1.4 12.6 12.5
4.3.1 12.5.1 12.4.1
5.1.1 7.1–7.3 7.1–7.3
5.1.2 13.1–13.9 13.1–13.7
5.1.4 13.12 13.8
5.1.5 13.10–13.11, 13.14 13.10–13.11
6.1.1 8.1–8.6 8.1–8.6
6.1.2 14.1–14.2 14.1–14.2
SSD9 Required Readings
Section Sixth Edition Fifth Edition
6.1.3 14.3–14.4 14.3–14.4
6.2.1 14.10–14.13.1 14.6–14.8.1
6.2.2 6.2, 14.14 6.2, 14.9
6.2.3 6.5, 14.13.2, 14.16, 14.25 6.5, 14.8.2, 14.11, 15.12
6.2.4 14.15–14.19 14.10–14.14
6.3 14.6, 14.20 15.1–15.3
6.4 6.4, 14.21–14.22 6.4, 15.4–15.5
6.5 5.4–5.10, 14.24.1–14.24.2 5.4–5.10 and 15.6–15.8
2.2.2, 2.3.2, 2.4.2, 2.5.2,
7.1
2.6.2, 2.7.2
7.5 9.9 9.9
SSD9 Required Readings
Section Sixth Edition Fifth Edition
8.1 15.1–15.3, 15.6 16.1–16.3, 16.6
8.2 15.4, 15.7–15.8 16.4, 16.7–16.8
8.3 15.5 16.5
8.4 15.9–15.11 16.9–16.11
The purpose of SSD9 is for students to Learn
the principles and practices for producing better
software and for making software development more
predictable and economical
to examine critically the different phases of a software
product's life cycle
various approaches to software design
the role of software architecture in software design
structured systems analysis, object-oriented analysis
(OOA), and object-oriented design (OOD)
the different types of software testing, documentation,
and maintenance techniques
to design and build Internet-based software projects of
significant scale
acquiring experience in all phases of the software
product life cycle
Students successfully completing SSD9 will be able to
Assessments
Multiple-Choice Quiz 1
1.1 Software Challenges and Myths
In this module we will briefly survey
some of the challenges to be faced when developing
software
some of the misconceptions about software development
that have sprung up over the relatively short history of
large-scale software production.
过来人会 告诉你……
anyone who has participated in developing
software products of any significant size or
complexity will tell you two things.
if there is something you can count on, it is that it will
take you longer to finish than you expect.
even when you think the product is completed,
problems will still be lurking(" 潜伏 ") that testing will
not have found.
Past and present
In the old days, people used to say that whatever time
estimate you thought was reasonable, you should ( ×3,
× 10 ) .
software development manager think:
development delays, and errors found after delivery can incur unacceptable
losses:
additional (unexpected) costs
greatly diminished customer satisfaction( 满意度 ) and confidence( 信任度
)
In today‘s competitive environment
getting a product to market on time and with as few residual
“bugs”( 残留的缺陷 ) as possible can mean the difference
between the success and failure of a product, or even a company.
软件危机
软件危机
是指在计算机软件的开发和维护过程中所遇到的一
系列严重问题。
20 世纪 60 年代末至 20 世纪 70 年代初 ,“软
件危机”一词在 计算机界广 为流传。
事实上,几乎从 计算机诞生 的那一天起 ,就
出现了软件危机 ,
到了 1968 年在原西德 Garmish 召开的 NATO
的 国际软件工 程会议 上才被人们普遍 认识到
。
正是这次会议, “软件工程 ”正式提出 并被
软件危 机的表现 - 软件成 本日益增 长
计算机 发展的 早期
大型计算机系统主要是被设计应用于非常狭窄的军事领域。
研制计算机的费用主要由国家财政提供,研制者很少考虑到
研制代价问题。
随着计 算机市 场化 和民用 化的 发展
代价和成本就成为投资者考虑的最重要的问题之一
20 世纪 50 年代 ,
软件成本在整个计算机系统成本中所占的比例为 10%-20% ,
主要是硬件成本太高。
计算机硬件随着技术的进步 ( 晶体管的发明、集成电路 ) 、生
产规模的扩大,价格却不断下降
随着软件产业的发展,软件成本日益增长。
软件成本在计算机系统中所占的比例越来越大。
软件危 机的表现 - 软件成 本日益增 长
到 20 世纪 60 年代中期
软件成本在计算机系统中所占的比例已增长到约
50%
而且没有维持这个数字,该数字还在不断地递增,
以下是一组来自 美国空军计 算机系统的 数据
:
1955 年占 18% ,
1970 年达到 60% ,
1975 年达到 72% ,
1980 年达到 80% ,
1985 年达到 85% 左右
为什么会有这么 高的比例
人力成本增加,智力劳动之前了
软件危 机的表现 - 开发进 度难以控 制
由于软件是逻辑 、智力产品 ,软件的开 发需
建立庞大的逻辑 体系,这是 与其他产品 的生
产不一样的。
例如:工厂里要生产某种机器,在时间紧的情况下
可以要工人加班或者实行“三班倒”,而这些方法
都不能用在软件开发上。
在软件开发过程 中,用户需 求变化等 各种意
想不到的情况 层出不穷,
软件开发过程很难保证按预定的计划实现
给项目计划和论证工作带来了很大的困难
软件危 机的表现 - 开发进 度难以控 制
BROOK 曾经提出: “ 在已拖延 的软件项 目
上,增加人力只 会使其更难 按期完成 ”。
软件系统结构复杂,各部分附加联系极大,盲目增
加软件开发人员并不能成比例地提高软件开发能力
。
相反随着人员数量的增加,人员的组织、协调、通
信、培训和管理等方面的问题将更为严重。
许多重要的大型 软件开发项 目,由于离 预定
目标相差甚远不 得不宣布失 败
例如: IBM OS/360 和世界范围的军事命令控制系统
( WWMCCS ),在耗费了大量的人力和财力之后
,宣布失败。
软件危 机的表现 - 软件质 量差
软件项 目即使 能按 预定日 期完 成,结 果却 不尽人 意
。
例如: 1965 年至 1970 年,美国范登堡基地发射火箭多次失
败,绝大部分故障是由应用程序错误造成的。
程序的 一些微 小错 误可以 造成 灾难性 的后 果,
例如:美国发射一枚阿脱拉斯火箭,火箭飞离地面几十英里
高空开始翻转,地面控制中心被迫下令炸毁。后经检查发现
是飞行计划程序里漏掉了一个连字符。
一个小小的疏漏造成了这支价值 1850 万美元的火箭试验失败。
在“软 件作坊 ”里 ,
缺乏工程化思想的指导,程序员几乎总是习惯性地以自己的
想法去代替用户对软件的需求,
软件设计带有随意性,很多功能只是程序员的 " 一厢情愿“
软件 危机的表现 -软件维 护困难
正式投 入使用 的软 件, 总是存 在 着一 定数量 的错 误
,
在不同 的运行 条件 下,软 件就 会出现 故障 ,因此 需
要维护 。
由于在软件设计和开发过程中,没有严格遵循软件开发标准
,各种随意性很大,没有完整的真实反映系统状况的记录文
档,给软件维护造成了巨大的困难。
特别是在软件使用过程中,原来的开发人员可能因各种原因
已经离开原来的开发组织,使得软件几乎不可维护。
软件修 改是一 项很 “危险 ”的 工作,
对一个复杂的逻辑过程,哪怕做一项微小的改动,都可能引
入潜在的错误
常常发生“纠正一个错误带来更多新错误”的问题,从而产
生副作用。
资料表 明 ,工 业界为 维护 软件支 付的 费用占 全部 硬
件和软 件费用 的 40%-75% 。
1976–1981 data
Maintenance constitutes 67% of total cost
软件危 机的原因 -用户需 求不明确
从软件危机的种 种表现和软 件作为逻辑 产品
的特殊性可以发 现软件危机 的原因
用户需求不明确 问题主要体 现在四个方 面:
在软件开发出来之前,用户本人也不清楚软件的具
体需求;
用户对软件需求的描述不精确,可能有遗漏、有二
义性、甚至有错误;
在软件开发过程中,用户还提出修改软件功能、界
面、支撑环境等方面的要求;
软件开发人员对用户需求的理解与用户本来愿望有
差异。
软件危机 的原因 -缺乏正确 的理论指导
缺乏有力的方法 学和工具方 面的支持。
由于软件不同于 大多数其他 工业产品, 其开
发过程是复杂的 逻辑思维过 程,其产品 极大
程度地依赖于开 发人员高度 的智力投入 。
过分地依靠 程序设计人员在 软件开发过 程中
的 技巧和创造 性 ,
加剧软件产品的个性化,也是发生软件危机的一个
重要原因。
所以,软件开发 团队中不需 要“个人英 雄主
义”!
软件危 机的原因 -软件规模越 来越大
随着软件应用范 围的增广, 软件规模愈 来愈
大。大型软件项 目需要组织 一定的人力 共同
完成,
多数管理人员缺乏开发大型软件系统的经验,
多数软件开发人员又缺乏管理方面的经验。
如何克 服软件危 机
软件工 程是
用工程、科学和数学的原则与方法研制、维护计算机软件的
有关技术及管理方法。
软件工 程包括 三个 要素:
( 1 )方法。软件工程方法为软件开发提供了“如何做”的
技术,是完成软件工程项目的技术手段;
( 2 )工具。软件工具是人类在开发软件的活动中智力和体
力的扩展和延伸,为软件工程方法提供了自动的或半自动的
软件支撑环境;(工欲善其事,必先利其器)
( 3 )过程。软件工程的过程则是将软件工程的方法和工具
综合起来以达到合理、及时地进行计算机软件开发的目的。
迄今为 止,软 件工 程的研 究与 应用已 经取 得很大 成
就,它 在软件 开发 方法、 工具 、管理 等方 面的应 用
大大缓 解 了软 件危机 造成 的被动 局面 。
Questions ? So many Whys……
Why are the costs of software development so
high?
In part, because software development frequently goes
over the estimated time limits.
why does it take so long to get programs
finished?
Why do we have difficulty measuring
development progress?
why can we not find all errors before we deliver?
Anwser for Whys……
We do not have a simple answer because
the software process is a complex one,
involving multiple parties
Each have different objectives( 实现目标 ) and constraints( 约束
条件 ). (需求、分析设计、实现、调试、部署、维护……)
The actors (the customers, managers, and developers) in
software production with seemingly
reasonableexpectations and attitudes ( 看上 去很 合理
的想法 )
that can contribute to increasing the time and cost of product
development.
Some of these expectations and attitudes, although
mistaken, are quite widespread that they have acquired
a mythical status.
SOFTWARE MYTHS( 软件神话, 软件开发的 误
区)
Today, most knowledgeable professionals
recognize myths for what they are—
misleading attitudes that have caused serious problems
for managers and technical people alike.
old attitudes and habits are difficult to modify, and
remnants of software myths are still believed.
Types
Management myths
Customer myths
Practitioner's myths
Management myths
Managers with software responsibility, like
managers in most disciplines, are often under
pressure to
maintain budgets
keep schedules from slipping
improve quality
"My people have state-of-the-art software development tools, because we bought them the newest computers."
Hardware by itself contributes relatively little to high-quality software development; it is more important to have
good software tools and well-defined development practices.
development time
development cost
product quality
Maintainability
and so on……
An example of software development
the FastWeb company decides to develop a program
that will convert a set of documents to HTML format.
If this job is to be done once, by internal staff only,
it might make sense to select a development methodology that
minimizes cost and time, at the possible expense of quality.
It is okay if the software crashes once in a while, because external
customers will never use it.
On the other hand, if the conversion program will
become part of FastWeb's suite of support tools for
external customers,
quality and maintainability are much more important;
in this case, a development methodology that produces software
that is more reliable may be considered optimal even if it takes
more time and money.
model of software development
Any model of software development must take
into consideration that the software goes through
several different phases in its lifetime.
All software development involves these basic
activities:
requirements analysis,
specification,
design,
Implementation,
integration,
maintenance
retirement.
Requirements analysis:
The developer meets with the customer to
understand the problem to be addressed by the
proposed software system.
an interview process
explore and refine the concept
identified and discussed the client's specific
requirements and constraints
What we get in this phase
a requirements document or checklist
Specification
Using the requirements document as a guide
the developer produces
a specification for all of the functionality to be included
in the product
a development methodology
an integration plan
……
About these phases
In practice, some life-cycle models emphasize an
approach where
each phase can and should be undertaken more than once
in an iterative or cyclic fashion.
This is often necessary when certain aspects of
the requirements, design, etc. are not well
understood until after some software has already
been constructed.
Classical vs OO approach
"classical" software engineering,
focuses on the construction of structured programs.
Specific code modules, programming languages, etc. are
not actively considered until after the specifications
phase has ended.
the object-oriented approach
explicitly consider reusing existing code objects during
the analysis and specification phases.
note
You should understand
the boundaries of the different phases are fluid (不是一
成不变的) ;
depending on the life-cycle model and implementation
approach,
different tasks may fall under( 应用 ) different phases
included in
Specifications 5%
requirements
Design 6% 18% / 19%
36% / 34% (and
Module coding 5%
testing)
Module testing 7% included in coding
Integration 8% 24% / 29%
Maintenance 67% —
comparative time and effort spent
Surprisingly, the most time is not spent in the
original coding of the modules, but in
maintenance activities after delivery.
This is especially true of software that remains in
service for long periods of time, that typically
undergoes several modification to accommodate
changing requirements
changes in the operating environment
scheduling
1.4 Terminology
some of the key terms in software engineering
were presented and explained.
key terms
A product is any nontrivial piece of software. 具有使用 价值地
软件
A system is the combination of hardware and software that runs
the product.
A methodology 方法 or paradigm 模式 is a particular
approach, or set of techniques, designed to accomplish a specific
phase or a number of phases in the software development life
cycle.
A bug is the colloquial term( 口头语 ) used to refer to a software
fault.
Although this term is commonly used by programmers and users, it is
important to break the notion down( 区分开 ) more formally into three terms
with different meanings:
A fault( 差错 ) is the actual problem in the code that is causing a
failure.
A failure( 故障 ) is the behavior perceived by the user that results
from the fault in the code.
An error( 错误 ) is the programmer's mistake that led to the
fault in the code.
example for distinction between fault , failure and error
an error might occur when the programmer
forgets to copy the latest version of a Java class
file to the directory from which the product is
assembled in preparation for delivery.
The fault might be that the product throws an
unknown method exception and terminates.
The observed failure might be that the system
freezes when the user clicks on the "Save"
button in the product's user interface.
This simple example illustrates how difficult it
can be to uncover the error from the observed
failure.
more group of terms
the three main participants in the software
development process:
The client
the individual or organization who wants a product to be
developed
The developer
the individual or group responsible for building the product
The user(s)
the person or persons who will utilize the product and on
whose behalf the client has commissioned the product
The roles of client, developer, and user
Sometimes the client and the user are the same
individual or organization, and the developer is
some outside party contracted to build the
software.
医院管理层委托欲开发手术病人体征记录软件,医
生护士使用
For smaller software projects, the developer may
be an individual rather than an organization.
At other times, all three roles may be filled by
groups inside the same organization.
学校开发教学管理系统,或许教务部委托国软学院
开发,全校师生使用 .
distribution of roles in software development
contract software development
the client and the developer are completely separate organizations
internal software development
the client and the developer are part of the same organization, is an instance of.
Commercial off the shelf ( 商用现 货 ) / shrink-wrapped software
the software product is being developed by a company or individual in
response to a perceived market need.
the client could be identified with the management of the company
the developer with the technical division of the company
the user with the potential customer for the product.( 所有有需求的人 )
Other variations also possible.