软 件 工 程 Software Engineering

Download Report

Transcript 软 件 工 程 Software Engineering

Software Engineering
Lecturer: YU Jun
School of Computer Science and Engineering,
Xi’an Technological University
Course Overview
•
•
•
•
•
•
•
•
•
What is software engineering?
Modeling the process and life cycle
Planning and managing the project
Capturing the requirements
Designing the system
Concerning objects
Writing the programs
Testing the software
Maintaining the system
 教材(TextBook)
Software Engineering: Theory and
Practice (Second Edition) .
Shari Lawrence Pfleeger.
Prentice-Hall, Inc. 2001
 参考书目 (References)
 Fundamentals of Software
Engineering (2nd Edition)
Carlo Ghezzi, Mehdi Jazayeri, Dino Mandrioli
Prentice-Hall, Inc. (2002)
 Software Engineering: A
Practitioner’s Approach
(Sixth Edition)
Roger S. Pressman,
Mc Graw Hill (2006)
 参考书目 (References)
 软件工程导论(第4版)
张海藩, 清华大学出版社(2003)
其它参考资料
系统/软件工程研究与实践论坛 http://www.sweforum.net
UML软件工程组织
http://www.uml.org.cn/
IT之源
http://www.iturls.com/
UML之源
http://www.umlchina.com
软件工程协会
http://www.sei.cmu.edu/
科学文献索引
http://citeseer.nj.nec.com/
Chapter 1: What is software engineering?
 The Evolving Role of Software
In the early days:
User  Computer
Software = “Place a sequence of instructions together to
get the computer to do something useful”.

In late 1950’s: User  Programmer Computer
Computer became cheaper and more common
High level languages were invented
In early 1960’s:
Very few large software projects were done by
some experts.
In middle to late 1960’s:
Truly large software systems were attempted.
Case 1. 美国IBM公司在1963年至1966年开发的IBM360机
的操作系统。这一项目花了5000人一年的工作量,最多时
有1000人投入开发工作,写出了近100万行源程序。据统计,
这个操作系统每次发行的新版本都是从前一版本中找出
Or
Software
maybe Crisis
Chronic
!
1000个程序错误而修正的结果。
-- NATO Conference,
Affliction
is more
这个项目的负责人F.
D. Brooks事后总结了他在组织开
Garmisch,
Germany, 1968
accurate?
发过程中的沉痛教训时说:“…正像一只逃亡的野兽落到
泥潭中做垂死的挣扎,越是挣扎,陷得越深,最后无法逃
脱灭顶的灾难。…程序设计工作正像这样一个泥潭,…一
批批程序员被迫在泥潭中拼命挣扎,…谁也没有料到问题
竟会陷入这样的困境…”。
IBM360操作系统的历史教训成为软件开发项目的典型
事例为人们所记取。
 What is Software ?
Software is a set of items or objects that form a configuration
that includes
 instructions (computer programs) that when executed provide
desired function and performance,
 data structures that enable the programs to adequately
manipulate information, and
 documents that describe the operation and use of the
programs.
AND MORE …(Characteristics of software)
 Software is developed or engineered, it is not manufactured
in the classical sense.
High quality is achieved through good design
Depend on people
Require the construction of a “product”
PART ONE
 Software doesn’t wear out.
But it does deteriorate!
increased failure
rate due to side effects
Failure
rate
Infant
mortality
change Failure curve
for hardware
There are no
software spare parts
Wear 
out
actual curve
idealized curve
Time
 Although the industry is moving toward component-based
assembly, most software continues to be custom built.
Today(Evolving role of software)
Dramatic improvements in hardware performance
Profound changes in computing architectures
Vast increases in memory and storage capacity
Wide variety of exotic input and output options
Software =
More
sophisticated
and complex
computer-based
systems
Product (information transformer)
Vehicle for delivering a product (OS, network, tools)
 The same questions are still asked today:
Why does it takes so long to get software finished?
Why are development costs so high?
Why can’t we find all the errors before we give the
software to customers?
 Why do we continue to have difficulty in measuring
progress as software is being developed?
Case 2.
In the late 1960s, a bright-eyed young engineer* was chosen to
“write” a computer program for an automated manufacturing
application. The reason for his selection was simple. He was the only
person in his technical group who had attended a computer
programming seminar. He knew the in’s and out’s of assembler language
and Fortran, but nothing about software engineering and even less about
project scheduling and tracking.
His boss gave him the appropriate manuals and a verbal description
of what had to be done. He was informed that the project must be
completed in two months.
He read the manuals, considered his approach, and began writing
code. After two weeks, the boss called him into his office and asked how
things were going.
“Really great,” said the young engineer with youthful enthusiasm,
“This was much simpler than I thought. I’m probably close to 75 percent
finished.”
The boss smiled. “That’s really terrific,” he said. He then told the
young engineer to keep up the good work and plan to meet again in a
week’s time.
*If you’re wondering whether this story is autobiographical, it is!
A week later the boss called the engineer into his office and asked,
“Where are we?”
“Everything’s going well,” said the youngster, “but I’ve run into a
few small snags. I’ll get them ironed out and be back on track soon.”
“How does the deadline look?” the boss asked.
“No problem,” said the engineer. “I’m close to 90 percent
complete.”
If you’ve been working in the software world for more than a few
years, you can finish the story. It’ll come as no surprise that the
young engineer stayed 90 percent complete for the entire project
Managers
evaluate,
track
duration and only finished
(with ——
the help
of others)
one month late.
progress, ......
Programmers —— communicate to
each other
Myth: The only deliverable for a successful project is the working
Maintainers —— VITAL!
program.
Reality: A working program is only one part of a software configuration
that includes programs, documents, and data. Documentation forms
the foundation for successful development and, more important,
provides guidance for software support.
1.1 What is Software Engineering?
Solving Problems
Problem
Analyzing
Attention: the small ones’
relationships
Synthesis
Any problem_solving technique must have two parts:
 Analyzing the problem to determine its nature;
 Synthesis the solution based on the analysis.
