I’m developing a Java Web Application that runs a series of financial calculations for a user. When a financial calculation is run, roughly 30 different inputs are used to calculate 15 different values over a maximum of 18 years (max 15*18 expected values). As you can tell, there is a considerable amount of information to compute and validate.
What I am looking for is advice on how to prepare test data (simulate the 30 different inputs), load it into a series of objects, and run the objects through the calculator to generate the output which can then be compared to expected values.
I have attempted to stub a database, but this ended up taking forever. Mocking everything seems like it would be just as tedious. I’d like to avoid external database dependencies if possible.
If you have data in Db and you just want to create a test data out of it so that your Tests run are not dependent on external db.You can have a look at DbUnit framework and can populate sample data in XML from DB.
These XML’s you can use for Testing purpose ,these XMLs can easily be converted into say java objects by number of commanly available parsers.