Testwell CTA++ / Integration to Visual Studio
(This integration is available both for Visual
Studio 6.0 IDE and Visual Studio .NET 2003 IDE)
What is CTA++/VSI
When CTA++ is
used on a Windows platform with Visual C++ the use of CTA++
is significantly eased with an add-on component called CTA++/Visual
Studio Integration (CTA++/VSI).
It provides a wizard helping the use of CTA++.
The actual testing (what to test, with what kind of test cases,
what are the expected results of the test runs, etc.) is as
difficult and challenging as it has always been. CTA++/VSI helps
you to concentrate on the "intelligence part" of the testing.
The wizard does much of the test bed building for you. CTA++/VSI
facilitates:
- Generating portions of the test bed and setting up its
infrastructure into a Visual Studio project
- Allowing you to edit in the "intelligence logic" of the
tests straight in the Visual Studio environment using its
source editor
- Running and debugging the test bed straight in the Visual
Studio environment and capturing the test results
- Viewing the test result in textual and HTML format straight
from the Visual Studio
- Should you need to use a code coverage tool, the Testwell
CTC++, Test Coverage Analyzer for C/C++, is just a few mouse
clicks away (see more CTC++ integration
to Visual Studio).
Using CTA++/VSI, the starting point
Here we show one CTA++/VSI use scenario. We have
somewhere the files
- list.h (the interface of the
code under test, contains a couple of classes)
- list_bug.cpp (the implementation
file of the code under test, contains some bugs)
- memory.h (an interface of
a couple of functions that are called from list_bug.cpp)
First we create a new Visual Studio project (here
vsList, a Win32 Console Application) and add these files to
the project. The code under test (list_bug.cpp) compiles as
such. The following screenshots show also the file list.cpp.
In this demo it is the non-buggy version of the code under test.
It is also added to the project but excluded from the project
build.
CTA++/VSI Settings
Then we take the CTA++/VSI into play. We adjust
the project settings (for example add the necessary CTA++ run-time
library to the project) so that the project could be a CTA++
test bed project. It is done by clicking the "Tw" button, where
the test bed type is selected (the CTA++ run-time library variant
needs to be selected according to the other settings of the
project, whether old or new streams are used, etc.)
CTA++/VSI Generate
Next we use CTA++/VSI to generate the test bed
main program, some test cases to it and the stubs based on the
memory.h file. Again the "Tw" button is clicked and the "Generate"
tab is selected. The usage looks as follows:
We use this pane a couple of times:
- To generate the initial test driver (the file CTA_vsList_drv.cpp,
which gets added to the project)
- To generate the test case functions (their skeletons)
to the test driver file
- To generate the test data file (CTA_vsList_drv.dat, its
skeleton)
- To generate the stubs file (CTA_memory.h_stb.inc)
The actual "testing intelligence" is edited to these files by
the tester using the Visual Studio IDE's source editor.
The test bed is compiled and linked as usual by Visual Studio.
CTA++/VSI Run
Once we have edited some desired "intelligence
logic" into the generated test case functions and stubs, and
once the test bed is compiled, we are ready to run the test
bed. It is done as follows:
The above "Run" pane is effectively just a GUI
wrapper for running the testbed.exe program straight from the
command line. The fields in the "Run" pane correspond to the
command-line options of the test bed executable. The test
bed can be run and debugged by normal Visual Studio means, too.
CTA++/VSI Report
After some test bed runs, the test results can
be viewed. The trace file, here CTA_vsList_trc.txt, can be seen
directly in the Visual Studio GUI. There is also a "Report"
tab for seeing the HTML representation of the trace file and
for some other operations on it. The "Report" tab looks as follows:
When an HTML report is asked, the resultant HTML
view of the test bed run can be seen here.
In this use scenario the code under test and the
test driver code were compiled and linked to one program, to
the test bed. A typical use scenario is also a situtation, where
the code under test is in a separate .DLL and the test
bed project/the test bed executable is the "test execution engine"
for testing the .DLL.
In summary, CTA++ integration to Visual Studio
provides a very easy-to-use way to build CTA++ test beds in
the Visual Studio environment.