项目 | 内容 |
软件工程 | http://www.cnblogs.com/nwnu-daizh/ |
作业要求 | https://www.cnblogs.com/nwnu-daizh/p/10569690.html |
课程学习目标 | 熟悉软件开发整体流程,提升自身能力 |
点评的博客地址 | https://www.cnblogs.com/healerdevil/p/10560958.html |
github链接地址 | https://github.com/healer-devil/yuandaima/blob/master/src/danci.java |
评论与心得 | 你好,在阅读完你的博客之后。从博文结构上来讲,博文很完设善。但是在博文内容上来讲,在设计实现的时候,你并没有说明设计中有哪些类,且类负责说明功能。也没有说你主要有什么方法,是怎样实现的。在设计实现这块很模糊。在测试运行阶段,只是给出了统计k个高频词的截图,且没有体现GUI功能界面,也没有输出到result.txt文件的截图。PSP中有些地方不合理,在开发阶段我觉得至少比10分钟多。博文结构大体是跟着PSP的流程走的。PSP的计划时间大于实际时间,说明准备很充分。但是部分功能还没有完全的实现,总体非常不错,值得学习和借鉴。 |
- 核心功能代码展示
setLayout(null);
setBackground(Color.cyan);
setSize(600, 300);
setVisible(true);
btn1 = new Button("打开");
btn2 = new Button("保存");
btn3 = new Button("关闭");
tarea = new TextArea("");
add(btn1);
add(btn2);
add(btn3);
add(tarea);
tarea.setBounds(30, 50, 460, 220);
btn1.setBounds(520, 60, 50, 30);
btn2.setBounds(520, 120, 50, 30);
btn3.setBounds(520, 180, 50, 30);
op = new FileDialog(this, "打开", FileDialog.LOAD);
sv = new FileDialog(this, "保存", FileDialog.SAVE);
btn1.addActionListener(this);
btn2.addActionListener(this);
btn3.addActionListener(this);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
setVisible(false);
System.exit(0);
}
});
//统计该文本行数及字符数
public int[] allCount(String fileName) throws IOException {
long a =System.currentTimeMillis();//初始化开始时间
String line = fileName;
File file = new File(line);
InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "utf-8");
BufferedReader br = new BufferedReader(isr);
int charNum = 0;// 字符数
int wordsNum = 0;// 数字数
int lineNum = 0;// 行数
// 以流的形式读入文件
while (br.read() != -1) {
String s = br.readLine();
charNum += s.length();
wordsNum += s.split(" ").length;
lineNum++;
}
isr.close();// 关闭
int[] linenum = { charNum, wordsNum, lineNum, };
for (int i = 0; i < linenum.length; i++) {
System.out.println(linenum[i]);
}
System.out.println("字符数:"+charNum+"
单词数:"+wordsNum+"
行数:"+lineNum);
System.out.println("
执行耗时:"+(System.currentTimeMillis()-a+"ms"));//输出耗时时间
return linenum;
}
-
程序运行
-
柱状图
显示程序耗时
读入文件及人机交互
因个人能力问题,没有做出来附加功能。
-结对照片
PSP2.1 | 任务内容 | 计划共完成需要的时间(min) | 实际完成需要的时间(min) |
---|---|---|---|
Planning | 计划 | 55 | 60 |
· Esitimate | 估计这个任务需要多少时间,并规划大致工作步骤 | 350 | 400 |
· Development | 开发 | 500 | 600 |
· Analysis | 需求分析(包括学习新技术) | 60 | 50 |
· Design Spec | 生成设计文档 | 20 | 15 |
· Design Review | 设计复审(和同事审核设计文档) | 30 | 30 |
· Coing Standard | 代码规范(为目前开发制定合适的规范) | 20 | 20 |
· Design | 具体设计 | 40 | 35 |
· Coding | 具体编码 | 500 | 600 |
· Code Review | 代码复审 | 7 | 9 |
· Test | 测试(自我测试,修改代码,提交修改) | 17 | 25 |
· Reporting | 报告 | 10 | 15 |
· Test Report | 测试报告 | 15 | 22 |
· Size Measurement | 计算工作量 | 5 | 5 |
· Postmortem&Process Improvement Plan | 事后总结,并提出过程改进计划 | 10 | 10 |