Ok, hopefully this helps. Let's take the data extractor that I need to test. Some of the test scenarios I have are:
Test Case #1) Test to make sure the extractor can can connect to a database.
Test Case #2) Test to make sure the appropriate errors are thrown when all needed input isn't provided
Test Case #3) Test to make sure data is pulled from source system correctly.
Each of these test cases use common functionality like connecting to a database or unzipping the software before the test begins. I have put this common functionality in "modules".
When my program starts a form is displayed which asks the user which test cases they want to run. After this is done, i want to launch each test case.
My question is should I put the code that performs each test case in a class file, a module file, or something else?:
==========================
Public Class Extractor_TestCase_1
'Insert Code
End Class
and call it like:
Dim myTest as New Extractor_TestCase_1
MyTest.SomeSubOrFunction
or
Module Extractor_TestCase_1
'Insert Code
End Module
and call it like:
Extractor_TestCase_1.SomeS
==========================
I guess I'm just confused on when I should put code in a module vs. class vs. something else. I've heard that common functionality should be placed in a module, but since all of my test cases are unique, I'm not sure if this is the proper place. When I think about putting it in a class, it doesn't seem right to place it here either.
How would you approach this?
Main Topics
Browse All Topics





by: TheLearnedOnePosted on 2009-04-10 at 03:14:51ID: 24114387
That is a great question, but I don't have a specific answer, because like shell scripting, this is kind of a "loose question" without a lot of detail. I would love to help you, so could you give me a little more detail so that I might give you suggestions?