Greetings Monks,
I am currently writing a banking module to account details from an online bank account and, like a good monk, I am writing unit tests to ensure that my code is sane. However this has led me to a problem - obviously to test the basic functionality (e.g. getting my account balance) I need to put in my secure banking details. At the moment I have hardcoded this into the test but I want to move away from this since it could mean that I accidentally bundle up my account number etc and then post it on CPAN...
My alternatives appear to be:
1) Set environment variables with my secure information and access these from my test - so there's no danger of the info appearing on CPAN.
2) Emulate the bank's server using some kind of mock object and then just use dummy account info etc. This would mean that the tests could be run on anyone's system. However if the bank's interface changes then I would miss it, because my test would still pass.
3) Somehow run interactive tests to prompt the user for info. This feels like "bad form"...
Any opinions or tips gratefully received.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.