利率计算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)

 

单利/复利

选择

插入 字符串 选择
"compound" /"single"

复利

计算

本金:(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--测试--软件工程的更多相关文章

  1. 利率计算v5.0--结对--软件工程

    利率计算v5.--测试--软件工程 1.任务结对同伴: 名字:王昕明 学号: 博客地址 :http://home.cnblogs.com/u/xinmingwang/ Git : https://gi ...

  2. 利率计算v2.0--web版--软件工程

    .客户说:帮我开发一个复利计算软件. .如果按照单利计算,本息又是多少呢? .假如30年之后要筹措到300万元的养老金,平均的年回报率是3%,那么,现在必须投入的本金是多少呢? .利率这么低,复利计算 ...

  3. 复利计算--4.0 单元测试之JAVA版-软件工程

    复利计算--4.0 单元测试-软件工程 前言:由于本人之前做的是C语言版的复利计算,所以为了更好地学习单元测试,于是将C语言版的复利计算修改为JAVA版的. 一.主要的功能需求细分: 1.本金为100 ...

  4. <更新日期03-31-2016> 复利计算5.0 <已改进>

    作业要求: 1.客户说:帮我开发一个复利计算软件. 完成复利公式计算程序,并成功PUSH到github上. 客户提出: 2.如果按照单利计算,本息又是多少呢? 3.假如30年之后要筹措到300万元的养 ...

  5. 没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限 的解决方案

    问题情况: 在64位机器上运行Web服务,然后在配置好之后测试访问的时候出现如下提示:

  6. 在 Ubuntu 14.04/15.04 上配置 Node JS v4.0.0

    大家好,Node.JS 4.0 发布了,这个流行的服务器端 JS 平台合并了 Node.js 和 io.js 的代码,4.0 版就是这两个项目结合的产物——现在合并为一个代码库.这次最主要的变化是 N ...

  7. [Bug]没有对“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”的写访问权限

    问题 环境WIN8.1 x64,新安装的vs与iis,在部署网站时,出现该异常信息.本地机作为测试机,就部署一个站点进行测试,没想到出现这个错误. 解决方案 如果你访问上面的那个路径,你会发现并没有那 ...

  8. 小蔡计算器 V4.0新版全新发布上线啦~欢迎大家下载使用哈~

    小蔡计算器4.0新版全新发布上线啦~欢迎大家下载使用哦~ 立即下载:http://www.zhentiyuan.com/windows/index.aspx 软件介绍:小蔡计算器4.0是一款界面优美的 ...

  9. 最新安全狗 apache v4.0 sql注入 bypass

    前言 最近没事学习一下 waf 的 bypass , 本文介绍下 bypass 安全狗的笔记.个人感觉 bypass 的总思路(正则匹配型 waf)就是利用各种语法特性来逃避正则(当然要保证语法正确性 ...

随机推荐

  1. 深入php redis pconnect

    深入php redis pconnect pconnect是phpredis中用于client连接server的api. API文档中的一句原文: The connection will not be ...

  2. 将 UWP 中 CommandBar 的展开方向改为向下展开

    在 UWP 中使用 CommandBar 来迅速添加一组功能按钮是非常迅速的,是 UWP 中推荐的交互方案之一.也许你能见到 CommandBar 按你所需向下展开,不过可能更多数情况会看到 Comm ...

  3. 使用bit管理npm包

    npm 包给共享,团队写作有好多问题需要解决,类似的解决方案有lerna yarn 使用monorepo,bit 官方有相关的比较 以下只说明如何进行简单的项目使用 网站 https://bitsrc ...

  4. Scriptcase v8推出内部測试版及价格调整

    PHP代码生成器Scriptcase如今已经内部推出了v8.0版本号,8.0相比于曾经的版本号做了大幅度调整.我们将在完好測试的基础上发表8.0的相关文章. 另,即日起,Scriptcase的20%优 ...

  5. 32位C#程序连接64位ORACLE数据库

    VS2008 生成32位程序,安装在64位服务器上,调用System.data.oracleclient            oracleConn = new OracleConnection(); ...

  6. Tcl 和 Raft 发明人的软件设计哲学

    John Ousterhout(斯坦福大学教授,Tcl 语言.Raft 协议的发明人...真的是超级牛人,Title 好多好多,这里就列几个大家熟悉的),在 Google 做了一次演讲,题目就叫 「A ...

  7. nginx 自签名证书 配置 https

    最近在研究nginx,整好遇到一个需求就是希望服务器与客户端之间传输内容是加密的,防止中间监听泄露信息,但是去证书服务商那边申请证书又不合算,因为访问服务器的都是内部人士,所以自己给自己颁发证书,忽略 ...

  8. 手淘flexible.js框架使用和源代码讲解

    手淘框架是一个用来适配移动端的js框架,下面我们来讲解一下如何使用手淘的这套框架. 其实手淘框架的核心原理就是根据不同的width给网页中html跟节点设置不同的font-size,然后所有的距离大小 ...

  9. mac php apache mysql 集成环境 的软件

    http://xclient.info/s/mamp-pro.html?t=4e60e3c234937f46b33e6b15eeafeb5ee326afa4 MAMP Pro 5.1 集成web服务器 ...

  10. beautifulsoup 基本语法

    案例一: #coding=utf-8import jsonimport requestsfrom bs4 import BeautifulSoupurl = 'http://www.itest.inf ...