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 提出软件与硬件一起构成完整的计算机系统,它们是相互依存,缺 ...
随机推荐
- 控制语句—for循环、while循环
for循环 基本结构: for(初始条件1:循环条件2:状态改变3){ 循环体4 } 运行流程:1-2-4-3-2-4 while循环 基本结构: var i=0 //初始条件 1 while(i&l ...
- 第十一章 容器类&新日期时间
11.1.Optional 容器类 11.1.1.概述 Optional 类是一个容器类,代表一个值存在或不存在, 原来用 null 表示一个值不存在,现在 Optional类 可以更好的表达这个概念 ...
- Mybatis Plus中的lambdaQueryWrapper条件构造图介绍
- sqlzoo - SELECT from WORLD Tutorial 答案
01.SELECT from WORLD Tutorial 01.显示所有国家的名称,大洲和人口. SELECT name, continent, population FROM world; 02. ...
- PHP easter_date() 函数
------------恢复内容开始------------ 实例 输出不同年份的复活节日期: <?phpecho easter_date() . "<br />" ...
- PHP mysqli_thread_safe() 函数
定义和用法 mysqli_thread_safe() 函数返回是否将客户端库编译成 thread-safe. 语法 mysqli_thread_safe();高佣联盟 www.cgewang.com ...
- 焦点损失函数 Focal Loss 与 GHM
文章来自公众号[机器学习炼丹术] 1 focal loss的概述 焦点损失函数 Focal Loss(2017年何凯明大佬的论文)被提出用于密集物体检测任务. 当然,在目标检测中,可能待检测物体有10 ...
- MyBatis-Plus使用(3)-条件构造器
说明: 以下出现的第一个入参boolean condition表示该条件是否加入最后生成的sql中 以下代码块内的多个方法均为从上往下补全个别boolean类型的入参,默认为true 以下出现的泛型P ...
- .NETCore中实现ObjectId反解
前言 在设计数据库的时候,我们通常需要给业务数据表分配主键,很多时候,为了省事,我都是直接使用 GUID/UUID 的方式,但是在 MonggoDB 中,其内部实现了 ObjectId(以下统称为Oi ...
- 用python包xlwt将数据写入Excel中
一般用两种格式的数据写入,不多说放上demo. 1.列表形式写入 import xlwt def data_write(file_path, datas): f = xlwt.Workbook() s ...