Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
I'm looking for a good reference (to a webpage or book) on testing in Visual Studio with large datasets (with the native unit testing tools in Visual Studio). (I've got Visual Studio 2008 Professional.)

There are some articles on the internet on using a database as input for testing. Only the database in that case is used for input of (single) parameter values. My project though involves methods that do calculations on long time series (of mutual fund returns) that need at least 36 months of returns for multiple mutual funds. What I'm looking for is a tutorial on how to test this project (using one or a couple of fixed data sets).

Any references?
Posted
Updated 2-Feb-11 22:44pm
v2
Comments
wizardzz 3-Feb-11 14:25pm    
I'm not exactly sure what you mean by testing the project?

It seems like you are trying to "test" the project instead of just running it. Why can't you just run it through that method with the large data set?
Gebbetje 4-Feb-11 4:48am    
Hi wizardzz,
I'd like to (unit) test my project. If I run / debug it, and change code later, I'd like to be 100% sure that no other code breaks due to my changing some (other) part of the code.

1 solution

How large is the testing dataset? Must you test every single peice of data in the DB? Typically you should be able to create some test cases based on certain scenarios and not have to do a full regression test.

What does the function signature look like? Are you able to create a wrapper function that plugs the data from the db to the function that processes it? If you do this, could you just unit test the wrapper function? I'm thinking the database / large dataset aspect does not have to be managed by your test, but rather a function?
 
Share this answer
 
Comments
Gebbetje 8-Feb-11 4:08am    
Thanks for your reply wizardzz and apologies for my late response.

>How large is the testing dataset?
The testing dataset should at least consist of 5 (mutual funds) x 60 (monthly returns) = 300 records. I would need a couple of those to be able to check different methods.

>Must you test every single peice of data in the DB? Typically you should be able to create
>some test cases based on certain scenarios and not have to do a full regression test.
I would need the full datasets (most of them consisting of 300 records) for testing purposes. Some tests though can use smaller datasets.


>What does the function signature look like? Are you able to create a wrapper
>function that plugs the data from the db to the function that processes it?
>If you do this, could you just unit test the wrapper function?
I'm using a DAL (Data Access Layer) to fill my objects, so it should be possible to create a wrapper that plugs the data, although that's something that I'm trying to prevent because I would have to write extra code (that could of its own contain bugs). Could such a setup not be better be implemented with mock objects / mocking? The problem with mock objects to my knowledge is that I would have to type in the data (in stead of reading them from a database).

>I'm thinking the database / large dataset aspect does not have to be managed by your test,
>but rather a function?
I'm not sure if I completely understand this point.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900