WordCount of Software Engineering
1.Github项目地址:https://github.com/BayardM/WordCount
2.PSP表格(before):
PSP2.1 |
Personal Software Process Stages |
预估耗时(分钟) |
实际耗时(分钟) |
Planning |
计划 |
30 |
|
· Estimate |
· 估计这个任务需要多少时间 |
30 |
|
Development |
开发 |
50 |
|
· Analysis |
· 需求分析 (包括学习新技术) |
100 |
|
· Design Spec |
· 生成设计文档 |
15 |
|
· Design Review |
· 设计复审 (和同事审核设计文档) |
0 |
|
· Coding Standard |
· 代码规范 (为目前的开发制定合适的规范) |
10 |
|
· Design |
· 具体设计 |
40 |
|
· Coding |
· 具体编码 |
40 |
|
· Code Review |
· 代码复审 |
30 |
|
· Test |
· 测试(自我测试,修改代码,提交修改) |
60 |
|
Reporting |
报告 |
25 |
|
· Test Report |
· 测试报告 |
10 |
|
· Size Measurement |
· 计算工作量 |
10 |
|
· Postmortem & Process Improvement Plan |
· 事后总结, 并提出过程改进计划 |
20 |
|
合计 |
|
470 |
|
3.解题思路:
刚开始拿到题目时因为感觉题目很长,要求很多,所以感到很懵,一点没懂到底要做什么,便在网上查阅了一些资料与博客,研究了牛人们的讲解终于明白题目意思,并且知道此次题目会涉及文档流的操作,因为自己暂时对c语言使用更加灵活,所以本次开发全为C语言。
4.设计实现过程:
代码简单明了大致分为四部分,三个基本功能各一个函数实现,主函数中对功能进行相应调用执行及功能使用的指引。
5.代码说明:
字符数类:
//字符数
int CharacterCount(char filepath[])
{
FILE *f1 = NULL;
char c;
int charcount = ;
f1 = fopen(filepath , "r");
if(f1 == NULL)
{
printf("Can't Find!\n");
exit();
}
c = fgetc(f1);
while(c != EOF)
{
c = getc(f1);
charcount++;
}
fclose(f1);
return charcount;
}
单词数类:
//词数
int WordCount(char filepath[])
{
FILE *f2 = NULL;
char w;
int wordcount = ;
f2 = fopen(filepath , "r");
if(f2 == NULL)
{
printf("Can't Find!\n");
exit();
}
w = fgetc(f2);
while(w != EOF)
{
if((w>='A' && w<='Z') || (w>='a' && w<='z') || (w>='' && w<=''))
{
while((w>='A' && w<='Z') || (w>='a' && w<='z') || (w>='' && w<='') || w == '_')
{
w = fgetc(f2);
}
wordcount++;
}
w = fgetc(f2);
}
fclose(f2);
return wordcount;
}
行数:
//行数
int LineCount(char filepath[])
{
FILE *f3 = NULL;
char l;
int linecount = ;
f3 = fopen(filepath , "r");
if(f3 == NULL)
{
printf("Can't Find!\n");
exit();
}
l = fgetc(f3);
while(l != EOF)
{
if(l == '\n')
{
linecount++;
l = fgetc(f3);
}
else{
l = fgetc(f3);
}
}
if(CharacterCount(filepath) == )
linecount = ;
fclose(f3);
return linecount;
}
以上类代码结构基本一致,不同点仅在于判断条件。
6.测试运行:
(1)普通文本测试结果及文件
(2)空文件测试结果及文件
(3)单字符测试结果及文件
(4)单行测试结果及文件
(5)普通代码测试结果及文件
(6)路径错误测试
7.PSP(after):
PSP2.1 |
Personal Software Process Stages |
预估耗时(分钟) |
实际耗时(分钟) |
Planning |
计划 |
30 |
30 |
· Estimate |
· 估计这个任务需要多少时间 |
30 |
25 |
Development |
开发 |
50 |
55 |
· Analysis |
· 需求分析 (包括学习新技术) |
100 |
120 |
· Design Spec |
· 生成设计文档 |
15 |
5 |
· Design Review |
· 设计复审 (和同事审核设计文档) |
0 |
0 |
· Coding Standard |
· 代码规范 (为目前的开发制定合适的规范) |
10 |
10 |
· Design |
· 具体设计 |
40 |
30 |
· Coding |
· 具体编码 |
40 |
40 |
· Code Review |
· 代码复审 |
30 |
25 |
· Test |
· 测试(自我测试,修改代码,提交修改) |
60 |
65 |
Reporting |
报告 |
25 |
20 |
· Test Report |
· 测试报告 |
10 |
10 |
· Size Measurement |
· 计算工作量 |
10 |
10 |
· Postmortem & Process Improvement Plan |
· 事后总结, 并提出过程改进计划 |
20 |
25 |
合计 |
|
470 |
470
|
8.项目小结:
这次项目在编码上学到的主要是c语言相关文档的操作,这是之前从没涉及到过的领域,因此感觉收获蛮丰富的;然后在整个策划详细设计时主要是感悟到遇到困难决不能轻言放弃。要学会有效的借鉴前人的经验,从中汲取知识转化为自己的能力;除此之外,还是有遗憾的地方,便是觉得自己只能用c语言去做项目是非常单一的,并且也并没有将c语言用得融会贯通,还是需要继续学习,并且本次项目其实题目理解方面大部分都是查阅资料才弄清楚,感觉还是要加强自己的理解能力,平时自己还得做一些其他更复杂能锻炼人的项目,如果老师能推荐那更好,来日方称,未来可期,切勿放弃!
WordCount of Software Engineering的更多相关文章
- Software Engineering: 3. Project planning
recourse: "Software Engineering", Ian Sommerville Keywords for this chapter: planning sche ...
- 第二篇——The communication during software engineering.
I've learned a lot in my software engineering class about how a program comes out.That's also a esse ...
- Software Engineering: 2. Project management
resources:"Software Engineering" Ian Sommerville For most projects, important goals are: D ...
- Software Engineering: 1. Introduction
Resource: Ian, Sommerville, Software Engineering 1. Professional software development 1.1 Software e ...
- SENG201 (Software Engineering I) Project
SENG201 (Software Engineering I) ProjectSpace ExplorerFor project admin queries:For project help, hi ...
- 个人阅读作业2—《No Silver Bullet: Essence and Accidents of Software Engineering》读后感
在进行了一次结对编程.一次团队编程和一次个人编程项目后,读了<No Silver Bullet: Essence and Accidents of Software Engineering> ...
- Software Engineering at Google
Google的Fergus Henderson在Software Engineering at Google中介绍了Google的软件工程实践. 软件开发 源码仓库 单一源代码仓库,除了核心配置和安全 ...
- Go is more about software engineering than programming language research.
https://talks.golang.org/2012/splash.article Go at Google: Language Design in the Service of Softwar ...
- 10. Software, Software Engineering, water fall (瀑布模型),Code Complete等名词的来源
①.Software-软件”一词是20世纪60年代才出现的,软件Software——1958年由贝尔实验室的著名统计学家John Tukey 提出软件与硬件一起构成完整的计算机系统,它们是相互依存,缺 ...
随机推荐
- table标签用法
<table>标签 HTML中表格由 <table> 标签来定义. 每个表格均有若干行(由 <tr> 标签定义),每行被分割为若干单元格(由 <td> ...
- JAVA实现BP神经网络算法
工作中需要预测一个过程的时间,就想到了使用BP神经网络来进行预测. 简介 BP神经网络(Back Propagation Neural Network)是一种基于BP算法的人工神经网络,其使用BP算法 ...
- 不使用字体图标和图片,只使用css如何做出展开收起的效果
<i class="iconArrow" :class="[ littleNavState === item.meta.id ? 'arrowOpen' : '' ...
- 字典内置函数&方法
字典内置函数&方法 Python字典包含了以下内置函数:高佣联盟 www.cgewang.com 序号 函数及描述 1 cmp(dict1, dict2)比较两个字典元素. 2 len(dic ...
- Python Tuple(元组) min()方法
描述 Python 元组 min() 函数返回元组中元素最小值.高佣联盟 www.cgewang.com 语法 min()方法语法: min(tuple) 参数 tuple -- 指定的元组. 返回值 ...
- Python List index()方法
描述 index() 函数用于从列表中找出某个值第一个匹配项的索引位置.高佣联盟 www.cgewang.com 语法 index()方法语法: list.index(x[, start[, end] ...
- PHP get_resource_type() 函数
get_resource_type() 返回资源(resource)类型. 版本要求:PHP 4 >= 4.0.2, PHP 5, PHP 7高佣联盟 www.cgewang.com 语法 st ...
- MediaDevices.getUserMedia()
MediaDevices.getUserMedia() 会提示用户给予使用媒体输入的许可,媒体输入会产生一个MediaStream,里面包含了请求的媒体类型的轨道.此流可以包含一个视频轨道(来自硬件或 ...
- Tarjan算法 学习笔记
前排提示:先学习拓扑排序,再学习Tarjan有奇效. -------------------------- Tarjan算法一般用于有向图里强连通分量的缩点. 强连通分量:有向图里能够互相到达的点的集 ...
- Spring的 JDBCTemplate和声明式事务控制
Spring 中的 JdbcTemplate[会用] JdbcTemplate 概述 它是 spring 框架中提供的一个对象,是对原始 Jdbc API 对象的简单封装.spring 框架为我们提供 ...