To help us solve a problem,we use a variety of methods, tools,
procedures, and paradigms.
 A method or technique is a formal procedure for producing
some result.
 A tool is an instrument or automated system for accomplishing
something in a better way.
 A procedure is a combination of tools and technique that,in
concert,produce a particular product.
 A paradigm represents a particular approach or philosophy for
building software.
Where does the software engineer fit in?
Computer Science
theories
Customer
Computer
functions
Software
engineering
Tools and
techniques to
solve problems
problem
1.2 How Successful Have We Been?
Software engineering is about designing and developing
high_quality software.
But software is not without its problems.
Sidebar 1.1 Terminology for describing bugs
BUG: is a mistake in interpreting a requirement,a syntax error in a
piece of code,or the (as-yet-unknown) cause of a system crash.
FAULT:occurs when a human makes a mistake,called an error,in
performing some software activity.A single error can generate
many faults,and a fault can reside in any development or
maintenance product.
FAILURE:is a departure from the system’s required behavior.It
can be discovered before or after system delivery,during testing,or
during operation and maintenance.
1.3 What Is Good Software
What we mean by high-quality?
Sidebar 1.2 Perspective on Quality
Garvin describes quality from five different perspective:
The transcendental view,where quality is something we can
recognize but not define
The user view,where quality is fitness for purpose
The manufacturing view,where quality is conformance to
specification
The product view,where quality is tied to inherent product
characteristics
The value-based view,where quality depends on the amount
the customer is willing to pay for it
For a software product,we must consider its quality in three aspects:
The quality of the product
The quality of the process
The quality in the context of the business environment
1.4 Who Does Software Engineering?
Sponsors system
development
customer
user
Users
system
Contractual
obligation
needs
Software
system
$$ needs
developer
Builds
system
1.5 A System Approach
A system is a collection of objects and activities,plus a description
of the relationships that tie the objects and activities together
The Elements of a System---- Activities and Objects
an activity is something that happens in a system
an object or entity is the element that is involved in the activity
First name
Postal code
Middle name
Salary per hour
Last name
Benefits per hour
Street address
Vacation hour accrued
City
Sick leave accrued
State
Relationships and the System Boundary
we can think of the system at which we are looking as having a
border or boundary. Some item cross the boundary to enter our system,
and others are products of our system and travel out for another
system’s use.
A system is a collection of things: a set of entities, a set of
activities, a description of the relationships among entities and
activities, and a definition of the boundary of the system
computer
System boundary
mail
Pay
checks
Pay
information
Date validation
calculation
printing
Interrelated Systems
Because very few system are independent of other systems, the
concept of boundary is important, and we should know what is within
and without the system and what crosses the boundary.
In addition, it is possible for one system to exist inside another
system. If so, we can concentrated on a small piece of what is really a
much larger system
Reporting system for data
Data management system for
collected data
Communication system from
remote sites to central
Calculation system for
remote data
Remote data collection system
1.6 An Engineering Approach
Building a house
Determining and analyzing the requirements
Producing and documenting the overall design of the house
Producing detailed specification of the house
Identifying and designing the components
Building each component of the house
Testing each component of the house
Integrating the components making final modifications after
the residents have moved in
Continuing maintenance by the residents of the house
Building a system
Requirements analysis and definition
System design
Program design
Writing the program
Unit testing
Integration testing
System testing
System delivery
maintenance
1.7 Members of the development team
Requirements analysis and definition
ANALYST
DESIGNER
System design
Program design
Program implementation
PROGRAMMER
Unit testing
TESTER
Integration testing
System testing
TRAINER
System delivery and maintenance
1.9 Information Systems Example
Advertising agencies
Preemption
warning
Suggested
Agreed
Selected Spot
Copy
campaign
campaign
spots upgrade
transmission
Agency
Ratecard
instructions Campaign
request
invoice
requirements
Program
Television
transmission
ratings
Piccadilly Television
schedule
report
Airtime Sales
Upgrade
confirmation
Audience
measurement
bureaus
New
Commercial
Program program
Sales
copy
Program Programming purchase
Revenue
recording target
agreement
transmission
report
rules
instruction
schedule
Production
companies
Piccadilly
management
Broadcasting
board
Program
suppliers
学期项目:Loan Arranger
计划:全部同学共分为10组,每组8人,每
一个小组推选一位负责人,作为项目经理。
项目经理有权利对小组其它的人员进行具
体的角色分工和人事调整。每组人员的角
色可为:
1. 项目经理
2. 系统分析人员
3. 系统设计人员
4. 系统实施人员
5. 系统测试人员
要求:
 项目经理负责:组织、分工、控制进度;
对每次组员成绩有 5 分浮动调整权;
 项目经理奖罚:引起过半数组员不满,则改选;
带领全组顺利完成任务,总评+10。
小组成员:在项目经理的统一协调下完成项目,
根据完成的质量来决定最后的成绩。
内 容
1. 需求规格说明书(书面)
2. 总体设计报告 (演讲)
3. 推出 v1.0 (现场验收)
4. 推出升级版(现场验收)
5. 面向对象分析练习题一道(演讲)
6. 推出期末最终版并制作案例总结报告(现场
验收和演讲)
目 的
 体验软件工程各阶段的主要工作,特别
注意吸取教训;
 学会与他人合作,培养团队精神,单干
户将得不到成绩。
从现在开始,谁也不知道我们的
项目会不会成功,但是请牢记:目标、
交流与合作、内省