结对编程之单元测试 201421123108 王坤彬
成员: 林 钊 -- 201421123105 吴世荣 -- 201421123119 王坤彬 -- 201421123108
coding地址:https://coding.net/u/linzhao/p/UnitTest/git
需求分析:
1.整数加减乘除的测试;
2.分数加减乘除的测试;
3.最大公约数测试;
4.判断真分数测试;
计算模块:
public
int
gcd(
int
a,
int
b)
//公约数
{
if
(a == 0)
{
return
b;
}
else
if
(b == 0)
{
return
a;
}
else
{
return
gcd(b % a, a);
}
}
public
int
Calculate(
int
type,
int
op1,
int
op2)
//整数四则运算
{
int
result = 0;
if
(type == 1)
{
result = op1 + op2;
}
if
(type == 2)
{
result = op1 - op2;
}
if
(type == 3)
{
result = op1 * op2;
}
if
(type == 4)
{
result = op1 / op2;
}
return
result;
}
public
string
CalculateFengsu(
int
up1,
int
down1,
int
up2,
int
down2,
int
type)
//分数四则运算
{
string
result =
""
;
if
(type == 1)
{
up1 = (up1 * down2 + up2 * down1);
down1 = down1 * down2;
up2 = gcd(up1, down1);
up1 = up1 / up2;
down1 = down1 / up2;
result = up1.ToString() +
"/"
+ down1.ToString();
return
result;
}
if
(type == 2)
{
up1 = (up1 * down2 - up2 * down1);
down1 = down1 * down2;
up2 = gcd(up1, down1);
up1 = up1 / up2;
down1 = down1 / up2;
result = up1.ToString() +
"/"
+ down1.ToString();
return
result;
}
if
(type == 3)
{
up1 = up1 * up2;
down1 = down1 * down2;
up2 = gcd(up1, down1);
up1 = up1 / up2;
down1 = down1 / up2;
result = up1.ToString() +
"/"
+ down1.ToString();
return
result;
}
if
(type == 4)
{
up1 = up1 * down2;
down1 = down1 * up2;
up2 = gcd(up1, down1);
up1 = up1 / up2;
down1 = down1 / up2;
result = up1.ToString() +
"/"
+ down1.ToString();
return
result;
}
return
result;
}
public
string
CalculateZfengsu(
int
up1,
int
down1)
//判断及生成真分数
{
string
result =
"true"
;
int
mid = 0;
if
(up1 > down1)
{
mid = down1;
down1 = up1;
up1 = mid;
result = up1.ToString() +
"/"
+ down1.ToString();
return
result;
}
if
(up1 == down1)
{
down1 += 3;
result = up1.ToString() +
"/"
+ down1.ToString();
return
result;
}
return
result;
}
一、公约数测试:
gcd(
int
a,
int
b)
二、整数加减乘除测试:
Calculate(
int
type,
int
op1,
int
op2) //其中type为运算类型,op1,op2为整数。
三、分数四则运算:
CalculateFengsu(
int
up1,
int
down1,
int
up2,
int
down2,
int
type) //其中up1,up2为分子,down1,down2为分母,type为运算类型。
四、判断真分数:
CalculateZfengsu(
int
up1,
int
down1) //up1,down1分别为分子分母。
五、代码覆盖率:
六、小结:
这是结对编程的第二次作业,难度会大一些,万事开头难,不知道从何下手,摸索了一段时间后才开始做的,一些代码也不够熟练,总得好好的去找其他同学请教请教才行。还有就是要看以前的书籍。
七、Git 版本控制系统保存工作文件:
八、PSP表格:
PSP2.1 |
Personal Software Process Stages |
Time Senior Student |
Time |
Planning |
计划 |
0.5h |
0.5h |
· Estimate |
估计这个任务需要多少时间 |
2h |
2.5h |
Development |
开发 |
1.5h |
1h |
· Analysis |
需求分析 (包括学习新技术) |
20min |
10min |
· Design Spec |
生成设计文档 |
10min |
6min |
· Design Review |
设计复审 |
10min |
16min |
· Coding Standard |
代码规范 |
5min |
3min |
· Design |
具体设计 |
20min |
12min |
· Coding |
具体编码 |
40min |
21min |
· Code Review |
代码复审 |
15min |
9min |
· Test |
测试(自我测试,修改代码,提交修改) |
15min |
21min |
Reporting |
报告 |
5min |
6min |
· |
测试报告 |
5min |
2min |
· |
计算工作量 |
5min |
1min |
· |
提出过程改进计划 |
10min |
3min |
转载于:https://www.cnblogs.com/wkb2040/p/6640093.html
结对编程之单元测试 201421123108 王坤彬相关推荐
- 结对编程2——单元测试
码市地址:https://git.coding.net/cjz113/jiedui2.git 结对成员:201421123111 201421123113 题目描述: 上一周大家为四则运算程序设计了2 ...
- 结对编程2 单元测试
单元测试 201421123098 胡丹丹 201421123118 张中结 代码地址:https://git.coding.net/zzj201421123118/together-2.git 一. ...
- 个人附加作业 201421123108 王坤彬 网络1414
1. 个人项目评分问:这是最能体现个人能力的项目,我觉得比重要高一点儿. 结对项目存在问题:会存在两人之间不匹配现象,知识点不匹配从而导致分数无法体现出个人真实水平. 团队作业存在问题:会存在碌碌无为 ...
- 英语学习案例分析APP 201421123108 王坤彬
第一部分.调研,测评 1.第一次使用经验. 我使用的时候苹果手机下载的必应软件.第一次使用感觉还好,但是知名度比较低,比不上喜马拉雅听书软件,这里我就做两者的对比.首先界面以及种类明显逼格更差点.必应 ...
- 结对编程 王坤彬 201421123108
码市地址:https://git.coding.net/linzhao/sizeyunsuangui.git 林 钊 -- 201421123105 吴世荣 -- 201421123119 王坤彬 - ...
- 结对编程——单元测试
结对编程 结对人:宫成荣 代码如下: #include<stack> #include<iostream> #include<deque&g ...
- 2022软工K班结对编程作业
逍遥骰GitHub链接 哔哩哔哩功能展示 学号 姓名 作业博客链接 具体分工 032002621 林灿彬 待填写 JavaScript编程.AI设计 032002623 林达锴 待填写 原型制作.ht ...
- java 四则运算gui_结对编程-四则运算GUI的实现
一.项目成员以及coding地址: 二.结对编程题目描述 在个人作业1中,用各种语言实现了一个命令行的四则运算小程序.进一步,本次要求把这个程序做成GUI,成为一个有基本功能.一定价值的程序.在下面的 ...
- 和AI结对编程!OpenAI与GitHub联手推出AI代码生成工具,比GPT-3更强大
作者 | 琰琰.青暮 比GPT-3更强大! 昨日,微软与OpenAI共同推出了一款AI编程工具GitHub Copilot,这款工具基于GitHub及其他网站的源代码,可根据上文提示为程序员自动编写下 ...
最新文章
- python 的* 代表元组 和**代表字典用法
- 火神山医院紧急招募IT运维志愿者需求
- nacos集群的ap cp切换_配置中心Nacos
- 图解Cisco Packet Tracert之利用TFTP来升级路由器的IOS
- 【Java】集合+I/O流+多线程の练习题+面试题
- 【Antlr】unknown attribute text for rule stat in $stat.text
- 【转】ArrayList Vector LinkedList 区别与用法
- Cockroachdb 一、系统环境
- SpringBoot 房屋租赁系统3.0 manland.liuyanzhao.com
- 迅雷下载链接转为普通链接
- 使用getdate()获取不同格式的日期
- Android studio第一次作业:实现Wechat界面
- 祝所有的程序猿春节愉快,好好休息
- MATLAB 2018b 新建GUI
- xtend怎么使用_Xtend 2.3 Beta到来–为另一种JVM语言腾出空间
- Python绘图笔记
- Python解释大数定律
- 密钥交换算法(DH算法)
- Oracle入门(二)
- 什么是 MySQL 监控
热门文章
- 计算机系统中时间周期的单位,时间单位换算 (全),计算机单位换算大全
- FPGA零基础学习:基于FPGA的音乐蜂鸣器设计(附代码)
- VS2017运行emwin模拟机不能运行的解决部分
- 经典C语言算法题之快乐数
- 找中位数O(n)算法
- IMX6ULL系列学习记录-sii902x移植篇
- php artisan dumpautoload,artisan 命令使用总结
- python科学数据库(一)
- ubantu提交代码Warning:subject >50 characters; use shorter first paragraph怎么解决
- 微金所项目-响应式开发文档