第4周小组作业:WordCount优化
stage1:代码编写+单元测试
PSP表格
|
PSP2.1 |
PSP阶段 |
预估耗时(分钟) |
实际耗时(分钟) |
|
Planning |
计划 |
15 |
15 |
|
Estimate |
估计任务需要多少时间 |
25 |
30 |
|
Development |
开发 |
100 |
100 |
|
Analysis |
需求分析 |
20 |
20 |
|
Design Spec |
生成设计文档 |
20 |
15 |
|
Design Review |
设计复审 |
20 |
15 |
|
Coding Standard |
代码规范 |
20 |
15 |
|
Design |
具体设计 |
20 |
25 |
|
Coding |
具体编码 |
60 |
60 |
|
Code Review |
代码复审 |
20 |
30 |
|
Test |
测试 |
60 |
80 |
|
Reporting |
报告 |
80 |
95 |
|
Test Report |
测试报告 |
30 |
50 |
|
Size Measurement |
计算工作量 |
30 |
25 |
|
Postmortem |
总结 |
20 |
20 |
|
合计 |
530 |
560 |
我主要负责将排序后的单词和词频输出到文件。代码实现:

public class Output {
public static void output(ArrayList<Entry<String, Integer>> list, File outputFile) throws IOException{
if(outputFile==null){
outputFile=new File("result.txt");
}
//FileWriter fW=new FileWriter(outputFile,true);
FileWriter fW=new FileWriter(outputFile);
BufferedWriter bw=new BufferedWriter(fW);
bw.close();
}
}

测试用例设计:
|
Test Case ID测试用例编号 |
Test Item 测试项(即功能模块或函数) |
Test Case Title 测试用例标题 |
Test Criticality重要级别 |
Pre-condition预置条件 |
Input 输入 |
Procedure 操作步骤 |
Output预期结果 |
Result实际结果 |
Status是否通过 |
Remark备注(在此描述使用的测试方法) |
|
1-5 |
输出控制模块 |
单词种类<=5,词频<=10 |
H |
无 |
wcPro.exe |
无 |
参数数量错误 |
参数数量错误 |
是 |
黑盒测试 |
|
6-10 |
输出控制模块 |
单词种类<=5,词频不定 |
H |
无 |
wcPro.exe -a test.txt |
无 |
参数数量错误 |
参数数量错误 |
是 |
黑盒测试 |
|
11-15 |
输出控制模块 |
单词种类>=6,词频<=10 |
H |
无 |
wcPro.exe -a |
无 |
参数数量错误 |
参数数量错误 |
是 |
黑盒测试 |
|
16-20 |
输出控制模块 |
单词种类>=6,词频不定 |
H |
无 |
wcPro.exe test.c |
无 |
输入格式错误 |
输入格式错误 |
是 |
黑盒测试 |
单元测试运行结果:

小组贡献:因为编程能力不够,只完成了控制输出的部分,贡献率为0.13.
组员代码评价
选择刘博谦(17070)的代码进行分析

// 词频排序
public static ArrayList<String> sort(HashMap<String, Integer> map) {
// 以Key进行排序
TreeMap treemap = new TreeMap(map);
// 以value进行排序
ArrayList<Map.Entry<String, Integer>> list = new ArrayList<Map.Entry<String, Integer>>(
treemap.entrySet());
Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {
public int compare(Map.Entry<String, Integer> o1,
Map.Entry<String, Integer> o2) {
// 降序
return o2.getValue() - o1.getValue();
// 升序 o1.getValue() - o2.getValue())
}
});
ArrayList<String> str = new ArrayList<String>();
int i = 0;
for (Map.Entry<String, Integer> string : list) {
// 排除-与空格
if (!(string.getKey().equals("")) && !(string.getKey().equals("-"))) {
str.add(string.getKey());
str.add(string.getValue().toString());
// 输出前1000个单词
if (i > 1000)
break;
i++;
}
}
return str;
}

