Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Mathematical testing

1. ## Mathematical testing

Has anyone done any work in testing mathematical functions?

I am currently working in a financial institution doing what is essentially quantitative analysis on financial trades with durations of up to 30 years and values of up to and beyond 1,000,000,000 USD.

Calculations performed can take over a week to complete for one day's trading.

I have noticed that the Quantitative Analysis process within the financial community does not have as solid a QA structure as say IT functional testing.

Part of the reason for this is that tolerances are often used rather than fixed repeatable outputs. Use of random seeds in calculations means that the numbers coming out can be Completely different ad yet ALSO correct!

How do you test for this properly without getting in and doing the maths yourself?

We are using techniques such as seed fixing and representative trades, but this still does not necessarily result in repeatable numebrs. Also it does not fully exercise the calc engine because it is supposed to continually reference random seeds in the calcs.

How do you successfuly test for this with the same confidence as with say GUI functional testing?

regards,
Martin

2. ## Re: Mathematical testing

Has anyone had any reasonable ideas on this?

3. ## Re: Mathematical testing

Apart from suggesting feeding in actual as opposed to randon numbers wherever these are used, I can't help.
However, I would have thought similar problems would arise in much game software testing - have you tried contacting any games software houses to see how they do it?

5. ## Re: Mathematical testing

Thanks for that!

THe crux of the issue is that this is a credit system which is required to do simulations of potential changes, of daily interest rates for example, over extremely long timescales 30 years or more. This can involve generation of interest rates based upon calculations referencing random seeds. And these generations can be performed up to 1,000,000 times to produce one set of ranges for each trade.

As a result, a run of this system can take between 4 hours and 2 weeks depending upon the level of complexity required.

The mathematics experts here are able to look at the equations used and declare them correct. Running the system produces roughly different numbers every single time. EVEN WITH THE RANDOM SEED FIXED TO ONE!

At the end of the day I am going to need to include a results statement to the effect that the results are correct to a certain accepted tolerance level.

Unit and some system testing will give good accurate numbers to base a result, but there is no way to fix an expected result for an end to end test. Therefore it looks like this:

Fixed input + fixed Input + Run of System = ???

where ??? is the correct answer.

6. ## Re: Mathematical testing

It sounds like a very difficult project to test in a traditional sense. I've tested applications that use complex formulae but these tend to produce the same results with the same set of inputs.

Are you (or a domain expert) able to approximate the expected output for a given set of inputs? Your maths experts may be able to advise on this.

Normally in the absence of expected data I would suggest domain experts review the outcomes for the set of inputs and assess whether the results are accurate/expected/reasonable.

For applications that use complex mathematics I also strongly advise code-reviews and walkthroughs.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:29 PM.

Copyright BetaSoft Inc.