利率计算v4.0--测试--软件工程
利率计算v4.0--测试
package Test; import Model.Interest;
import Service.CompoundInterestService;
import Service.OrInterestService;
import Service.PrincipalService;
import Service.SingleInterestService;
import org.junit.Test; /**
* Created by pc on 2016/3/28.
*/
public class TestInterest {
@Test
public void testInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(interest.getInterest() +" "+ interest.getPrincipal() +" "+ interest.getYear());
} @Test
public void testOrInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(new OrInterestService().orInterest("compound" , interest));
System.out.println(new OrInterestService().orInterest("single" , interest));
} @Test
public void testCompoundInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(new CompoundInterestService().calculate(interest));
} @Test
public void testSingleInterest(){
Interest interest = new Interest(0.5,1000,10);
System.out.println(new SingleInterestService().calculate(interest));
} @Test
public void testPrincipal(){
Interest interest = new Interest();
interest.setAmount(1000);
interest.setYear(10);
interest.setInterest(0.5);
System.out.println(new PrincipalService().calculate(interest));
} @Test
public void testYear(){
Interest interest = new Interest();
interest.setAmount(1000);
interest.setPrincipal(10000);
interest.setInterest(0.5);
System.out.println(new PrincipalService().calculate(interest));
} @Test
public void testLong(){
Interest interest = new Interest();
interest.setAmount(1000000000);
interest.setPrincipal(1000000000);
interest.setInterest(0.000000000001);
System.out.println(new PrincipalService().calculate(interest));
} @Test
public void test_01(){
Interest interest = new Interest();
interest.setAmount(1);
interest.setPrincipal(1);
interest.setInterest(1);
System.out.println(new PrincipalService().calculate(interest));
} }
<script type="text/javascript">
function check(form){
if (document.forms.compoundInterest.principal.value == ""){
alert("请输入本金 !");
document.forms.compoundInterest.principal.focus();
return false;
}
if (document.forms.compoundInterest.interestRate.value == ""){
alert("请输入利率 !");
document.forms.compoundInterest.interestRate.focus();
return false;
}
if (document.forms.compoundInterest.year.value == ""){
alert("请输入年份 !");
document.forms.compoundInterest.year.focus();
return false;
}
}
</script>
|
测试模块 |
测试数据 |
终值 |
运行结果 | bug跟踪 |
|
输入是否 正确 |
本金:(1000); 年限:(10); 利息:(0.5); |
(0.5,1000,10) |
√ |
|
|
单利/复利 选择 |
插入 字符串 选择 |
√ |
||
|
复利 计算 |
本金:(1000); 年限:(10); 利息:(0.5); |
57665.04 |
√ |
|
|
单利 计算 |
本金:(1000); 年限:(10); 利息:(0.5); |
15000.00 | √ | |
|
本金 计算 |
本利之和:(1000); 年限:(10); 利息: (0.5); |
17.34 | √ | |
|
年限 计算 |
本利之和:(1000); 本金:(10000); 利息: (0.5); |
1000.00 |
算法 有误 |
|
|
测试 数值 |
本利之和:(1000000000); 本金:(1000000000); 利息: (0.000000000001); |
1000000000.00 |
超出类型 上限 |
|
|
测试 数值 |
本利之和:(1); 本金:(1); 利息: (1); |
1.00 |
利息应为 浮点型 |
|
|
测试 数值 |
插入 空 数据 |
提出警告 并且不能提交数据 |
√ |
利率计算v4.0--测试--软件工程的更多相关文章
- 利率计算v5.0--结对--软件工程
利率计算v5.--测试--软件工程 1.任务结对同伴: 名字:王昕明 学号: 博客地址 :http://home.cnblogs.com/u/xinmingwang/ Git : https://gi ...
- 利率计算v2.0--web版--软件工程
.客户说:帮我开发一个复利计算软件. .如果按照单利计算,本息又是多少呢? .假如30年之后要筹措到300万元的养老金,平均的年回报率是3%,那么,现在必须投入的本金是多少呢? .利率这么低,复利计算 ...
- 复利计算--4.0 单元测试之JAVA版-软件工程
复利计算--4.0 单元测试-软件工程 前言:由于本人之前做的是C语言版的复利计算,所以为了更好地学习单元测试,于是将C语言版的复利计算修改为JAVA版的. 一.主要的功能需求细分: 1.本金为100 ...
- <更新日期03-31-2016> 复利计算5.0 <已改进>
作业要求: 1.客户说:帮我开发一个复利计算软件. 完成复利公式计算程序,并成功PUSH到github上. 客户提出: 2.如果按照单利计算,本息又是多少呢? 3.假如30年之后要筹措到300万元的养 ...
- 没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限 的解决方案
问题情况: 在64位机器上运行Web服务,然后在配置好之后测试访问的时候出现如下提示:
- 在 Ubuntu 14.04/15.04 上配置 Node JS v4.0.0
大家好,Node.JS 4.0 发布了,这个流行的服务器端 JS 平台合并了 Node.js 和 io.js 的代码,4.0 版就是这两个项目结合的产物——现在合并为一个代码库.这次最主要的变化是 N ...
- [Bug]没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限
问题 环境WIN8.1 x64,新安装的vs与iis,在部署网站时,出现该异常信息.本地机作为测试机,就部署一个站点进行测试,没想到出现这个错误. 解决方案 如果你访问上面的那个路径,你会发现并没有那 ...
- 小蔡计算器 V4.0新版全新发布上线啦~欢迎大家下载使用哈~
小蔡计算器4.0新版全新发布上线啦~欢迎大家下载使用哦~ 立即下载:http://www.zhentiyuan.com/windows/index.aspx 软件介绍:小蔡计算器4.0是一款界面优美的 ...
- 最新安全狗 apache v4.0 sql注入 bypass
前言 最近没事学习一下 waf 的 bypass , 本文介绍下 bypass 安全狗的笔记.个人感觉 bypass 的总思路(正则匹配型 waf)就是利用各种语法特性来逃避正则(当然要保证语法正确性 ...
随机推荐
- BZOJ4033: [HAOI2015]树上染色(树形DP)
4033: [HAOI2015]树上染色 Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 3461 Solved: 1473[Submit][Stat ...
- 关于ppt的字体(转载)
壹文钱:教程(13)——字体篇(上) 2015-11-25 @嘉文钱 幻方秋叶PPT 前三期嘉文给大家说了颜色,想复习的童鞋,链接在此: 壹文钱:教程(10)——色色,你好! 壹文钱:教程(11)—— ...
- jquery插件与扩展一
要说jQuery 最成功的地方,我认为是它的可扩展性吸引了众多开发者为其开发插件,从而建立起了一个生态系统.这好比大公司们争相做平台一样,得平台者得天下.苹果,微软,谷歌等巨头,都有各自的平台及生态圈 ...
- Programming Languages: Application and Interpretation
http://cs.brown.edu/courses/cs173/2012/book/ 1 Introduction 1.1 Our Philosophy 1.2 The Structure of ...
- bzoj 3144 [Hnoi2013]切糕——最小割
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3144 一根纵轴上切一个点,可以把一根纵轴上的点连成一串来体现.自己的写法是每个点连向前一个点 ...
- Genymotion使用分析
1.从官网下载Genymotion Genymotion官方下载地址:https://www.genymotion.com/#!/download 没有注册,先进行注册 公司规模选择个人 2.Andr ...
- (接上一条)解决ssh隧道断开自动重连的问题
Sounds like you need autossh. This will monitor an ssh tunnel and restart it as needed. http://www.d ...
- 在vc++上简单搭建环境(包括文件引用)
1,triplet_head.h 文件 #define TRUE 1 #define FALSE 0 #define OK 1 #define ERROR 0 #define OVER_FLOW -2 ...
- TCP 3-Way Handshake (SYN,SYN-ACK,ACK)
http://www.inetdaemon.com/tutorials/internet/tcp/3-way_handshake.shtml
- Linux虚拟机与Windows共享文件
1.找到“虚拟机” >>> “设置” 2.选项 >>> 共享文件夹 >>> 总是启用 >>> 添加,选择你想要共享的文件. 注 ...