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 提出软件与硬件一起构成完整的计算机系统,它们是相互依存,缺 ...
随机推荐
- SpringBoot集成Dubbo+Zookeeper
目录 Spring版本 dubbo_zookeeper负责定义接口 dubbo_provider 服务提供者 dubbo_consumer服务使用者 Spring版本 不知道为啥,新创建的Spring ...
- Spring+hibernate+JSP实现Piano的数据库操作---2.Controller+Service+Dao
Controller package com.controller; import com.entity.Piano; import org.dom4j.rule.Mode; import org.s ...
- PHP 中的字符串变量
PHP 字符串变量 字符串变量用于存储并处理文本. PHP 中的字符串变量 字符串变量用于包含有字符的值. 在创建字符串之后,我们就可以对它进行操作了.您可以直接在函数中使用字符串,或者把它存储在变量 ...
- Python time gmtime()方法
描述 Python time gmtime() 函数将一个时间戳转换为UTC时区(0时区)的struct_time,高佣联盟 www.cgewang.com 可选的参数sec表示从1970-1-1以来 ...
- PHP xml_set_notation_decl_handler() 函数
定义和用法 xml_set_notation_decl_handler() 函数规定当解析器在 XML 文档中找到符号声明时被调用的函数. 如果成功,该函数则返回 TRUE.如果失败,则返回 FALS ...
- 5.15 牛客挑战赛40 C 小V和字符串 数位dp 计数问题
LINK:小V和字符串 容易想到只有1个数相同的 才能有贡献. 知道两个01串 那么容易得到最小步数 大体上就是 第一个串的最前的1和第二个串最前的1进行匹配. 容易想到设f[i][j]表示 前i位1 ...
- ZR 提高十连 DAY 4
哇 这题目怎么一次比一次毒瘤 当然这次还好 有会做的题目. T1 一眼看上去 毒瘤!再看一眼 我真不想看了 扔了. T2 哇感觉能写 哇这不是 随便都有40分了么 二分?优化一下65到手了.然后剩下的 ...
- react-router分析 - 一、history
react-router基于history库,它是一个管理js应用session会话历史的js库.它将不同环境(浏览器,node等)的变量统一成了一个简易的API来管理历史堆栈.导航.确认跳转.以及s ...
- 部署Python应用
目录 安装Python 3.7.5 部署文件 安装Python 3.7.5 CentOS默认安装的是2.7.5版本的python [root@iZuf6e3zah39uzoj5pg1myZ ~]# p ...
- 010_go语言中的maps映射(字典)
代码演示 package main import "fmt" func main() { m := make(map[string]int) m["k1"] = ...