On Host and on Target

 

Unit Testing

 
 
 

​Unit testing, whether on a host machine or on the target hardware, is a fundamental aspect of software quality assurance. When using tools like VectorCAST, the process can be streamlined and made more efficient.

Host Testing

​The first place where software is tested during development is the host environment. The advantages of host testing are immediate availability, fast execution and the ability to work in rapid iterations during the development phase. It is common practice to start with the test activities when not all the required dependencies are available. Missing parts must be replaced temporarily. This is done with stubs.

 

Stubbing/Stub-By-Function (SBF)

​A stub is a piece of source code that replaces another piece. The stub can simulate existing functions or serve as a placeholder for code yet to be developed. In unit testing stubs enable precise control over the return values of functions that are called from the tested code.
​When a test environment is built, stubs for all required functions can automatically be created. These stubs can be enabled, disabled or adapted according to your needs. Even dependencies inside of the unit under test can be stubbed.
​This allows for efficient and early testing with full control over the unit under test.

​During the testing activities, there can be cases, when stubs are not sufficient to reach all sections of the code. 
This is where probe points are useful.

Probe Points

​With probe points, it is possible to insert additional code at any point in the unit under test. Unlike stubs, probe points do not replace an existing function. Furthermore, they allow to change values of variables and inject faults in places that are otherwise inaccessible. This enables the complete checking of code for error handling, which can otherwise only be covered with considerable effort.

​​VectorCAST supports stubbing-by-function of all instantiations, explicit or implicit, of each template function or member of a template class. These stubs are automatically generated during setup of the test environments, and they can be manually added and configured for each test case. In addition to stubs, VectorCAST can insert probe points into the code under test and provides additional functions to control the behaviour of the injected code.

Target Testing

​Testing on the target system is preferable to testing on the host because it provides a more accurate representation of how the software will perform in real-world conditions, considering the specific characteristics of the target environment. The most obvious difference, especially for embedded systems, is the used compiler. Testing solely on the host system may not reveal issues that could arise in the actual deployment environment. Hence, it is common practice to start testing on the target as soon as possible.

​With VectorCAST, running tests on the target is just as easy as on the host. The test cases can be developed in the host environment and then executed on the target. VectorCAST provides runtime support packages (RSP) for many cross-compilers and real-time operating systems (RTOS).

Ensure Software Quality with VectorCAST

Improve and optimise quality assurance with VectorCAST, resulting in significantly improved efficiency and overall software quality.

Connect with Our Experts

Whether you're seeking advice, looking for solutions, or just curious about our services, we're here to help.
Our team of experienced developers is here to provide the support, and technical expertise you need. Contact us to schedule your consultation and start your journey with us. 

Subscribe To Our Newsletter

Are you passionate about software development?
Want to stay updated with the latest, tools, and best practices we offer?

Join our community by subscribing today!