标签:span 白盒测试 tps rev lse containe class 第四周 实现
(1)Github项目地址:https://github.com/huangjianmin/wcPro/
(2)psp表格:
| PSP2.1 | PSP阶段 | 预估耗时(分钟) | 实际耗时(分钟) |
|---|---|---|---|
| Planning | 计划 | 30 | 30 |
| .Estimate | .估计这个任务开发需要多少时间 | 30 | 30 |
| Development | 开发 | 370 | 370 |
| .Analysis | .需求分析 | 30 | 30 |
| .Design Spec | .生成设计文档 | 30 | 30 |
| .DesignReview | .设计复审(和同事审核设计文档) | 20 | 10 |
| .Coding Standard | .代码规范(为目前开发指定合适规范) | 20 | 20 |
| .Design | .具体设计 | 20 | 20 |
| .Coding | .具体编码 | 20 | 20 |
| .Code Review | .代码复查 | 10 | 10 |
| .Test | .测试(自我测试,修改代码,提交代码) | 60 | 80 |
| Reporting | 报告 | 100 | 100 |
| .Test Report | .测试报告 | 50 | 50 |
| .Size Measurement | .计算工作量 | 20 | 20 |
| .Postmortem & Process Improvement Plan | .时候总结,并提出过程改进计划 | 20 | 20 |
|
合计 |
接口实现:
| public static void main(String[] args) throws IOException { | |
| // TODO Auto-generated method stub | |
| String curPath=System.getProperty("user.dir"); | |
| Scanner s = new Scanner(System.in); | |
| String name = s.nextLine(); | |
| s.close(); | |
| if(name.indexOf(".txt")==-1) | |
| { | |
| System.out.println("???t2?ê?ò?txt?á?2"); | |
| } | |
| else { | |
| //String name ="test2.txt"; | |
| File file = new File(name); | |
| //String targetStr=""; | |
| FileInputStream fis=new FileInputStream(file); | |
| byte[] inputStream=new byte[fis.available()]; | |
| String targetStr=""; | |
| while(fis.read(inputStream)!=-1) | |
| { | |
| targetStr=new String(inputStream,0,inputStream.length); | |
| } | |
| fis.close(); | |
| //System.out.println(targetStr); | |
| wordFre mainFunction=new wordFre(); | |
| //String saveData=""; | |
| ArrayList<String> saveData=new ArrayList<String>(); | |
| ArrayList<String> SaveData=new ArrayList<String>(); | |
| SaveData=mainFunction.diviWord(targetStr); | |
| int i=0; | |
| /*while(i<saveData.size()-1) { | |
| System.out.println(saveData.get(i)+" "+saveData.get(++i)); | |
| i++; | |
| }*/ | |
| saveData=mainFunction.sort(SaveData); | |
| File outfile=new File("result.txt"); | |
| PrintStream ps=new PrintStream(new FileOutputStream(outfile)); | |
| i=0; | |
| while(i<saveData.size()-1) { | |
| String str=saveData.get(i)+" "+saveData.get(++i); | |
| System.out.println(str); | |
| ps.println(str); | |
| i++; | |
| } | |
| ps.close(); | |
| } | |
| } |
测试用例设计
黑盒测试通过不同的输入类型文件,包含输入参数对应的文本文件内容类型来测试功能的正确性;黑盒测试有单词频率不是数字的情况,文件夹路径不对,及正常情况等。白盒测试在尽量覆盖所有路径的情况下对每个路径进行参数与返回值的匹配正确性测试。
对main函数的测试主要包括对输入的检验和对其它接口调用返回结果的检验
标签:span 白盒测试 tps rev lse containe class 第四周 实现
原文地址:https://www.cnblogs.com/meizc/p/8746928.html