系统分析与设计结对项目

作业成果

作业源码-java-gitee.

作业要求

老师源作业要求
根据WordCount的需求描述,先编程实现,再编写单元测试,最后撰写博客。

合作伙伴

    201631062120 201631062220

编码过程

PSP表格

PSP2.1 PSP阶段 预估耗时(分钟) 实际耗时(分钟)
· Planning · 计划 60 50
· Estimate · 估计这个任务需要多少时间 20 20
· Development · 开发 330 330
· Analysis · 需求分析 (包括学习新技术) 30 30
· Design Spec · 生成设计文档 0 0
· Design Review · 设计复审 (和同事审核设计文档) 20 20
· Coding · 代码规范 (为目前的开发制定合适的规范) 0 0
· Code Review · 具体设计 20 20
· Test · 具体编码 180 100
· Reporting · 代码复审 20 20
· Test Report · 报告 140 140
· Size Measurement · 测试报告 60 60
· Postmortem & Process · 计算工作量 20 20
· Improvement Plan · 事后总结, 并提出过程改进计划 60 60
· 合计 520 540

互审代码

李欣 TO 王筱哲 :逻辑写的非常不错,唯一不足的是注释有点少,希望以后多写注释

王筱哲 TO 李欣 :思路很清楚,感觉还不错

基本功能基本一样,扩展功能主要是分成几个class,都有点困扰,代码不是那么清楚,都有所改动,最后基本一致

UML类图

系统分析与设计结对项目_第1张图片

属性方法

文件对象

public class Wc {
    public int chars;
    public int words;
    public int lines;
    public int codeLines;       //代码行数
    public int empLines;        //空行数
    public int comLines;        //注释行数

    public int getChars() {
        return chars;
    }

    public int getWords() {
        return words;
    }

    public int getLines() {
        return lines;
    }

    public int getCodeLines() {
        return codeLines;
    }

    public int getEmpLines() {
        return empLines;
    }

    public int getComLines() {
        return comLines;
    }
}

命令对象

    public static String inputFile;
    public static String outputFile;
    public static boolean needC;
    public static boolean needW;
    public static boolean needL;
    public static boolean needO;
    public static boolean needS;        //输入参数中是否有“-s”
    public static boolean needA;        //输入参数中是否有“-a”
    public static boolean needE;        //输入参数中是否有“-e”

查找代码行、注释行、空行

    此处不同于最终项目,是最初时,对于注释行的检测的初试
    public static Count wc(String inputFile) throws IOException {
        boolean isNote = false;
        int notNote=0;
        String lineString = "";
        Count count=new Count(0,0,0,0,0,0);
        String txt = "";
        String[] buffer = null;
        String[] buffer2;
        File dir=new File(inputFile);
        BufferedReader bf = new BufferedReader(new FileReader(dir));
       while((txt=bf.readLine())!=null){
            buffer2=txt.split(",| |\t|\n");
            for(int i=0;i

测试

    命令
    wc.exe -l -c -w -a D:\\Desktop\\123.c"
    结果
    123.c, 字符数: 44
    123.c, 单词数: 30
    123.c, 行数: 7
    123.c, 代码行/空行/注释行: 2/4/1

总结

    停用词表的检测存在些许问题,没有达到预期效果。因为时间有限,高级功能最终也没有真正实现。希望后续时间可以完成
    另外结对编程相比自己编程来说,可以更好的讨论和研究需求和具体实现,但是也存在双方意见不同、争执的时候。但总体来说,1+1>2,遇到问题时,有人可以商量,比一个人思索更有效些。

你可能感兴趣的:(系统分析与设计结对项目)