In black box automation testing of an accounting app which uses live feeds of foreign exchange rates for transactions, I would like to be able to record those exchange rates used to be able to assert calculations are correct.

Are there any best practices or techniques applicable to this scenario which can help with ensuring data integrity in testing?


If I understand correctly, the only thing that makes this scenario a challenge is the use of the "live feed".

Thus, stub out the live feed. Replace it with your own "non-live feed" and you end up with predictable states where your expected calculation results are truly predictable.

Your "non-live feed" can be generated by hand, or if you are automating your testing, it could be generated by the same script which verifies your calculations.


I would add to an answer from Joe that you may randomize data that you send to an app from the live feed stub. With this technique you may be able to find bugs that would not be found if you only used the same data all over again.


I would guess that the app uses log files ( if not ask for them) or records the exchange rate somewhere for auditing


I would hope since this is a financial application there is some sort of auditing you could utilize. If not I would ask to see if it could be injected into the app if you can't control the feed in some manner.

You should be able to determine what the selected or triggered price was. You can use the total transaction value against the quantity to see if it the price used to execute matches. It also might be worth doing some digging to be sure they are using the right ticker and quote for a given transaction. IE converting from a dollar to euro is a different price than a euro to a dollar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.