Unit / Integration Test
Unit and integration testing is the process of testing portions of a software application, prior to full system testing. Unit and integration testing is an important part of building a robust and error free application, because it allows the tester to more easily stimulate the low-level functionality of the application, and prove that the low-level requirements have been implemented properly.
The VectorCAST tools for unit and integration testing, are available for C and C++ (VectorCAST/C++) and Ada (VectorCAST/Ada). Both tools automate the key activities associated with software testing, including the generation of a complete executable test harnesses, the management of test cases and test results, and the automation of regression testing.
The executable harness generated by the VectorCAST, consists of a test driver, the source file(s) under test, complete stubs for dependent functions, and the source files for any dependent units that are not stubbed. The test harness is data-driven, meaning test data is read by the harness during execution. This approach precludes the need of having to compile and link a new executable harness each time a new test is created.
- To generate test cases to prove that the code is implemented properly. This requires test cases consisting of known input and expected values, to stimulate the functionality of the code under test.
- To prove that the testing has been thorough. This requires tracking code coverage to prove that the test cases that have been run, have resulted in 100% of the underlying application code being executed.
VectorCAST automates both of these tasks, and more importantly, allows for the completely automatic regression testing of your application, over the entire lifecycle.
VectorCAST automates both of these tasks, and more importantly, allows for the completely automatic regression testing of your application, over the entire lifecycle.
Traditionally, unit and integration testing is performed by developers as the code is built. As individual software components are created, test code is generated to take the place of the external interfaces of the code under test. This test code, generally called a test harness, consists of drivers to stimulate the functions of the code being tested, and stubs to take the place of dependent functions that are called by the code being tested.
One of the issues with the traditional approach is that the unit tests will simply test what the code was written to do, rather than what the code was intended to do. Test Driven Development (TDD) aims to solve this problem, by moving test case development earlier in the process to a point after the design is completed, but before the code is written. This allows developers to build the unit tests incrementally while the application code being developed. When the unit tests are built and executed first, they will fail. As the associated application code is developed, the tests will pass. This approach mandates very short development and build cycles and relies on automated regression testing.
The primary difference between using VectorCAST in "Agile Mode" versus "Source Mode" is that for "Agile Mode", no source code files are needed. When you are building a test environment, you simply point to the directory containing the header files that you want to create test cases for, and then choose one or more headers as the Units Under Test. VectorCAST will create the test environment, including empty definitions for the functions defined in the header files chosen. This results in a complete executable test harness that can be run on the host platform, or any embedded development environment. All other features of the VectorCAST tool work exactly the same way that they do in "Source Mode."
There are two goals of unit and integration testing:
Traditional Unit / Integration Test Process
Test Driven Development (TDD) and Agile Process
VectorCAST Supports "Source Mode" or "Agile Mode"