刘博谦的代码遵守了《阿里巴巴Java开发手册》第二条的强制规定,代码命名规范,无需改进。
开发规范
阿里巴巴Java开发规范手册
参考资料:
《阿里巴巴JAVA开发手册》
第4周小组作业:WordCount优化的更多相关文章
- HUST软测1504班第4周小组作业成绩:WordCount优化
说明 本次公布的成绩为第四周作业的结果: 第4周小组作业:WordCount优化 博客推荐:本次作业有一位同学完成有创意,推荐优秀博客.(优秀博客不会对成绩带来正面或者负面影响)PS:做任何创新的任务 ...
- HUST软测1504班第6周小组作业成绩
说明 本次公布的成绩为第6周小组作业的结果: 第6周小组作业:WordCount(详情见毕博平台) 如果同学对作业结果存在异议,可以: 在毕博平台讨论区的第6周作业第在线答疑区发帖申诉. 或直接在博客 ...
- 软件测试第4周小组作业:WordCount优化
一.基本任务:代码编写+单元测试 1.Github地址: https://github.com/Wegnery/New_WordCount 2.PSP2.1表格 PSP2.1 PSP阶段 预估耗时 ( ...
- 第四周小组作业:Wordcount优化
1.小组github地址 https://github.com/muzhailong/wcPro 2.PSP表格 PSP2.1 PSP阶段 预计耗时(分钟) 实际耗时(分钟) Planning 计划 ...
- WordCount优化-第四周小组作业
一.基本功能 GITHUB项目地址:https://github.com/LongtermPartner/ExtendWordCount PSP表格填写: PSP2.1 PSP阶段 预估耗时 (分钟) ...
- 软件质量与测试--第二周作业 WordCount
github地址: https://github.com/wzfhuster/software_test_tasks psp表格: PSP2.1 PSP 阶段 预估耗时 (分钟) 实际耗时 (分钟) ...
- WcPro项目(WordCount优化)
1 基本任务:代码编写+单元测试 1.1 项目GitHub地址 https://github.com/ReWr1te/WcPro 1.2 项目PSP表格 PSP2.1 PSP阶段 预估耗时(分钟) 实 ...
- WordCount优化
Github 地址:chaosrings/wcPro 1.PSP2.1表格 psp 2.1 psp阶段 预估耗时(分钟) 实际耗时(分钟) Planning 计划 10 10 Estimate 估计这 ...
- cousera 深度学习 吴恩达 第一课 第二周 学习率对优化结果的影响
本文代码实验地址: https://github.com/guojun007/logistic_regression_learning_rate cousera 上的作业是 编写一个 logistic ...
随机推荐
- Game Engine Architecture 5
[Game Engine Architecture 5] 1.Memory Ordering Semantics These mysterious and vexing problems can on ...
- Sprite/MovieClip的Enter_Frame事件,不受addChild/removeChild影响
简单点讲:Sprite或MovieClip对象一旦为其添加了Enter_Frame事件监听,对应的Enter_Frame处理函数将会马上被调用,并一直执行下去(不管你是否将其addChild到显示列表 ...
- 修改Windows server 时间同步
1.关闭“与Internet时间同步”选项. 2.禁用Windows时间服务,并将其设置为手动. 3.禁用Hyper-v时间同步服务,并将其设置为手动,这个在Hyper-v软件上选中要修改的虚拟机,设 ...
- 【相关网站 - 02】- Java 好文博客
一.源码分析博客 还有这种操作?浅析为什么要看源码 你觉得什么才是 Java 的基础知识? 1. JDK 2. Mybatis 3. Spring 4. Sring Boot 5. Spring Cl ...
- Python人工智能第二篇
Python人工智能之路 - 第二篇 : 现成的技术 预备资料: 1.FFmpeg: 链接:https://pan.baidu.com/s/1jonSAa_TG2XuaJEy3iTmHg 密码:w ...
- js获取地址栏上参数的值
function GetQuerystring(name){ var reg=new RegExp("(^|&)" + name +"=([^&]*)(& ...
- python_字符编码
一 了解字符编码的知识储备 1.计算机基础知识 2.电脑存放组成: 硬盘 - 内存 -(二级缓存.一级缓存.cpu寄存器)- cpu # cpu交互的是用户能识别的数据:字符# 硬盘中最终存储的数据: ...
- checkinstall
一.简介 Linux 的源码安装工具 CheckInstall
- Python的安装图解
安装步骤: 第一步:打开Python官网:http://www.python.org 第二步:点击Download,下载windows版本 第三步:选择要下载的版本第四步:安装到指定的位置第五步:验证 ...
- Linux vim常见使用详解
教你用Vim编辑器 1.Vim编辑器基本使用方法 光标移动 查找/替换 插入模式 复制/粘贴 复制/粘贴 2.vim打开时的警告信息 当使用vim打开一个文件时,会同时在该目录下创建个.filenam ...