Skip to content

Commit

Permalink
Merge pull request #1192 from cyh1069247088/master
Browse files Browse the repository at this point in the history
#2 #1185 Create lab2 && Update lab1
  • Loading branch information
zengsn committed Mar 13, 2020
2 parents 5a55da0 + e0e5f09 commit abba3ef
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 7 deletions.
87 changes: 80 additions & 7 deletions students/1714080901141/lab1.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,82 @@
# 实验一

## 实验目标

## 实验内容

## 实验结果
# 实验一:UML建模工具
## 一、实验目标
1. 熟悉github实验过程
2. 安装与使用StarUML
## 二、实验内容
1. 创建并提交lab1.md文档
2. 利用StarUML创建模型,并以图片格式导出模型
3. 在lab1.md中使用该图片
## 三、实验步骤
1. 登录[hzuapps/uml-modeling-2020](https://github.com/hzuapps/uml-modeling-2020)
2. 登录个人帐号
3.[hzuapps/uml-modeling-2020](https://github.com/hzuapps/uml-modeling-2020)下点击fork
4. 在Ubuntu的Terminal下:
```bash
#install git
sudo apt-get install git
#clone
git clone https://github.com/cyh1069247088/uml-modeling-2020
#create lab1
cd uml-modeling-2020/students
mkdir 1714080901141
touch lab1.md
```
5.[StarUML官网](http://staruml.io/)下载[系统对应版本](http://staruml.io/download/releases/StarUML-3.2.2.AppImage):
```bash
#Download for Linux(64 bit)
wget http://staruml.io/download/releases/StarUML-3.2.2.AppImage
#Run StarUML
./StarUML-3.2.2.AppImage
```
6. 在StarUML下:
- Model -> Add Diagram -> Class Diagram
- Add Class Three Times
- File -> Export Diagram As -> APEG...
- Choose uml-modeling-2020/students/1714080901141
- Rename "model1.jpg"
7. 在lab1.md中使用图片:
- Adding the following code in lab1.md.
```
![第一个UML图](./model1.jpg)
```
## 四、实验结果

![第一个UML图](./model1.jpg)

## 五、实验收获
1. 养成良好的写实验的习惯,即明确的实验目的,全面的实验内容,细致的实验步骤,明了的实验结果,简洁的实验总结,深度的调试。
2. git pull用来刷新本地库,使本地库与个人库同步。
3. git push用来刷新个人库,使个人库与本地库同步。
## 六、实验调试
1.
what:
git pull的时候,会报错如下:
```
Updating 1cc0009..db661fd
error: Your local changes to the following files would be overwritten by merge:
students/1714080901141/lab1.md
Please, commit your changes or stash them before you can merge.
Aborting
```
why:
如果系统中有一些配置文件在服务器上做了配置修改,然后后续开发又新添加一些配置项的时候,在发布这个配置文件的时候,会发生代码冲突
how:
- Saving your local data
``` bash
git stash #暂存当前正在进行的工作。
git pull origin master #拉取服务器的代码
git stash pop #合并暂存的代码
```
- Ovewriting your local data
```
reset --hard #直接回退到上一个版本
git pull origin master #拉取服务器的代码
```
2.
What: git clone operation is too slowly
why: git clone特别慢是因为github.global.ssl.fastly.net域名被限制了。
how:
- Indirectly
拜托你的朋友或老师帮忙
- Directly
码云、搭建服务器并配置代理
109 changes: 109 additions & 0 deletions students/1714080901141/lab2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# 实验二:用例建模

## 一、实验目标

#### 1. 掌握StarUML用例建模;
#### 2. 确定并细化选题;
#### 3. 熟悉Markdown语法。

## 二、实验内容

#### 1. 阅读学习资料,观看录制视频,做好笔记 ;
#### 2. 提交并确定选题;
#### 3. 创建用例图并绘制用例规约。

## 三、 实验步骤

#### 1. 学习笔记:
- 模型与图:
(1)UML建模是指将系统描述为模型,UML图是理解模型的窗口或手段;
(2)我们可以在图中修改模型元素,但是图本身不是模型,而只是表示图形中部分信息的手段。
- 功能需求与非功能需求:
(1)用例只规定了系统的功能需求;
(2)用例不能规定系统的非功能需求(性能、编程语言、平台选择等)。
- 用例:
(1)用例源于用户需求;
(2)用例必须有清晰的通过/失败的条件;
(3)所有的角色都需要用例。
#### 2. 选题:
题目:飞机订票管理系统
功能:
(1)添加航班:
由于在节假日人流量较平日更大,管理员会添加更多的航班,以满足客户需求并提高公司盈利,客户订票就能查到比平日更多的票了。
(2)取消航班:
由于飞机故障、重大卫生事故或人流量回降,管理员需要通过取消航班限制人流,以保障乘客安全与降低公司亏损,客户订票受限。
#### 3. 创建用例图
(1)打开StarUML;
(2)在Model Explore下:右键model -> Add Diagram -> Use Case Diagram;
(3)在ToolBox的UseCase下:
-> Actor(Rename "管理员");
-> Use Case(Rename "添加航班");
-> Use Case(Rename "取消航班");
-> Dependency(Rename "添加航班操作", Join "管理员" To "添加航班");
-> Dependency(Rename "取消航班操作", Join "管理员" To "取消航班")。
#### 4. 绘制用例规约
##### 表1:添加航班用例规约
用例编号 | UC01 | 备注
-|:-|-
用例名称 | 添加航班 |
前置条件 | 管理员已登录飞机订票管理系统 | *可选*
后置条件 | | *可选*
基本流程 | 1. 管理员点击添加航班按钮; | *用例执行成功的步骤*
~| 2. 系统显示添加航班页面; |
~| 3. 管理员输入航班类型、航班时间,点击确认按钮。 |
~| 4. 系统检查对应类型航班有闲置,航班时间不冲突,系统保存添加信息,并显示添加航班成功页面。 |
扩展流程 | 4.1 系统检查对应类型航班无空闲,返回添加航班页面,提示“航班忙碌,添加失败”; |*用例执行失败的步骤*
~| 4.2 系统检查航班时间冲突,返回添加航班页面,提示“航班时间冲突,添加失败”。 |
##### 表2:取消航班用例规约
用例编号 | UC02 | 备注
-|:-|-
用例名称 | 取消航班 |
前置条件 | 管理员已登录系统 | *可选*
后置条件 | | *可选*
基本流程 | 1. 管理员点击取消航班按钮; |*用例执行成功的步骤*
~| 2. 系统显示可取消的航班信息页面; |
~| 3. 管理员选择航班,编辑致歉信息,并点击取消航班按钮; |
~| 4. 系统重新检查所选航班,所选航班可取消,系统显示航班正在取消页面; | *选择需要时间,有时差,需要实时重新检查*
~| 5. 系统保存取消信息,修改客户订单,触发对应客户的退款业务,发送信息给对应客户,显示航班取消成功页面。 |
扩展流程 | 4.1 系统重新检查所选航班,航班不可取消,系统显示航班取消失败页面。 |*用例执行失败的步骤*

## 四、 实验结果
#### 图1:用例图
![UseCase](./model2.jpg)

## 五、实验总结
1. 养成良好的表达习惯,有助于锻炼思维,可以通过写作提高;
2. 要经常使用git pull 和 git push;
3. 依赖关系是弱的关联关系,用带箭头的虚线表示,这种使用关系是具有偶然性的、临时性的、非常弱的。

## 六、实验调试

1.
what:
步骤描述不简洁,拖泥带水的。
why:
平常说话比较随意,使用补充的说辞,常出现主次不分,重点不明的尴尬场景。
how:
- 要把握功能性需求的描述方法:主语+谓语+宾语。
- 多用简单句或者并列句。
- 养成写作的习惯。

2.
what:
用例规约的用例名称与模型图中的用例名称不一致导致混乱。
why:
未能把握用例规约的作用:用例规约就是对模型图的一种过程说明详述。
how:
改动比较方便改的那一处即可(用例规约的地方)。

3.
what:
git pull时发生如下错误:
error: failed to push some refs to 'https://www.github.com/cyh1069247088/uml-modeling-2020.git'
why:
个人库并非本地库的母集。
how:
``` bash
git pull --rebase origin master
```
注:本地库操作前养成git pull的习惯。
Binary file added students/1714080901141/model2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit abba3ef

Please sign in to comment.