SCRIPTING TOOLS
15.2 SCRIPTING TOOLS
15.2.1 CppTest
CppUnit is a unit-testing framework for the C++ programming language, described as
a C++ port for JUnit. The library can be compiled for a variety of portable operating systems interface (POSIX) platforms, allowing unit testing of “C” sources as well as C++ with minimal source modifications.
15.2 SCRIPTING TOOLS 335
CppTest
Source Freeware Web page
http://sourceforge.net/apps/mediawiki/cppunit/index.php? title=Main_Page
Access Open source Target language(s)
C++ Life cycle phase
Unit testing Test phase
Test driver design and execution
Test scripts are written in the syntax of a C++ class and include specialized test_add() statements, where each test_add() statement refers to separately defined routines that invoke tests in the form of logical assertions. Each such a routine
is declared as a void C++ method that includes assertions of the form TEST_
ASSERT(), which takes logical assertions as parameters. Using these statements and structures, the tester can define arbitrarily complex test scripts.
In order to run a test script, the user has to define an output handler, which records and organizes the output produced by the TEST_ASSERT() statements; a number of
formats are available, including a text format, that may be shipped to the stdout
stream and an html format, among others. Among the strengths of CppTest, we cite that it puts the power of C++ at the dis- posal of the tester, to define arbitrarily sophisticated test scripts; in particular, the tester may use the exception-handling mechanisms of C++ in conjunction with the assert statements of CppUnit to handle any exceptions that may arise during the test in a controlled manner.
15.2.2 SilkTest
SilkTest is a suite of related test tools that offer a range of interrelated functionalities, including the following:
• SilkTest Classic, which uses a domain-specific scripting language inspired from
C to support the development of test scripts. • Silk4J, which uses Java as a scripting language to support the derivation of test scripts in Eclipse. • Silk4Net, which uses Visual Basic or C# as a scripting language to support the derivation of test scripts in Visual Studio. • SilkTest Workbench, which uses VB.NET as a scripting language to support test automation.
336 SOFTWARE TESTING TOOLS
SilkTest
Source Borland Software Web page
http://www.borland.com/products/silktest/ Access
Commercial
Target language(s) Java, visual basic (VB), C# Life cycle phase
System-level
Test phase Test management
In order to operate SilkTest, we open a new project, give it a name, associate the project name to the application we want to test (possibly a web-based application), con- figure SilkTest to a particular browser, then record the sequence of tests we want to run. This sequence of tests defines the test script; once this script is saved, it can be run by merely calling the project name and invoking its execution, possibly unattended.
Among the strengths of this tool, we cite its ability to support integrated testing of graphical user interface (GUI) applications, its ease of use (notably that it does not require any programming knowledge, hence can be operated by the end user of the application), and the availability of test templates that provide standard test frameworks. Silk has two drawbacks: first, it can only support two browsers, namely, Internet Explorer (© Microsoft) and Firefox (© Mozilla). Also, it does not support migration between the two browsers, that is, a script composed on one browser cannot be run on the other.
SilkTest can be seen as a scripting tool but can also be seen as a save-and-replay tool, to the extent that it stores tests by recording an interactive session on the web- based application. The tools of the next section fall exclusively in the latter category.