UML与软件工程结合

【前言】
通过上一篇博客,在用UML图分析机房收费系统的时候,发现自己对于UML与软件生存期以及软工文档的映射的方面,还是有些模糊。软件工程是设计思想,而UML是设计工具。在软件生存期中文档和图不是独立的,而是相辅相成的。所以,懂得其中的联系很重要,通过查阅浏览,总结如下:


这里写图片描述


一.项目开始阶段

项目开始阶段即为软件工程中的可行性研究阶段,这个阶段主要是通过与用户的沟通,以确定待开发的系统“要做什么”,并进行可行性研究。简单来说就是以企业的经济效益为核心研究这个项目是否能做、是否盈利。运用大量的市场调研,如何可以盈利就入手去做。

1.本阶段重点要处理的问题:项目的范围,必要的流程,项目的技术限制,经济效益

2.项目的成功关键因素:要充分了解利益双方对于整体项目成功与否最关切的问题是什么,并且进行评估问题和项目成败的风险是否相关。

这些其实在一开始就决定了此项目是否会成功,要不要进行这个项目。本阶段结束之后,如果正式立项,那么便进入下一个阶段——需求分析。


二.需求分析阶段

需求分析阶段,不仅要对软件系统进行而且对商业过程也要进行。主要是跟客户(领域专家)沟通,进行需求的收集和分析,然后形成需求规格说明书文档,交由设计人员进行后续的系统设计工作。

UML中的用例图 真是用于需求收集和表达的力工具,但是如何找出用例并非易事,这是因为从用户那里收集来的信息很可能是零散的、没有系统性的,要直接从中中找出正确的用例非常的困难。

因此在分析用例之前,可以先对企业级的业务流程进行规划和设计,抓住企业的本质工作流,为后续进行详细的需求收集和用例分析做好准备。当然这就引出了UML中另一个重要的图——活动图,当然本阶段的活动图是服务于用例图的。

要想进行业务流程设计提到流程你一定 不能忘了活动图。活动图最适合用来描述企业的本质工作流。活动图的使用场景:

1.项目起始阶段,需求分析人员可以只用活动图,真对与项目有关的企业活动,与领域专家一起设计流程。

2.项目上线阶段,可以利用起始阶段的活动图作为集成测试的重要参考依据。

3.项目维护阶段,企业管理人员可以通过活动图了解企业现行的流程以及未来可以改善的方向。


三.系统设计阶段

前一阶段的主要产物是用例图,后续的设计可开发阶段都将以用例驱动,围绕用例展开,而系统设计阶段的主要工作便是实现用例。

1.系统的设计分为概要设计和详细设计,概要设计即为总体设计,这个阶段是建立整体模型和架构的阶段,需要抽象整个系统的结构,建立模型就出现了,用类模型来模拟真实的系统关系模型,解决功能性需求的问题。

类图 的主要目的是在进行软件开发前先对软件所需面对问题领域的本质做一个通盘性的了解,但类图在软件设计之初并不完全正确,必须通过后续的检查才能够逐渐趋于真实世界的领域模型。

类图形成之后,对象图 就不远了,复杂的系统中为了保证类图的正确性可以用对象图来解释类图的设计,因为类是对象的抽象和组合,在面向对象的编程设计中,我们所有的编码都是面向对象的。

2.类图和对象图都属于静态结构图,整个系统的静态结构呈现出来之后,这个框架已经有了,相当于有了躯体,这个时候我们需要给它注入血液让他动起来。所以这个时候需要交互图和行为图来描述整个系统的动态模型,其中行为图包括时序图和状态图,交互图包括活动图和协作图。

3.接下来的详细设计,本阶段用到最多的是类图和包图,会 包含很多的类,必须对这些类进行分类,放置在不同的命名空间中,利用命名空间之间的关系图,来限制不同分类对象之间的访问,这就是“包图”的使用场景。

4.这些图这至关重要:

对象图:旨在描述特定时间点中所有对象在系统中的结构。因此将对象图当成系统在某一个时间点的快照。对象图表达的是在一个特定的时间点中,系统所存在的所有对象的快照,其主要目的是验证设计师设计的类图是否符合实际状况。

行为图(活动图和状态图):类图中某个实体对象,它的状态迁移分散在不用的用例中,需要在这些状态和事件之间进行一番整理,才能让项目开发人员更简便的完成设计。这时可以使用状态机来表达。为了成功的设计软件,将“状态”分配到不同的“领域模型”中,并利用“状态图”来表达这些状态的迁移情形。如果在状态迁移中牵涉到时间因素可以利用时序图来强调时间因素的重要性。设计人员可以把时序图当成状态图的辅助说明工具。

