background image
<< Part 4. Testing COM Components | Requirements for Testing COM Components >>
<< Part 4. Testing COM Components | Requirements for Testing COM Components >>

Testing with Iterative Development

100
Chapter 4 - Testing COM Components
For more information about testing completed COM components, see the topic
Importing Type Libraries Into the Model in the Rose Help.
Testing with Iterative Development
To test iteratively, you can use the Update Code feature of Rose to create new classes
for your component and then round-trip the code that you add to these classes into
the model as you develop.
When you are ready to test, you import the type library for your component and then
model the transactions in interaction diagrams using the interfaces imported from the
type library.
When you change your code, either by updating it from the model or directly, you
simply refresh the type library information in the model by re-importing it.
Programming in Visual Basic
When you program in Visual Basic, VB masks the complexity of dealing with
interfaces and coclasses. You use the class name both to instantiate objects and to call
methods on those objects. VB creates a hidden interface, using your class name
preceded by a leading underscore character.
QualityArchitect treats each test script generated for COM as a Visual Basic project.
Each project consists of several files, as follows:
s
test
.vbp ­ The project file. This is what you open in Visual Basic.
s
test
.bas ­ The main program that calls the test script program in the .cls file. Visual
Basic requires a main program to begin execution.
s
test
.cls ­ The actual test script.
s
test
.res ­ A standard Visual Basic resource file used to store datapool configuration
information. This file is required in order to run test scripts from TestManager and
can be edited with the Visual Basic 6 resource file editor add-in.
Note:
A temporary
test
.rc file is also generated and converted to
test
.res by the
resource compiler.
Every time you generate a unit test or a scenario test, QualityArchitect uses templates
to produce these files.