课程地址 [广东工业大学-软件工程-计科21级12班] https://edu.cnblogs.com/campus/gdgy/CSGrade21-12
作业要求 https://edu.cnblogs.com/campus/gdgy/CSGrade21-12/homework/13014
作业目标 了解论文查重机理; Git与GitHub的链接使用;深刻体会个人开发流程

GitHub仓库地址


PSP表

PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟)
Planning 计划 20 40
Estimate 估计这个任务需要多少时间 20 10
Development 开发 120 180
Analysis 需求分析 (包括学习新技术) 120 180
Design Spec 生成设计文档 45 20
Design Review 设计复审 20 10
Coding Standard 代码规范 (为目前的开发制定合适的规范) 60 20
Design 具体设计 60 60
Coding 具体编码 180 300
Code Review 代码复审 30 45
Test 测试(自我测试,修改代码,提交修改) 60 120
Reporting 报告 40 60
Test Repor 测试报告 30 45
Size Measurement 计算工作量 15 15
Postmortem & Process Improvement Plan 事后总结, 并提出过程改进计划 10 10
Total 合计 830 1115

计算模块接口部分的设计与实现过程

  1. 主要的类

    2.流程

    3.算法关键

计算模块接口部分的性能改进

  1. 改进时间:45分钟

  2. 性能分析

  3. 程序中消耗最大的函数

点击查看代码
          //计算文档的相似度
          public static double computeTxtSimilar(String txtLeft, String txtRight){
          List<String> totalWordList = new ArrayList<>();

          //获取词频
          Map<String, Integer> leftWordCountMap = getWordCountMap(txtLeft,totalWordList);
          Map<String, Float> leftWordFrequency = calculateWordFrequency(leftWordCountMap);

          Map<String, Integer> rightWordCountMap = getWordCountMap(txtRight,totalWordList);
          Map<String, Float> rightWordFrequency = calculateWordFrequency(rightWordCountMap);

          //获取特征值
          List<Float> leftFeature = getTxtFeature(totalWordList,leftWordFrequency);
          List<Float> rightFeature = getTxtFeature(totalWordList,rightWordFrequency);

          float leftVectorSqrt = calculateVectorSqrt(leftWordFrequency);
          float rightVectorSqrt = calculateVectorSqrt(rightWordFrequency);

          float numerator = getNumerator(leftFeature,rightFeature);

          double cosValue = 0;

          if(numerator > 0){
               cosValue = numerator / (leftVectorSqrt * rightVectorSqrt);
          }
          cosValue = Double.parseDouble(String.format("%.2f",cosValue*100));
          return cosValue;
     }

计算模块部分单元测试展示

主程序测试

测试覆盖率截图

计算模块部分异常处理说明


文件测试