利率计算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)就是利用各种语法特性来逃避正则(当然要保证语法正确性 ...
随机推荐
- .NET 命令行参数包含应用程序路径吗?
如果你关注过命令行参数,也许发现有时你会在命令行参数的第一个参数中中看到应用程序的路径,有时又不会.那么什么情况下有路径呢? 其实是否有路径只是取决于获取命令行参数的时候用的是什么方法.而这是 Win ...
- UT源码+105032014070
设计三角形问题的程序 输入三个整数a.b.c,分别作为三角形的三条边,现通过程序判断由三条边构成的三角形的类型为等边三角形.等腰三角形.一般三角形(特殊的还有直角三角形),以及不构成三角形.(等腰直角 ...
- POI2014题解
POI2014题解 [BZOJ3521][Poi2014]Salad Bar 把p当作\(1\),把j当作\(-1\),然后做一遍前缀和. 一个合法区间\([l,r]\)要满足条件就需要满足所有前缀和 ...
- 提高ASP.NET页面载入速度的方法
前言 本文是我对ASP.NET页面载入速度提高的一些做法,这些做法分为以下部分: 目录 1.采用 HTTP Module 控制页面的生命周期. 2.自定义Response.Filter得到输出流str ...
- 由spring的工厂构造bean想到的
被Spring管理的bean可以是直接创建实例,还可以通过工厂模式来进行创建.例如brave的tracing bean定义: <bean id="tracing" class ...
- linq to sql 怎么查询前 11 条数据
(from 新表 in db.books where 新表.bookid < 400 select 新表).Take(11); storeDB.Albums.OrderByDescending( ...
- Accept Job Offer Email Template
Accept Job Offer Email Template <Date> <Hiring Manager’s name> <Company name> < ...
- Python格式化输出%s和%d
python print格式化输出. 1. 打印字符串 print ("His name is %s"%("Aviad")) 效果: 2.打印整数 print ...
- Shell中单引号、双引号、反引号、反斜杠的区别
1. 单引号 ( '' ) # grep Susan phonebook Susan Goldberg -- Susan Topple -- 如果我们想查找的是Susan Goldberg,不能直接使 ...
- UDP协议发包的使用(DatagramSocket、DatagramPacket)
1.UDP 是User Datagram Protocol的简称, 中文名是用户数据报协议,是OSI(Open System Interconnection,开放式系统互联) 参考模型中一种无连接的传 ...