交互图(时序图和协作图):一般来说,我们在用例分析中将系统应该满足的用户期望找出来了。而在类图中则将系统的架构构造出来了。但是,针对每个特定的用例的场景,要如何利用类图所规范的对象,通过交互协作来完成用例所交付的任务,就必须要用时序图来表达。协作图与时序图其实都是在表达同一件事情:对象相互协作,以实现用例的“事件流”。

时序图和协作图都是交互图,它们是等价的,又是有区别的。时序图和协作图都能等价的 表现系统运行中对象通过消息发生的交互行为。时序图表示了时间的消息序列,便于分析交互的时序,但没有表示静态对象关系,时序图可以有效地帮助人们观察系统的顺序行为。协作图着重表示一个协作中的对象之间的联系和消息。

四.实现阶段

有了概要设计和详细设计的铺垫,实现阶段就变得很简单了

实现阶段的编码依据就用到了上一阶段的系统设计模型,包括动态模型和静态模型。交互图行为图 成为了主要的编码依据,具体的代码映射最强的是对象图,在画图软件中可以直接生成代码。

五.测试阶段

单元测试、集成测试、系统测试和接受测试为系统测试的 几个不通过级别。不同的测试采用不同的UML图作为工作的基础,如单元测试使用类图 和类规格说明;集成测试使用组件图协作图;系统测试用例图来验证系统的行为;验收测试由用户进行,以验证系统测试的结果是否满足在分析阶段确定的需求。

单元测试:使用类图

集成测试:使用类图、包图、构件图和协作图

系统测试:使用用例图 测试系统功能

系统配置:使用部署图(配置图)


这里写图片描述

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 16
    评论
Welcome to Software Engineering with UML. is book acknowledges and uses the Object Management Group’s Uni ed Modeling Language (UML 2.5) standard to engineer high-quality software solutions. In an age of ever-increasing demand on software developers, clarity of commu- nication and conveyance of understanding are prerequisites for success. Rapidly changing tech- nologies for development, crunching time to produce working solutions, unpredictable business and legal environments, exploding data, cross-platform testing, globally dispersed development teams, and incessant requirements dictated by highly knowledgeable users place a premium on the technical and professional skills of a software engineer. e premises of this book are that communication is the key to good software engineering and that modeling forms the basis of such communication. UML-based models facilitate and enhance communication between business analysts, users, designers, architects, and testers of the system under development. UML version 2.5 covers 14 di erent modeling constructs (package, use case, activity, interaction overview, class, sequence, communication, object, state machine, component, deployment, composite structure, timing, and pro le diagrams). UML diagrams are based on a robust meta-model, which also enables extensibility mechanisms (stereotypes, tags, and notes). An object-oriented approach to developing software introduces fundamentals for high-quality software development. erefore, the topic of object orientation is interwoven throughout this book—in discussing the fundamentals of software engineering and applying those fundamentals in modeling, and developing software solutions. UML grew out of a need to standardize a varying sets of notations and design approaches. Today it has evolved and stabilized for use across multiple software engineering functions such as capturing and modeling requirements of the problem to be solved, designing and prototyp- ing the software solution, and understanding the constraints and impact of the solution on the existing enterprise-level architecture. UML is presented in this book as three interrelated models: model of the problem space (MOPS), model of the solution space (MOSS), and model of the architectural space (MOAS). ese models are not watertight compartments but, rather, a way of delineating the tools (diagrams) provided by the UML based on a role and its purpose within a software project. As an ISO standard, UML certainly forms an integral part of a software engineer’s toolkit. Methods (processes) for developing software solutions form an important and integral part of software engineering. is material touches key areas of software development methods. Helpful * From a Tony Robbins seminar. xxiii xxiv ◾ Preface hints are provided on how a software engineer can work in an Agile development environment and also understand the wider project management aspect of producing software solutions. In the era of mobile apps, Cloud-based services, the Internet of ings (IoT), and Big Data analytics, a skeptic might be prone to discount the value of modeling (and in particular UML). Successful software development shows that disciplined modeling remains integral to communi- cations across multiple stakeholders involved in developing solutions. e aim in this book is to make software engineers appreciate the importance and the relevance of software modeling in creating high-quality software programs. Budding software engineers need to learn from the outset that developing good solutions involves a lot more than “coding.” While programming is a necessity in the eld of software, it is not su cient. For example, user interface design, nonfunctional requirements (NFRs), quality assurance, and testing are crucial topics in software engineering that are more or less beyond the UML. is book covers these additional topics to ensure the appropriate breadth and su cient depth that are necessary for teaching and learning software engineering. is book is based on the author’s teaching, researching, and experiencing the nitty-gritty and nuances in the eld of software engineering. Students and practitioners alike will nd themselves building on the knowledge gained here and applying it to the intricacies of software engineering. e book is designed to be of value to both undergraduate and postgraduate courses in software modeling through appropriate selection of chapters and corresponding emphasis on exercises and case studies. e value for practitioners is embedded in the example-based explanations and prac- tical hints and tips through the discussions.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值