1. github项目地址:https://github.com/wwwwu/WordCount

2.PSP表格:

PSP2.1

PSP阶段

预估耗时

(分钟)

实际耗时

(分钟)

Planning

计划

 10  -

· Estimate

· 估计这个任务需要多少时间

 700 800

Development

开发

 600  700

· Analysis

· 需求分析 (包括学习新技术)

 60  50

· Design Spec

· 生成设计文档

 -  -

· Design Review

· 设计复审 (和同事审核设计文档)

 -  -

· Coding Standard

· 代码规范 (为目前的开发制定合适的规范)

 -  -

· Design

· 具体设计

 10  10

· Coding

· 具体编码

 500  600

· Code Review

· 代码复审

 -

· Test

· 测试(自我测试,修改代码,提交修改)

30   30

Reporting

报告

60   -

· Test Report

· 测试报告

 20  20

· Size Measurement

· 计算工作量

 -  -

· Postmortem & Process Improvement Plan

· 事后总结, 并提出过程改进计划

 10  10
 

3. 解题思路:

  看到题目要求后,对于基本功能,我首先考虑的是如何统计出字符数、单词数、行数,然后是读取文件、写入文件,最后再考虑参数解析。高级功能也是先思考统计行数的方法,再是递归处理文件和使用停用表。我觉得这个题目涉及到的知识还是很多的,所以也查了很多相关的资料。印象比较深的是参数解析,一开始我不知道args的使用方法,对于参数的输入无从下手,后来问了同学然后在网上搜索后才知道。

部分参考资料:

1. https://www.cnblogs.com/Berryxiong/p/6232373.html  空格分割字符串

2. http://lucien-zzy.iteye.com/blog/2001275 InputStreamReader和BufferedReader用法

3. https://www.cnblogs.com/renxiaoren/p/5220534.html file文件的读取和写入

4. https://www.cnblogs.com/xy-hong/p/7197725.html main函数里String[] args的使用

5. http://blog.csdn.net/sunkun2013/article/details/13167099 把java文件打包成jar文件以及转换成可执行文件exe

4.程序设计实现过程:

程序一共有一个类,三个方法。除了主方法分别是写入文件和读取文件,读取文件方法里包括了统计各种结果的功能。主方法里主要是进行参数解析,也包括停用表和处理同目录文件的功能。

5.代码说明:

注:递归读取同目录下文件参考了周志为同学的代码

参数解析:

                int i = 0;
int fc = 0,fo = 0,fw = 0,fl = 0,fs = 0,fe = 0,fa = 0;
//根据输入对有效参数的状态进行处理
while(args[i].equals("-c")||args[i].equals("-w")||args[i].equals("-l")||args[i].equals("-s")||args[i].equals("-a")){
switch(args[i]){
case "-c" :
fc = 1;
i++;
break;
case "-w" :
fw = 1;
i++;
break;
case "-l" :
fl = 1;
i++;
break;
case "-s" :
fs = 1;
i++;
break;
case "-a" :
fa = 1;
i++;
break;
}
}

6.测试设计:

如何设计:应尽可能考虑到所有情况,将有效和可能无效的输入都进行尝试。

可能导致高风险的地方:比如只输入-o或者-e,以及读取的文件为空。

测试代码设计:

(1)-c file.c

(2)-o

(3)-e

(4)-a file.c

(5)-w -a file.c

(6)-l -a file.c -o result.txt

(8)-w file.c -e tt.txt

(7)-c -l -w -a file.c -e tt.txt -o result.txt

(9)-s -c *.c -o result.txt

(10)-c -l -w -a -s *.c -e tt.txt -o result.txt

应该全部覆盖了程序的要求

由于没有控制台,所以对有文件生成的测试结果截图。

读取文件

停用表文件

生成文件

7.参考资料链接:

1. https://www.cnblogs.com/Berryxiong/p/6232373.html  空格分割字符串

2. http://lucien-zzy.iteye.com/blog/2001275 InputStreamReader和BufferedReader用法

3. https://www.cnblogs.com/renxiaoren/p/5220534.html file文件的读取和写入

4. https://www.cnblogs.com/xy-hong/p/7197725.html main函数里String[] args的使用

5. http://blog.csdn.net/sunkun2013/article/details/13167099 把java文件打包成jar文件以及转换成可执行文件exe

6. http://www.cnblogs.com/xinz/archive/2011/10/22/2220872.html PSP表格的填写

7. http://ask.csdn.net/questions/352138 去除停用词

