Click here to Skip to main content
15,400,295 members

Comments by Gebbetje (Top 11 by date)

Gebbetje 8-Feb-11 4:08am View
   
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.
Gebbetje 4-Feb-11 4:48am View
   
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.
Gebbetje 3-Feb-11 5:33am View
   
I will. Thx.
Gebbetje 2-Feb-11 9:52am View
   
The first link is interesting (as I already mentioned). It shows how to use a database as input for testing. Thanks for that. The database is used for input of (single) parameter values.
The second link has more the testing of a database and the methods to access the database as a focus.
The third link shows a decent number of articles that explain the basics of unit testing in Visual Studio.
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?
Gebbetje 27-Jan-11 6:21am View
   
"Code Coverage" doesn't seem to be included in Visual Studio 2008 Professional. Pity.
Gebbetje 27-Jan-11 6:11am View
   
I'm reading throught the 1st link. Under "Adding a Test Database" adding a database file to the project is not working, I'm afraid. I can add a SQL Server compact database, but can't access it from my test project. Any clues? (I do like to keep the database file with my test project.) (I could add a database to SQL Server and put the files in the directory of my test project.)
Gebbetje 26-Jan-11 6:38am View
   
I'm not sure if you receive an e-mail when I post my reply to your post as an answer (number 6) as I did.
Gebbetje 26-Jan-11 6:36am View
   
Thank you Sandeep.

Your 1st link looks interesting. One question though: the article (and the 2nd as well) talks about Visual Studio Team System 2005 and I have Visual Studio 2008 Professional. Is this applicable to Visual Studio 2008 Professional?

(What I forgot to mention in my initial post is that I extensively googled on this subject, but did not find any thing comprehensible and applicable to large datasets.)
Edit: corrected the name into Visual Studio Team System 2005.
Gebbetje 21-Jan-11 11:39am View
   
FYI: When trying to implement the Clone function I run into the error message: "'Me' cannot be the target of an assignment.", when trying to use it (in the constructor of the Fund class).

Public Sub New(ByVal copyOf As Fund)
Me = Clone(copyOf)
End Sub
Gebbetje 21-Jan-11 10:02am View
   
Thanks again.I'm afraid I need read/write properties.

"However, if you do need read/write properties, then make them so but still pass in a copy to AddFund. Say:
AddFund(New Fund(fund))"
I'll give it ago.
Gebbetje 21-Jan-11 8:56am View
   
Thank you both (Espen Harlinn & gazzasmith). But (a probably very basic question) how to solve it?
Do I have to change my 'Portfolio.AddFund' to copy the contents of 'fundToAdd' when adding it to '_funds' or is there a simpler solution?