A Comprehensive Offline Unit Testing and Code Coverage Tool for C and C++
Unlock the true potential of embedded software quality with RKTracer tool. As a unit testing, integration testing and code coverage tool, RKTracer ensures reliable and error-free software deployments. Explore the benefits, features, and best practices to elevate your software development lifecycle.
RKTracer Tool
RKTracer is an offline software testing automation tool designed for unit testing, integration testing, and code coverage analysis of both embedded and enterprise applications. Developed by RKValidate Software, its main objective is to save developers time, effort, and money by generating automated unit and integration tests, tailored especially for applications written in C and C++.
Capabilities of the RKTracer
Advantages
User Interface for Generating Unit Tests
The RKTracer UI showcases a hierarchical project layout. The left side displays a list of source files and their respective functions. On the right, users can find detailed information about each function, including parameters, initialization processes, mocking, stubbing, and more.
- Generating test cases for selected functions.
- Creating parameterized test cases for functions or member functions based on user-defined input values, expected outputs, assert checks, or boundary conditions.
- Generating stubs for missing function definitions.
- Testing private, protected, and file static functions without altering the application code.
- Full customization of the auto-generated unit test cases, with the flexibility to run them independently of RKTracer on either the host platform or target device.
How does it work?
1. Integration
Integrate RKTracer with your preferred Integrated Development Environment (IDE) such as IAR Embedded Workbench, Eclipse, Keil μVision, Visual Studio, and more. RKTracer offers plug-ins for smooth integration into your workflow. For command-line users, RKTracer can be easily integrated with your build settings.
2. Configuration
Simply turn ON RKTracer. The tool automatically recognizes the compiler or cross-compiler from your build system and adds the necessary runtime libraries. This makes the configuration process straightforward, supporting both host and target testing environments.
3. Generation and Execution
RKTracer will generate unit test cases using frameworks like Google Test or Unity. Here’s how it works:
- Test Case Generation: RKTracer scans your source files (e.g.,
simple.cpp
) and generates corresponding unit test cases (e.g.,simple_rk_test.cpp
). These files include all necessary dependencies, stubs, and mocks. - Adding to Project: The generated test files are saved in your local project directory but are not automatically added to your build system. You must manually add these test files to your project to execute them.
- Customization: If your project includes static or private functions, RKTracer generates wrappers, which can be seen in the test files. Comments in the generated test file highlight the sections where wrappers are created for specific functions.
- Test Execution: After adding the test files to your project build system, you can run these unit test cases to validate the functionality.
4. Code Coverage Reports
After running the tests, generate detailed code coverage reports with a single click. RKTracer provides coverage analysis for both host and target machine testing, giving you comprehensive insight into your application’s performance.
By following these steps, you can efficiently use RKTracer to generate unit tests and code coverage reports, ensuring a thorough verification of your application.