8. https://www.cnblogs.com/ouyangping/p/6842108.html String matches 正则表达

WordCount编码与测试的更多相关文章

  1. WordCount编码和测试

    WordCount编码和测试 项目地址:https://github.com/handsomesnail/WordCount PSP表格 PSP2.1 PSP阶段 预估耗时(分钟) 实际耗时(分钟) ...

  2. WordCount 编码与测试

    word count github 项目地址:https://github.com/liuqiang666/wordCount PSP表格 PSP2.1  PSP阶段  预估耗时(小时)  实际耗时( ...

  3. 软件质量与测试——WordCount编码实现及测试

    1.GitHub地址       https://github.com/noblegongzi/WordCount 2.PSP表格 PSP2.1 PSP 阶段 预估耗时 (分钟) 实际耗时 (分钟) ...

  4. WordCount编码测试

    Github项目地址:https://github.com/LantyrLYL/WordCount PSP表格: PSP2.1 PSP阶段 预估耗时 (分钟) 实际耗时 (分钟) Planning 计 ...

  5. 软件测试第2周个人作业:WordCount编码测试

    一.Github地址 https://github.com/zhouyubei/WordCount 二.PSP表格 PSP2.1 PSP阶段 预估耗时 (分钟) 实际耗时 (分钟) Planning ...

  6. WordCount程序与测试

    Github地址: https://github.com/hcy6668/wordCount PSP表格: PSP PSP阶段 预估耗时(分钟) 实际耗时(分钟) Planning 计划 60 40 ...

  7. WordCountPro 编码与测试

    WordCountPro github项目地址:https://github.com/handsomesnail/WordCountPro PSP表格 PSP2.1  PSP阶段  预估耗时(小时) ...

  8. WordCount程序及测试

    Github地址:https://github.com/CG0317/WordCount PSP表: PSP2.1 PSP阶段 预估耗时 (分钟) 实际耗时 (分钟) Planning 计划  30 ...

  9. mysql字符集编码乱码测试如下

    创建三个表tb_latin1,tb_utf8,tb_gbk,编码分别为latin1/utf8/gbk “你好a”字符串编码如下GBK : %C4%E3 %BA%C3 %61UTF-8 : %E4%BD ...

随机推荐

  1. CodeForces - 827A:String Reconstruction (基础并查集)

    Ivan had string s consisting of small English letters. However, his friend Julia decided to make fun ...

  2. [转]200 OK (from cache) 与 304 Not Modified------没有这个规则(ETag是否移除)!!!from cache和304,请查看顶部的流程图!

    //========没有这个规则(ETag是否移除) 20160422============// 200 OK (from cache) 与 304 Not Modified 为什么有的缓存是 20 ...

  3. linux php相关命令

    学习源头:http://www.cnblogs.com/myjavawork/articles/1869205.html php -m 查看php开启的相关模块 php -v 查看php的版本 运行直 ...

  4. Python numpy函数:transpose()

    transpose用于对高维数组进行转置,转置时候需要一个由轴编号组成的元组. 比如说三维的数组,那就对维度进行编号,也就是0,1,2:这样说可能比较抽象.这里的0,1,2可以理解为对shape返回元 ...

  5. Angular5学习笔记 - 服务优化(十)

    一.服务合并 二.验证效果

  6. [转载]centos下yum安装samba及配置

    centos下yum安装samba及配置 在我们使用 Windows 作为客户机的时候,通常有文件.打印共享的需求.作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过Wind ...

  7. ov2640数据

    问题部分解决,数据错误的原因是太快了.将0x11->3f  0xd3->7f 哈哈 问题解决 直接降低7670输出频率 调0x11到最大分频比 现在能完整抓拍QVGA的图像 不过就是采集速 ...

  8. (转)NHibernate各种数据库配置写法

    本文转载自:http://blog.csdn.net/hsg77/article/details/23463733 //NHibernate各种数据库连接参数文件配置方法说明 //配置文件Config ...

  9. Mysql 关键字-保留字

    ADD ALL ALTER ANALYZE AND AS ASC ASENSITIVE BEFORE BETWEEN BIGINT BINARY BLOB BOTH BY CALL CASCADE C ...

  10. 1104 Sum of Number Segments

    题意: 给出n个不大于1.0的小数序列,如{ 0.1, 0.2, 0.3, 0.4 },则共有10个分片(0.1) (0.1, 0.2) (0.1, 0.2, 0.3) (0.1, 0.2, 0.3, ...