Software Engineering
By Prof. Fazal Rehman Shamil
可以在这个网站速览概念x
活动图
菱形表示OR,黑心粗线表AND也表同时开始
黑圆点表程序开始,黑圆点外套圈表程序结束
上方泳道表示不同执行者
解题注意所有动词,副词
用例图
实心箭头表示泛化,直线端与三角端做的内容相似,但内容更多。
虚线extend箭头线端表示可能会进行的活动,
虚线include箭头三角端表示一定被包含在内的活动。
形如:
类图
去除某些潜在类的理由:
• Not Retained information,如果潜在类是环境等“Bank,Store”不存储任何信息的对象,则Failed。
• Not Needed services,
• Single attribute,如果潜在类可为其他类的属性,则Failed,画图时写在类的属性栏里
• Synonym,潜在类是别的类的同义词
实心箭头直线端是三角端的子类。
实心直线两头加数字省略号表示关联修饰
空心菱形+实线表示聚合aggregation,表示整体和个体的关系,属于不同层次,菱形端表示整体,“consist of”,“starts”
实心菱形+实线表示合成composition,是普通的聚合关系中代表整体的对象也负责代表部分的对象的生命周期(同年同月同日死),“record”等词语,同时record还可能表示属性,属性的话可能在潜在类那就被筛选掉了。
解题步骤先筛选潜在类Potential Classes,再写关系Relationship,最后画图
圆角矩形内是状态,实心箭头旁附动作,[ ]表示动作进行时的额外条件,动作或额外条件引起状态改变。
黑圆点表程序开始,黑圆点外套圈表程序结束
表项entry/do/exit表示进入状态/状态中/退出状态时执行的操作。
大方框可包含数个状态来表示一个大状态
老师说期末不考这个
实心箭头表主动,虚线箭头表相应
竖着的虚线表示准备着,竖着的粗线表活动时期
注意@Test 和 变量初始化 和 异常检测里的 .class 和 ()->
减少组件内容间的交叉
代码1:
优化后,把求和放到各个class中,求总和的时候调用求和函数
代码2:右边是优化后
建立了IMessageService接口用于发送信息,Customer的目的是发消息不是只能使用邮件发消息,在CustomerService里建立起Customer和邮件的使用关系。
介绍课程
week1总览
什么是软件工程:
“Computer software is the product that software professionals build and then support over the long term. It encompasses computer programs and associated documentation that execute within a computer of any size and architecture . Software products may be developed for a particular customer or may be developed for a general market.”
两种软件工程:
Generic software products 大众化的通用产品
Customized software products 定制产品
软件工程的四种性质:
Maintainability
Dependability and security
Efficiency
Acceptability
SOFTWARE DETERIORATION软件退化
按理说软件不会产生物理器械那种机械磨损,但是软件与需求紧密相关,随着时间过去,可能有部分设计理念或功能不符合新环境,造成Failure rate的徒增。这使得我们要持续地去维护一个软件
软件工程的开发周期(Software Process):
• Software specification
• Software development
• Software validation
• Software evolution
然后说了开发软件工程很复杂
Software engineering is a systematic approach to the production of software that takes into
account practical cost, schedule, and dependability issues, as well as the needs of software
customers and producers.
最后谈论了道德问题,数据之类的
A software process is a set of related activities that leads to the production of a software product所有软件过程都包含以下活动
进行以上活动的两种方法:
• Sequential approach: specification→development→validation→evolution
• Iterative approach:需求什么去做什么,version1.0→2.0→3.0
2 major types of systems:
• Critical systems(多指操作系统,采用sequential approach,指需求很明确的那些系统,往往是计划型)
• Business systems (采用iterative approach,业务灵活变换,对于这些系统,灵活的process更有效,往往是敏捷型)
2 major types of software process
• Plan-driven:计划型 “All process activities are planned in advance”,,采用sequential approach
• Agile processes:反应型,“Planning and development is incremental and iterativei” , 采用terative approach
需求不变 | 需求多变 | |
---|---|---|
软件过程的分类 | Plan-driven processes>Agile processes | Plan-driven processes |
被软件开发的系统分类 | Critical systems>Business systems | Critical systems |
软件过程的实行方法的分类 | Sequential approach>Iterative approach | Sequential approach |
如何选择相应的方法和模型:
需求是否了解(未来是否会增加新的需求),需求是否会经常变更,迭代版本是否困难(Embedded嵌入式产品迭代成本大),是否有可用的重组模块,开发周期是否紧迫。
将项目的进程转换为肉眼可见的软件开发模型,使得对项目的进度和表现更直观,利于管理。
What is software process models?
瀑布模型
Plan-driven processes计划型开发,每个环节完成后才进入下一个环节,每个环节都有相应的document使得管理者能更直观的掌握进度,如果环节出问题则返回上一个环节(例如系统测试环节出现问题就返回上一个环节重新测试单元)。在最终环节之后,软件投入正式使用,同时收集错误和新的用户需求,系统必须不断发展,某些更新可能会重复之前的过程。
因为文档的生成和批准成本和大量返工成本,进行少量迭代后可将部分环节冻结(如第一个环节),节约不必要耗费的资源。(但是过早冻结部分环节会使系统无法实施部分用户需求)。
优点:
缺点:
In principle, the waterfall model should only be used when the requirements are well
understood and unlikely to change radically during system development.
敏捷开发,迭代开发,增量开发
Iterative approach,采用迭代的方式,功能性活动高度集中,版本可以在短周期内实现更迭,并且在每次更迭时添加一些功能。开发和验证活动交叉进行,增量开发是敏捷开发的基本组成,对于电子商务和个人系统,增量比瀑布要好。
在早期版本即可达成用户需求的主体框架,以便用户指出未达标的需求或提出修改建议,对于需求变更的修改代价减少(及时响应),可以及时相应变更要求,因此越是重要的需求越能提前登录版本,并在后期完善。
与瀑布模型相比,优点:
缺点:
译文:面向复用的软件开发
原文:software reuse oriented software engineering
使用可重用组件(reusable component)和集成框架进行改造(继承、适配)、配置、拼装、组合等手段完成软件的局部功能开发。
因为大部分组件是由第三方开发,所以第三环节需要对原本的需求进行修订
可复用组件的三大分类:
优点:
缺点:
• Real software processes are interleaved sequences of technical, collaborative, and managerial activities with the overall goal of specifying, designing, implementing, and testing a software system.
这节主要介绍这些activities是什么(所有软件过程都包含以下活动)
Software Specification
定义:the process of understanding and defining
目标:produce an agreed requirements document that specifies a system satisfying stakeholder requirements.
细化过程:
• what services are required from the system
• identifying the constraints on the system’s operation and development.
不同人群的requirement不同:
• End-users and customers need a high-level statement of the requirements;
• system developers need a more detailed system specification.
这个阶段出问题会极大影响后续项目进度
Software Design and Implementation
定义:the process of converting a system specification into an executable system将软件规范转换为可执行软件
目标:A software design is a description of the structure of the software to be implemented, the data models and structures used by the system, the interfaces between system components and, sometimes, the algorithms used.
设计的输出因模型和系统而异,如果是critical system,因该编写详细的文档和系统描述;如果使用了model-driven,设计结果可能是图表;如果使用agile methods,设计结果可能体现在代码中
三种测试:Development testing,System testing,Acceptance testing
通常测试与开发是交叉进行的,开发新版本时需测试其功能,有的critical system开发有专门的测试组
什么是RAPID SOFTWARE DEVELOPMENT:
为什么需要RAPID SOFTWARE DEVELOPMENT:
之前研究的计划驱动过于冗长,不适应这种需要快速出效果的软件:
PLAN-DRIVEN DEVELOPMENT APPROACH计划驱动实现
适用于大型长期维护软件,如需要多团队合作研发;需要研发出一个严格系统;有许多不同的人参加维护
Large, long lived software - careful project planning, formalized quality assurance, the use of analysis and design methods supported by CASE tools, and controlled and rigorous software development processes
Agile manifesto 敏捷宣言:(?
• Individuals and interactions over processes and tools
• Working software over comprehensive documentation
• Customer collaboration over contract negotiation
• Responding to change over following a plan
敏捷开发在施行时会遇到的不如人意之处:
如何考虑是否使用敏捷开发:
敏捷开发的维护:
Scums由一个或多个Scrum小组组成
每个小组包含三种成员角色{
Product owner:决定这一代产品的研发方向和顺序
ScrumMaster:确保小组基于Scrum框架进行创造和按照规定流程作业
Development team:决定如何交付Product Owner提出的要求
}
ScrumMaster{
Product Owner{
}
Development Team{
使用increment快速迭代(每次迭代称作一次sprint),每次迭代出满足若干个需求的新版本。
sprint将会被分割成许多小任务,product backlog - sprint planning - sprint backlog - sprint execution (daily scrum) - potentially shippable product - sprint review product - sprint retrospective process
(PPT 上的Forecast? Commitment? 不是这学期内容)
Product Backlog{
product owner负责根据团队和利益相关人的消息,然后确定和管理工程(product backlog items)的顺序,以优先级列表prioritized list的形式表现,称为product backlog。
product backlog grooming:
创建和细化(询问详细)产品待办事项、对其进行评估并确定其优先级的活动称为梳理
The activity of creating and refining product backlog items, estimating them, and prioritizing them is known as grooming
因为需求会变,所以一开始的梳理只梳理顶层
}
PBI Example{
用户说的需求,用户的描述,验收标准
product owner需要对以下PBI排列优先级并告知达成这个需求需要的时间
}
Sprint{
在Scrum中,工作以迭代的方式以sprints表现,形式类似time box
}
Sprint Planning{在sprint开始前
Sprint Execution{
Daily Scrum{
Definition of Done{怎样才能算做好了
Sprint Review{
Sprint Retrospective{
软件过程的第一步是软件需求分析
什么是需求:
需求的抽象与具体:
不同程度的具体服务于不同方的需求:
谁会去看这些需求
Functional and None-functional Requirements:
Software system requirements被划分为:
Non-Functional Requirements 的分类:
Non-Functional Requirements 的困难:
又名Software Requirements Specification or SRS,应当包括用户对系统的需求和详细的系统需求说明both the user requirements for a system and a detailed specification of the system requirements
Requirements Specification:
定义:在需求文档中记录user和system需求的过程
标准:
问题:
**Requirements Specification **自然语言表述natural language:
It is expressive, intuitive, and universal.
But it is also potentially vague, ambiguous, and its meaning depends on the background of the reader。
为了减少误解,需要规定标准格式,区分强制要求和可选要求,要求高亮关键部分,不假设读者有专业背景等。
**Requirements Specification **结构化语言表述structured:
将自然语言放进规定的结构或模板中编写系统需求
将需求归为card,每张card上包含需求理由,对其他需求的依赖,用以支持需求的材料等
整个需求分析过程是一个活动交错的迭代的过程iterative process in which the activities are interleaved.
system requirement比user的需求更加细节
REQUIREMENTS ELICITATION AND ANALYSIS需求获取与分析:
软件工程师与客户与用户一起寻找: •应用领域(水果店卖水果,数码店卖数码)•系统应提供哪些服务•系统所需的性能(高吞吐或低延迟)•硬件约束等
组织中有各种各样的人员:终端用户,开发维护工程师,业务经理,领域专家,工会代表trade union representatives.
发展:在不断地迭代中,随着活动之间的交互,系统变得越来越适合本地因素(员工知识,模型架构,标准设定等)
困难:从甲方那里获得并理解需求很困难:
上图中
需求发现(有时称为需求获取)是收集有关所需系统和现有系统的信息,并从这些信息中提取distilling用户和系统需求的过程。
需求发现: Interview采访
含义:与甲方的正式或非正式访谈
过程:需求工程团队向甲方提出系统的问题,从回答之中发现需求
分类:
作用:
难处:
要求采访者有以下特质:
需求发现:Scenarios假想情节
含义:系统用户可以知道自己将如何与软件系统交互,每个情节描述与系统的交互,通常覆盖系统的一个或多个功能
作用:
过程:情节开始于模糊的大概交互,随着启发elicitation process,细节被逐渐添加
需求发现:Use cases用例:
定义:是一种需求发现技术,简单来说,用例识别参与交互的参与者和命名与之相关的交互.
使用high-level的文档存储,记录所有可能出现的交互。(一个case装一个scenario,或者一个case装多个scenario)
扩展:可由额外的描述系统交互的信息补充,如文本,图型
不足:不适用于constraints,high-level business,nonfunctional requirements,domain requirements.
上图:use cases指椭圆状的需求或功能,这些人被称为external entity外部实体
需求发现:Ethnography(人情世故
利于发现以下两种需求:
缺点,由于过分聚焦于终端用户:
定义:检查需求是否是客户实际想要的
重要性:开发过程中或结束后才发现需求文档中的错误会增加工作量
different types of checks:
requirements validation techniques:
Characteristics of a software engineer:
seven traits of effective software engineer
好的团队(team)需要做到1+1>2的效果( the whole is greater than the sum of the parts)
• establish a sense of purpose
• inculcate a sense of involvement that allows every member to feel that his skillset and contributions are valued
• foster a sense of trust
• encourage a sense of improvement
• diverse in the sense that they combine a variety of different skill sets
三年期限: 今天所用到的软件开发知识会在三年后被别的东西替代,
然而,有些根本的基础的知识将会伴随一生
These software engineering principles are likely to serve a professional programmer throughout his or her career.
以下准则可以帮助指引开发软件过程(software process) is which provides software engineer a road map for getting to a successful destination) 开发方向
• Be agile
• Focus on quality at every step
• Be ready to adapt
• Build an effective team
• Establish mechanisms for communication and coordination
• Manage change
• Assess risk
• Create products that provide value for others
以下准则可以帮助指引开发实践(software engineering practice) is which provides software engineer with the detail you’ll need to drive along the road. 开发方法
• Divide and conquer
• Understand the use of abstraction
• Strive for consistency
• Focus on the transfer of information
• Build software that exhibits effective modularity
• Look for patterns
• When possible, represent the problem and its solution from a number of different perspectives
• Remember that someone will maintain the software
以下准则可以帮助交流( activities comunication) is which a kind of comunication before requirements is specified.
•Listen
•Prepare before you communicate
•Someone should facilitate the activity
•Face-to-face communication is best
•Take notes and document decisions
•Strive for collaboration
•Stay focus; modularizes your discussion
•Use drawing whenever something is unclear
•Move on
•Negotiation is not a contest or a game. It works best when both parties win
以下准则可以帮助规划( activities planning) is which can enable the software team to define a road map as it travels toward its strategic goal and tactical objectives
• Understand the scope of the project
• Involve stakeholders in the planning activity
• Recognize that planning is iterative
• Estimate based on what you know
• Consider risk as you define your plan
• Be realistic
• Adjust granularity as you define the plan
• Define how you intend to ensure quality
• Describe how you intend to accommodate change
• Track the plan frequently and adjust as required.
本节需要区分UML图类型diagram和系统模型类型model
什么是System Modeling:
System modeling is the process of developing abstract models of a system, by using some kind of graphical notation,with each model presenting a different view or perspective of that system.System modelling helps the analyst to understand the functionality of the system and models are used to communicate with customers.
是一种讨论系统的手段,使用部分图像。可以作为系统的大概讨论,亦或是对现有系统的文档支持,也可作为详细的系统描述以支持系统实现。可以帮助分析师和客户了解系统。
System perspectives | |
---|---|
external perspective | the context or environment of the system |
interaction perspective | interactions between a system and its environment, or between the components of a system. |
structural perspective | organization of a system or the structure of the data that is processed by the system |
behavioral perspective | the dynamic behavior of the system and how it responds to events |
UML diagram types | |
---|---|
Activity diagrams | the activities involved in a process or in data processing |
Use case diagrams | w the interactions between a system and its environment |
Sequence diagrams | interactions between actors and the system and between system components |
Class diagrams | the object classes in the system and the associations between these classes |
State machine diagrams | how the system reacts to internal and external events |
System Modeling分类和模型驱动:
作用:显示系统边界之外的内容。Architectural models决定了系统和其他系统的关系。
受影响:社会和组织关注会决定系统边界(system boundaries)。
注意:只是显示环境中的其他系统,无关于如何使用正在开发的系统。可以与其他模型一起使用。使用UML activity diagrams定义business process models
作用:给用户交互做模型,可帮助分析用户需求。给系统间交互做模型,可以注意交互问题。给组件交互做模型,可以帮助人们理解目标系统是否具有需求的功能和可靠性。
注意:使用UML 的 Use case diagrams and Sequence diagrams
作用:在讨论和设计系统体系结构时创建结构模型。显示组成一个系统的组成部分和其关系。可以看作一个静态模型,展现了系统设计,也可看作一个动态模型,展现了系统运行时的组成。
注意:使用UML Class diagrams
作用:显示系统运作时的动态表现,展现了当系统响应刺激(stimulus)后正在发生什么或期望发生什么。
影响:这些可被响应的刺激包含 数据 和 事件。
注意:许多商业系统是数据驱动系统(data-processing systems),他们由数据驱动,数据输入控制系统功能,只涉及一小部分外部事件。
是什么:MDE是一种软件开发方法,其中主要输出是模型,从模型中自动实现在软硬件平台上运行的程序,这种行为将软件工程抽象,工程师无需关系编程语言的细节。
优点:允许系统高度抽象,自动实现代码意味着移植到其他系统的成本低
缺点:抽象系统不一定容易实现,新平台开发翻译器的成本或许超过写代码的成本
其前身是Model-driven architecture (MDA),以模型为中心的软件开发方法,使用UML模型的子集描述系统。创建不同抽象级别的模型,从一个高级抽象的模型中原则上可以自动生成一个工作程序
模型种类
MDA和Agile methods:
MDA支持迭代开发因此可以敏捷开发,但前期广泛建模和敏捷宣言思想矛盾。如果代码转换可以完全自动,并且从PIM可生成完整的程序,原则上MDA可用于敏捷开发。
要让代码可以完全自动,可以使用UML 2/xUML/Executable UML
模型类型被减少为:
系统的动态行为可以使用 object constraint language (OCL)或 UML’s action language
Identify, classify, and define objects, ideas, and events as Classes by examining the usage scenarios developed in the use case model
将usage scenario里面的关键词分类,以创造一个具有候选类的表格,然后分析是否应该pass以创建一个类去存储与其相关的信息
• What to look for exactly?
• External entities
• Things
• Occurrences or events
• Roles
• Organizational units
• Places
• Structures
Use six selection characteristics to select classes for
the analysis model: -
• Retained information
• Needed services
• Multiple attributes
• Common attributes
• Common operations
• Essential requirements
Class Attribute 类属性:
属性用来描述一个类。
分析scenario来选择属于某个类的属性
eg. • Master password • Telephone number • Delay time
Class operations 类操作:
操作定义了一个类的行为,4种类型:
• manipulate data
• Perform computation
• Inquire about the state of an object
• Monitor an object for the occurrence of event
操作作用于类的属性和类之间的关系
分析scenario中的动词来发现对于类的操作,有的动词可能包含多个操作的集合
eg PC is used to program and configure the system
Associations between Classes类之间的关联:
关联是两个类之间的关系
eg Employee class is associated to Department, Attendance, and Project
关联可以进一步表示多样性( multiplicity),既实例之间的关系数
eg Each Employee reports to one and only one Department
例题:PPT的链接
表现系统的动态行为 (特定事件,系统如何响应)
如何创建Behavior-based Model
如何识别事件
actor和system之间进行信息交换,信息交换是一个事件,并且可能会影响控制流
什么是Event:
是某一个时间点发生的离散信号,硬件中断或消息传递。
可能导致:状态变化,触发操作,触发条件
State of a Class:
A passive state is simply the current status of all of an object’s attributes,如学生姓名,学生ID这类属性的当前状态
The active state of an object indicates the current status of the object as it undergoes a continuing transformation or processing,如学生Class的状态:新的,注册的,停学的,毕业的 等经历持续地转变或处理的当前状态
Event and State:
• An event (sometimes called a trigger ) must occur to force an object to make a transition from one active state to another.
接下来讨论State Machine Diagram(维护class根据evernt后改变state) 和 Sequence Diagram (维护软件在时间线上的行为)
UML state machine diagram documents these kinds of changes of Objects‘ states after response to
events.
• It presents the states an object can be in along with the transitions between the states
• It shows the starting point and endpoint of a sequence of state change
3 categories of activities
什么是序列图:
例题PPT链接
突发恶疾拖了一周
**The goal of design:**软件设计目的
to produce a model or representation that exhibits:
什么是软件设计:
软件设计将需求转化为适合程序员进行软件编码和实现的形式
软件设计是建模modelling活动中的最后一步,这一步为construction构建代码提供台阶 (也就是说它夹在需求概念和代码实现中间,为需求提供解决方案solution space。
Analysis vs Design:
分析:identifies ’what’ the system must do 定义了系统应当具备或实现怎样的功能 (指明方向
设计:specifies ’how’ it will do it 概念上指定系统将通过何种手段实现这些功能 (并不是完整代码
面对对象分析object-oriented analysis:着重于发现用例里的实例,如图书,管理者
面对对象设计object-oriented design:着重于定义软件对象以及如何协调工作。如图书对象的title属性和管理者的findTtile()方法.
以骰子游戏为例阐述分析和设计:
DICE GAME:
in which a player rolls two dice. If the total is seven, they win; otherwise, they lose.
见ppt 17-25
represents the features of the software that helps engineer to develop it effectively. (methods for software design),classified into four categories:
评估软件设计的质量:
Design quality is all about fitness to purpose (goal of design)
Four key quality concepts:
软件设计的目的:
软件设计的一般概念:
只关注重要的部分,而舍弃细节,降低整个设计的复杂性
抽象层次越高,细节就越少。
Modular design helps us to better organize complex system. It basically clusters similar or relative functions together, sets up boundaries and provides interfaces for communication
模块化设计帮助我们更好地组织复杂系统。它将相似或相对的功能聚集在一起,作为一个模块化的复杂系统,为模块间交流提供接口
Coupling and cohesion are two modularization criteria, which are often used together.
耦合和内聚是评判模块化的标准,尽可能做到低耦合,高内聚
指模块的独立程度 ( how depend a class or a module is)
Two modules are considered independent if one can function completely without the presence of the other, they two are solvable and modifiable separately
The more connections between modules, the more dependent they are
to lower the coupling between modules is to strengthen the bond between elements of the same module by maximizing the relationship between elements of the same module ↓↓↓
指模块内的元素间的相互关联的程度 (how focused a class or a module is)
Cohesion is the degree of how closely the elements of a module are related to each other
可以为设计者提供参考,”当前模块里的东西之间是不是毫不相关,是不是可以分成两个模块“
An object-oriented system is made up of interacting objects
interacting objects maintain their own local state and provide operations on that state.
需要设计:存在哪些对象,对象间的关系如何
To develop an object-oriented design from concept to detailed, here are several things that you need to do:
大概讲了软件架构Software Architecture,
软件架构设计Architectural Design,
软件架构模型Architecture Model(UML),
软件架构视图Architectural Views,
软件架构模式Architectural Patterns
什么是Software Architecture:
The software architecture of a system is the set of structures(比如models) needed to reason about the system, which comprises software elements, relations among them, and properties of both.
什么是Architecture Model:
Architecture Model是整个复杂软件系统的简单概括,需要考虑整个系统各个环节上的failure risk,进而提出解决方案–The model helps you reason about and avoid failures, the details included in your model is architectural
Failure risks→Architectural details
什么是Architectural Design:
Architectural Design is the design process for identifying the sub-systems making up a system and the framework for sub-system control and communication.
架构设计会产出一个软件架构的描述
架构设计处于设计过程早期阶段,通常与一些规范活动(specification activities)同时进行,包括识别系统组件和组件间通信
软件架构中系统被拆分成子系统(系统组件),并讨论他们之间的接口。
一个子系统应该高聚合Highly cohesive,低耦合Loosely coupled,提供一些主要服务,必要时还可以被拆成更小的子系统
子系统中的类class的选择:
软件架构被抽象的形式:
Architecture in the small,关注一个单独的程序如何被分解为组件
Architecture in the large,关注一个复杂的系统被分解为子系统,系统组件,分布式组件,甚至不同公司拥有的组件
如何表示 Architectural:
使用简单的方框图表示,这样甲方能看明白,不过会缺少细节。
使用模型表示,不仅可以与甲方交流communication ,还利于项目规划project planning;还可以作为已有项目的记录,记录接口,连结,组件。
我们使用UML表示model,每个模型必须有个diagram和supporting specification,diagram会含有一些组件间关系,但并不具体
什么是component:
是系统中可更换的部分,代表比特数据,使用/开放了一系列接口,只有通过接口才能访问组件。拥有相同接口的组件可以更换。一个组件含有一个或多个class。组件可以组合成systems。
component can be thought of as an implementation of a subsystem
什么是class:
表示逻辑上的抽象。含有属性(data)和操作(methods)。类可以组合成programs。
A component diagram has a higher level of abstraction than a Class Diagram.
all of the model elements are private
什么是Package:
a package is a general-purpose mechanism for organizing elements into groups
形同java的jar包,用于打包各种class
package diagrams only display public items
什么是Deployment Diagram:
System’s physical layout: which piece of software run on which piece of hardware.
系统的物理上的布局
节点分为设备节点Device node(如电脑)和运行环境节点Execution environment node(如服务器)
什么是node:
A node is a physical element thar exists at run time and provides a computational resource, e.g., a computer, a smartphone, arouter.
Components may live on nodes
讨论使用哪些符号,使用哪些角度去形容架构模型。
架构模型没法面面俱到,每个架构模型只展示一种视角形容系统one view or perspective
of the system
It might show how a system is decomposed into modules, how the run-time processes interact or the different ways in which system components are distributed across a network. For both design and documentation, you usually need to present multiple views of the software architecture.
以下视角:
An architectural pattern is a stylized description of good design practice, which has been tried and tested in different environments.
架构模式是对良好设计实践的风格化描述,它以前在不同的环境中进行过尝试和测试。
模式是用来表示知识的方法,架构模式可以解决各种软件工程中的问题
An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context
体系结构模式是在给定上下文中,针对软件体系结构中经常出现的问题的通用、可重用的解决方案
用户接口user interface既要与功能性实现application相分离,两者又要互相影响。
底层实现更改时,用户接口需要created maintained and coordinated。
MVC可以作为许多基于网络的系统的交互管理的基础。
包含:
is used to model the interfacing of sub-systems
Organises the system into a set of layers (or abstract machines) each of which provide a set of services. Supports the incremental development of sub-systems in different layers. When a layer interface changes, only the adjacent layer is affected.
将系统组织成不同的层,每个层提供一组服务。支持不同层中子系统的增量开发,当层界面发生更改时,仅相邻层受到影响
每个底层可以被多个高层所使用
分层可以用于构建一般桌面应用程序和简单的Web应用程序,又或是需要快速开发得到成品的情况。
在高性能应用程序中性能很差,通过多个层来满足业务请求效率不高。
优点:允许更换每个层,每个层的功能可以丰富扩充
缺点:实现层之间纯净的分离很困难,高级别层可能必须直接与低级别的层交互,导致层之间并不是链式结构。性能堪忧–处理响应时每一层都要做解释
仓库:使用单独的仓库存储数据
优点:对于数据密集系统十分灵活
缺点:难于改变仓库,因为所有其他组件都依赖它
仓库结合存储访问层:
优点:只要接口不变,仓库内的功能可以随便改变
例子:
A comple set of software components is defined during architectural design. But the internal data structures and processing details of each component are not represented at a level of abstraction that is close to code
软件架构设计后的软件组件的抽象层次还需要再往代码层面靠一靠。
what component level design do:
three different view of a component:
以面向对象视角来看,组件是一组互相协作的类collaborating classes。每个类中包含与其实现相关的所有属性和操作,以及与其他类通信和协作的接口。
传统视角来看,组件是程序的功能元素functional element,包含:
component-level design process steps:
设计和实现是软件工程中开发可执行软件的阶段。
结构化面向对象设计过程中涉及到开发许多不同的系统模型system models。
对于由不同团队开发的大型系统,设计模型是一种重要的通信机制。
这些过程包括:
Sequence models show the sequence of object interactions. These are represented using a UML sequence or a collaboration diagram. Sequence models are dynamic models.
State machine models show how individual objects change their state in response to events. These are represented in the UML using state diagrams. State diagrams are useful high-level models of a system or an object’s run-time behavior.
以上无关编程,程序写代码过程中中还需要关心:
User interface design creates an effective communication medium between a human and a computer.
用户界面的分析和设计过程是迭代的,可以使用螺旋模型(spiral model)表示
通常使用文档来细化一个用户界面是很难的,界面的需求来自于与现有系统的比较,界面的设计设计许多原型机
一个软件工程模型的关键原则:
在设计解决方法前深入理解问题
用户接口设计需要理解:
如何改进用户接口:
任务分析将分析任务的内容,开始和结束时间,任务过程中用户将处理哪些问题,任务的先后顺序和任务的层次。
Once user tasks have been identified, user scenarios (use cases) are created and analyzed to define a set of interface objects and actions.
Patterns: 指表达知识的方式
Architectural pattern: 被测试和检验过许多次的design practice
Design pattern: 一种抽象的对某种方法的设计解决方案
创造原型机后,应该被使用者评估是否达到需求
什么时候测试:
迭代开发时,产品上架前,产品登陆后
如何衡量usability:
Effectiveness,Efficiency,Satisfaction。
测试过程:
软件验证之后是软件演化(software evolution),软件演化包含软件发布后的持续开发,本课程不包括这点。
什么是软件验证software validation:
分为verification 和 validation,需要保证:
Verification和validation的区别:
Verification (It consists of checking of documents/files and is performed by human.
软件是否做了它被定义了要去做的
It is the process of checking that a software achieves its goal without any bugs.
It is the process to ensure whether the product that is developed is right or not.
It verifies whether the developed product fulfills the requirements that we have.
It is part of the software development process that ensures the work is correct.
Validation (It consists of execution of program and is performed by computer.
软件是否做的是对的事情
It is the process of checking whether the software product is up to the mark or in other words product has high level requirements.
It is the process of checking the validation of product i.e. it checks what we are developing is the right product.
V&V的目标是确认系统是否符合目的:
什么是Program Testing:
测试环节使用测试数据和环境进行程序测试,其目的是确保一个程序做了它要做的事情,并且没有缺陷或异常。其目的:
Validation and detect testing:
Validation testing: 验证测试包括使用Ie之外的正确输入进行测试。这些输入刺激系统生成预期的正确输出。
detect testing:缺陷测试缺陷测试的首要任务是在Ie集合中找到这些输入,因为这些输入揭示了系统的问题。
Stages of testing:
Requirement based testing:使用一个或多个测试用例测试每个需求
Performance testing:逐渐增加系统负载,直到超出系统承受能力。超出承受能力这部分又被称为压力测试(Stress testing).
Alpha testing:Users of the software work with the development team to test the software at the developer’s site. 闭测
Beta testing:A release of the software is made available to users to allow them to experiment and to raise problems that they discover with the system developers.公测
Acceptance testing:Customers test a system to decide whether or not it is ready to be accepted from the system developers and deployed in the customer environment. Primarily for custom systems.
Appendix:
Black box testing
a software testing method in which the internal structure/ design/ implementation of the item being tested is not known to the tester.
The testing is done without the internal knowledge of the products.
From ‘outside’, just the public method
White box testing
analyze the internal structures the used data structures, internal design, code structure and the working of the software rather than just the functionality as in black box testing.
From ‘inside’, considering all aspect (including private methods and feilds)