Software Engg Chapterone
Software Engg Chapterone
Software Engg Chapterone
Software Engineering
主讲人:张敏灵
Email: zhangml@seu.edu.cn
URL: http://cse.seu.edu.cn/PersonalPage/zhangml/
教材
布吕格[美], 迪图瓦[美]
面向对象软件工程:使用
UML、模式与Java, 第3版
清华大学出版社, 2011
课程信息
学时/学分
1-16周(周二),3学分
讲授内容(红色标注部分)
Part I: 软件工程导论、UML等
Part II: 需求获取、分析、设计、测试等
Part III: 配置管理、项目管理、软件生命周期等
考核方式
平时成绩(出勤率+作业):5%
课程Project:20%
期末考试:75%
http://cse.seu.edu.cn/PersonalPage/zhangml/
http://cse.seu.edu.cn/PersonalPage/zhangml/
Object-Oriented Software Engineering
Using UML, Patterns, and Java
Requirements for this Class
You are proficient in a programming language,
but you have no experience in analysis or design
of a system
20
SE: A More Detailed Definition
Software engineering is a modeling, problem-solving,
knowledge acquisition, and rationale-driven activity.
Modeling
Software engineers deals with complexity through modeling
Problem-solving
Models are used to search for an acceptable solution within
budget and time constraints
Knowledge acquisition
Software engineers collect data, organize it into information,
and formalize it into knowledge
Rationale-driven
Software engineers need to capture the context in which
decisions were made and the rationale behind these decisions
Modeling
What is model?
An abstract representation of a system
Enables us to answer questions about the system; Allows us to
visualize and understand systems
Why modeling for software engineers
Understand the environment which the system operates
Train traffic control train signaling procedures; Stock trading system
trading rules
Build a model of the application/problem domain
Understand the system they could build
Evaluate different solutions and trade-offs
Build a model of the solution domain
Object-Oriented (OO) Combine application & solution
domains by modeling both with objects and relationships
Problem Solving
Engineering is a problem-solving activity So does SE
Five steps of engineering method
Formulate the problem Analyze the problem Search for solutions
Decide on the appropriate solution Specify the solution
Six steps of object-oriented software engineering (OOSE)
Requirement elicitation + Analysis
Formulate the problem with client and build the application domain model
System design
Analyze the problem, break it into smaller pieces, select general strategies for
designing the system
Object design
Select detail solutions for each piece and decide on the appropriate solution
Implementation
Realize the system by translating the solution domain model into executable codes
Testing
Evaluate the appropriateness of the respective models
Knowledge Acquisition
A common mistake
The acquisition of knowledge needed to build a system is linear
Both for software engineers and managers
Knowledge acquisition is a nonlinear process
The addition of a new piece of information may invalidate all the
knowledge we have acquired for understanding
Implications: We must be prepared to start from scratch
Software life cycle
Waterfall model: assume linear dependencies in software development
Risk-based development: anticipate surprises at late in a project by
identifying the high-risk components
Issue-based development: Any development activity in OOSE can influence
any other activity
All activities are executed in parallel
Difficult to manage than linear development process
Rationale-Driven
Difficult life of a software engineer
Assumptions that developers make about a system change constantly
The solution domain models are in constant flux
Design and implementation faults discovered during testing
Usability problems discovered during user evaluation
The emergence of a new technology
……
A typical task of software engineers
Change a currently operational software system Capturing and accessing the
rationale of a system is necessary
A non-trivial task
For every decision made, several alternatives may have been made, considered
and argued
Rationale information (context in which decision being made) is often inexplicit
SE Concepts
Project
Whose purpose is to develop a software system
Composed of a number Activities
Activity
Composed of a number Tasks
Task
Consumes resources and produces WorkProduct
Resources
Participants, Time, or Equipment
WorkProduct
System, Model or Document
UML Diagram for SE Concepts
Participants and Roles
Participants: All the persons involved in the project
The client orders and pays for the system
The developers construct the system
The project manager plans and budgets the project and coordinates the
developers and the client
The end users are supported by the system
Role: A set of responsibilities in the project
A role is associated with a set of tasks
It is assigned to a participant
The same participant can fill multiple roles
A TicketDistributor system
Roles for the TicketDistributor Project
Systems and Models
System
A collection of interconnected parts
E.g.: A TicketDistributor for underground trains
Model
Any abstraction of the system
Blueprints for TicketDistributor , schematics of its electrical
wiring, objects models of its software, etc.
A project itself is a system that can be modeled
Project schedule
Budget
Planned deadline
……
Work Products
Work Product: An artifact produced during development
A document, a piece of software, a system, a model, etc.
Internal work product: for the project’s internal consumption
Deliverable: must be delivered to a client (Defined prior to the start of the
project and specified by a contract)
Activities, Tasks, and Resources
Activity: A set of tasks performed towards a specific purpose
Requirement elicitation: An activity with purpose to define what the system
will do for the client
Delivery: An activity with purpose to install the system at an operational
location
Management: An activity with purpose to monitor and control the project
such that it meets the goal (e.g., deadline, quality, budget)
Activities may comprise other activities (DeliveryInstallation+Training)
A.k.a. phase
Task: An atomic unit of work that can be managed
E.g.: A manager assigns it to a developer, the developer carries it out, and
the manager monitors the progress and completion of the task
Consumes resources, result in work products, and depend on work products
produced by other tasks
Resources: Assets that are used to accomplish work
Time, equipment, and labor
Activities, Tasks, and Resources for
the TicketDistributor Project
Functional and Nonfunctional Requirements
Requirements: Features that the system must have
Functional requirement: A specification of a function that the
system must support
The user must be able to purchase tickets
The user must be able to access tariff information
……
Requirements
Elicitation
Analysis
System Design
Object Design
Implementation
Testing
Requirement Elicitation
Activity: Client and developers define the purpose of the system
Result: Description of the system in terms of actors and use cases
Actors: end users, other computers to be dealt with, environment, etc.
Use cases: sequence of events that describe all the possible actions between an
actor and the system for a given piece of functionality
Analysis
Activity: Produce a model of the system that is correct, complete, consistent,
and unambiguous
Result: A system model in terms of structure and dynamic interoperation
Structure: UML class diagram
Dynamic interoperation: UML state machine diagram, UML sequence diagram
System Design
Activity: 1) Define the design goals of the project; 2) Decompose the system
into smaller subsystems that can be realized by individual teams
Hardware/software platform used, persistent data management strategy, global
control flow, access control policy, ……
Result: A system model (similar as analysis) including strategies for building
the system, the subsystem decomposition, etc.
Analysis deals with entities that the client can understand
System design deals with a much more refined model that includes many entities
that are beyond the comprehension (interest) of the client
Object Design, Implementation, and Testing
Object Design
Activity: Define solution domain objects to bridge the gap between the analysis
model and the hardware/software platform defined during system design
Precisely describing object and subsystem interfaces, selecting off-the-shelf
components, attain goals such as extensibility, comprehensibility, high-performance
Result: A detailed object model annotated with constraints and precise
description for each element
Implementation
Activity: Translate the solution domain model into source codes
Result: Implementations of the attributes and methods of each object
Testing
Activity: Find differences between the system and its models
Result: Faults discovered in various steps of the SE process
SE Management Activities
SE is not only about development, but also
about management
Planning and monitoring the status of project
Tracking changes
Coordinating resources to ensure high-quality, on time delivery
within budget
……
Communication
Management Rationale Management
Activities Software Configuration Management
Project Management
Software Life Cycle
Communication
The most critical and time-consuming activity in software engineering
Exchange of models and documents about the system and its application domain
Reporting the status of work products, providing feedback on its quality
Raising and negotiating issues
Communicating decisions
Misunderstanding and omissions faults and delays expensive to be
corrected later in the development
The most effective way Conventions
On notations: representing information
UML diagrams, templates for document writing and meeting minutes
On tools: manipulating information
CASE (Computer Aided Software Engineering) for maintaining models, word
processors for generating documents
On procedures: raising and resolving issues
Meeting procedures, review procedures, inspection procedures
Rationale Management
Rationale (justification of decision) is the most important
information developers need when changing the system
Given a decision, its rationale include
The problem that it addresses
The alternatives that developers considered
The criteria that developers used to evaluate the alternatives
The debate developers went through to achieve consensus
The decision
With rationale management, we can
A new alternative arrives compared with all other evaluated alternatives
A decision being questioned recover its rationale to justify it
Complex, difficult to update and maintain
Issue models
Software Configuration Management
Monitors and controls changes in work products
Change pervades software development
Requirements change as client requests new features and as developers
improve their understanding of the application domain
Hardware/software platforms change as new technology emerges
System changes as faults are discovered during testing and then repaired