软件工程第三次实践作业
1.PSP表格
PSP2.1 | Personal Software Process Stages | 预估耗时(分钟) | 实际耗时(分钟) |
---|---|---|---|
Planning | 计划 | 30 | 10 |
Estimate | 估计这个任务需要多少时间 | 240 | 360 |
Development | 开发 | 180 | 120 |
Analysis | 需求分析 (包括学习新技术) | 60 | 80 |
Design Spec | 生成设计文档 | 60 | 30 |
Design Review | 设计复审 | 60 | 30 |
Coding Standard | 代码规范 (为目前的开发制定合适的规范) | 10 | 10 |
Design | 具体设计 | 10 | 10 |
Coding | 具体编码 | 120 | 90 |
Code Review | 代码复审 | 60 | 10 |
Test | 测试(自我测试,修改代码,提交修改) | 60 | 120 |
Reporting | 报告 | 30 | 60 |
Test Repor | 测试报告 | 30 | 30 |
Size Measurement | 计算工作量 | 30 | 20 |
Postmortem & Process Improvement Plan | 事后总结, 并提出过程改进计划 | 30 | 60 |
#### 2.计算模块接口设计
#### 3.性能改进
4.单元测试
---
5.异常处理
处理文件打开失败与宫格非法的异常:
try
{
if (m < 3 || m>9) {
throw - 1;
}
if (fin.is_open()==false) {
throw - 2;
}
if (fout.is_open() == false) {
throw - 3;
}
}
catch (int e)
{
if (e == -2) {
cout << "Not found Infile!";
return 0;
}
else if (e == -3)
{
cout << "Can not open Outfile!";
return 0;
}
else
{
cout << "Please enter right number 'm'!";
return 0;
}
}
- 如果输入的文件名有误,则抛出异常"Not found Infile!"
- 如果输出的文件夹无法打开,则抛出"Can not open Outfile!"
- 如果输入的m超出范围,则抛出"Please enter right number 'm'!"