第四周作业
github:https://github.com/fanhao300/Test-QualityGroupWprk
组长:樊昊
组员:李帅 李威佟 彭士远
PSP:个人表格
|
PSP2.1 |
PSP阶段 |
预估耗时 (分钟) |
实际耗时 (分钟) |
|
Planning |
计划 |
30 |
30 |
|
· Estimate |
· 估计这个任务需要多少时间 |
30 |
30 |
|
Development |
开发 |
310 |
260 |
|
· Analysis |
· 需求分析 (包括学习新技术) |
40 |
40 |
|
· Design Spec |
· 生成设计文档 |
30 |
15 |
|
· Design Review |
· 设计复审 (和同事审核设计文档) |
30 |
15 |
|
· Coding Standard |
· 代码规范 (为目前的开发制定合适的规范) |
30 |
30 |
|
· Design |
· 具体设计 |
30 |
30 |
|
· Coding |
· 具体编码 |
60 |
40 |
|
· Code Review |
· 代码复审 |
30 |
30 |
|
· Test |
· 测试(自我测试,修改代码,提交修改) |
60 |
60 |
|
Reporting |
报告 |
100 |
100 |
|
· Test Report |
· 测试报告 |
60 |
60 |
|
· Size Measurement |
· 计算工作量 |
20 |
20 |
|
· Postmortem & Process Improvement Plan |
· 事后总结, 并提出过程改进计划 |
20 |
20 |
|
|
合计 |
440 |
390 |
接口实现:
实现输入检测模块。File check(String filename)读入文件名返回FILE结构给下一模块使用。
/** * * @author 彭士远 * */ public class Inputcheck { private static final String HOUZHUI = ".txt"; private static final int MATCHLENGTH = 4; public File check(String filename) { File filePath = new File(filename); if(filePath.exists()) { if(!(filename.substring((filename.length() - MATCHLENGTH), filename.length()).equals(HOUZHUI))) { filePath = null; } }else { filePath = null; } return filePath; } }
设计用例:
白盒测试:

A->B->C->E->F->G:pp.c
A->B->C->E->G:wc.txt
A->B->G:ppp.txt
黑盒测试:
| 文件不存在 |
ppp.txt ./pp ./pp.jpg ./pp.png ./pp.wc ./pp.db ./pp.idx ./pp.wwc ./pp.mmp ./pp.pci ./pp.jz ./pp.jar ./pp.doc ./pp.docx ./pp.not |
| 文件存在但不匹配 | ./pp.c |
| 特殊文件名 | * |
| 文件存在且匹配且输入正常 | ./wc.txt |
测试运行截图:
扩展任务
(1)选择《阿里巴巴Java开发手册》1.3代码格式,1.3-4:二目运算符,三目运算符左右都需要加一个空格
(2)分析组员-17117的代码
package test; import java.io .FileOutputStream; import java.io .IOException; import java.util.*; /** * * @author LS * */ public class Print { private static ArrayList<Item> itemList=new ArrayList<Item>(); public ArrayList<Item> getItemList() { return itemList; } public void setItemList(ArrayList<Item> itemList) { Print.itemList = itemList; } public void output() throws IOException { String line=""; FileOutputStream out=new FileOutputStream("result.txt"); for(int i=0;i<itemList.size();i++) { Item pp=itemList.get(i); line=pp.getName()+","+pp.getValue()+"\n"; out.write(line.getBytes()); } out.close(); } }
评价代码:二目运算符,三目运算符左右都需要加一个空格。满足
(3)静态代码工具:https://p3c.alibaba.com/plugin/eclipse/update
(4)
遵循规范:代码命名不以_$开始,方法参数成员变量局部变量统一lowerCamelCase等
小组讨论:
贡献率:
组长:樊昊 0.28
组员:李帅 0.24
李威佟 0.24
彭士远 0.24

浙公网安备 33010602011771号