[ 
http://mifosforge.jira.com/browse/MIFOS-3635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60224#action_60224
 ] 

keithwoodlock commented on MIFOS-3635:
--------------------------------------

The integration test SavingsIntCalcHelperIntegrationTest executes one test 
which tests the batch job helper class responsible for kicking off interest 
calculation.

Call hierarchy is 
SavingsIntCalcHelper.execute->SavingsBO.updateInterestAccrued->calculateInterest

The line coverage ofprivate method calculateInterest is 67%. It only tests the 
situation where getActivationDate().equals(fromDate).

however SavingsBOIntegerationTest has a host of tests that check interest 
calculation for various transactions and date ranges.
It gets 87% line coverage on calculateInterest

It doesn't handle case of

if (trxn == null || 
trxn.getAccountAction().equals(AccountActionTypes.SAVINGS_ADJUSTMENT)) {
                    final List<AccountTrxnEntity> transactions = 
this.getAccountTrxnsOrderByTrxnCreationDate();

                    if (transactions != null && !transactions.isEmpty()) {
                        trxn = (SavingsTrxnDetailEntity) 
transactions.get(transactions.size() - 1);
                        initialBalance = true;
                    }
}

we should add test to ensure this is covered.

NOTE: this is only line coverage and theres probably situations missing also.

In general, it may not be the best strategy to use Trxns for interest 
calculation algorithm.

the area in general requires simplification

> Savings Calculation Work: get test coverage for interest calculation 
> including with adjustments
> -----------------------------------------------------------------------------------------------
>
>                 Key: MIFOS-3635
>                 URL: http://mifosforge.jira.com/browse/MIFOS-3635
>             Project: mifos
>          Issue Type: Story
>          Components: Savings Account
>    Affects Versions: Release 1.6.0
>            Reporter: Van Mittal-Henkle
>            Assignee: Udai Gupta
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to