RKTracer Code Coverage Tool: What It Is and How It Works
RKTracer is an easy-to-use code coverage tool that shows exactly what your tests execute. It’s built for developers, testers, and QA teams working on host machines, simulators/emulators, and embedded targets.
Whether your code runs on a host, server, embedded device, or GPU, RKTracer helps you measure test effectiveness using clear coverage metrics especially valuable for safety-critical and compliance-driven projects.
Why teams choose RKTracer
RKTracer fits into your existing workflow. Prefix your build command with ‘rktracer’ (or enable the IDE plugin), rebuild, run your current tests, and generate reports.
Key features:
- Delta and Modified Line coverage
- Supports many languages: C, C++, CUDA, RUST, C#, Java, Kotlin, JavaScript, TypeScript, Python, Golang, and Swift.
- Works with all compilers and cross-compilers.
- Supports all IDEs and CI/CD tools like Jenkins, Azure DevOps,Gitlab and SonarQube.
- Works on both host systems and embedded or GPU targets (including NVIDIA CUDA for Windows and Linux).
- No need to change your build system—RKTracer auto-detects your compiler and adds everything needed.
- Gives detailed coverage reports.
- Function coverage
- Line and statement coverage
- Branch and decision coverage
- Multiple Condition and MC/DC coverage
Code coverage reports that are easy to read
RKTracer uses color-coded reports:
- Green— fully covered
- Yellow— partially covered
- Red— not covered
Even if a single line has multiple conditions or statements, RKTracer shows exactly which parts were tested and which were not.
RKTracer vs. typical code coverage tools
| Feature | RKTracer | Other Tools |
|---|---|---|
| Easy to use | ✅ Yes | ❌ Complex to set up |
| Compiler support | ✅ All compilers & cross-compilers | ❌ Limited |
| IDE & CI support | ✅ Jenkins, Azure, SonarQube | ❌ Partial support |
| CUDA support | ✅ Full support for host & device code | ❌ No support |
| Automatic runtime library linking | ✅ Yes | ❌ Manual work needed |
| Programming languages supported | ✅ C, C++, CUDA, RUST, C#, Java, Kotlin, JS, GoLang, Swift etc. | ❌ Only a few |
| Types of testing supported | ✅ Unit Tests, Functional Tests, Integration, System Tests. | ❌ Limited |
| Coverage types | ✅ All major types incl. MC/DC | ❌ Basic only |
| Coloring | ✅ In-depth per statement | ❌ Whole-line only |
Simple Setup, No Hassle
RKTracer was built with user feedback and is designed to be fast, light, and easy to set up:
- No environment variables required.
- Doesn’t interfere with other tools on your system.
- No need for extra wrappers or folder changes.
- Works smoothly with modern compiler settings and flags.
- Can be extended to support more languages easily.
How It Works
RKTracer is a code coverage tool that fits into your existing development environment and test workflow from local builds to CI..
Step 1: Integration with Build System
You don’t need to change your build system, source code, or test setup.
- Just enable the plugin in your IDE (like Visual Studio, Eclipse, IAR, CCS, etc.), or
- Add rktracer as a prefix to your make or build command in the terminal
- RKTracer will automatically attach itself to the compiler and linker.
Step 2: Code Instrumentation
When you build your software, RKTracer:
- Takes the preprocessed source files from compiler
- Adds instrumentation code to track what parts of your code are being tested
- Sends the instrumented code to the compiler for final compilation
This happens behind the scenes — no changes are needed in your code manually.
Step 3: Runtime Library Integration
RKTracer also includes a runtime library.
This library:
- Is added automatically during the build
- Works based on your compiler or cross-compiler
- Ensures test data is collected even on embedded devices, simulators, or servers
Step 4: Run Your Tests
Now, run your
- Unit tests
- Integration tests
- Functional tests
- System tests
RKTracer collects test coverage data while tests are running on a host, target device, simulator, or server. It stores this data in a text file.
Step 5: Generate Code Coverage Reports
After running the tests, run ‘rkresults’ command to generate:
- HTML reports – easy to view in a web browser
- XML reports – for CI/CD tools and SonarQube
- Detailed metrics like function coverage, branch coverage, MC/DC, and more
You can also generate delta coverage reports to check if newly added or modified code is tested.
RKTracer capabilities at a glance
- Easy to learn and adopt across teams.
- Collects coverage during unit, integration, functional, system, Docker-based, and cloud test runs.
- It supports multiple programming languages: C, C++, CUDA, Objective-C, C#, Java, Kotlin, JavaScript (ReactJS/NodeJS), TypeScript, Python, Golang, and Swift.
- It automatically adds the runtime library for cross-compilation to the target device or GPU.
- It supports code coverage generation for CUDA on HOST and device (GPU) code.
- It supports all compilers, cross-compilers, embedded targets, microcontrollers, and cloud-based testing or testing applications in Docker.
- supports all build systems and testing frameworks.
- GNU Makefile, Cygwin, Nmake, gmake, QT Makefile,
- Scons
- CMake
- Microsoft Visual Studio CMake
- MinGW CMake
- Nmake CMake
- GNU CMake
- MSBuild C, C++, CUDA and C#
- Dotnet (.NET core)
- Gradle build and NDK build
- Maven builds
- ANT build
- Bazel
- The RKTracer tool plugin for IDEs.
- Microsoft Visual Studio IDE.
- IAR Embedded Workbench IDE
- Greenhill’s Multi IDE
- Code Composer Studio IDE
- Keil uVision/Keil MDK-ARM IDE
- DS-5 ARM IDE
- Simplicity Studio IDE
- Microchip MPLAB IDE
- Renesas e2 Studio IDE
- Android Studio IDE
- Tizen IDE
- Eclipse IDE
- NetBeans IDE
- Detailed code coverage information with different metrics.
- Function Coverage
- Line Coverage
- Green: Full Coverage
- Yellow: Partial Coverage
- Red: Not Covered
- Statement Coverage
- Branch or Decision Coverage
- Condition Coverage
- MC/DC Code Coverage
- Multiple-Condition Code Coverage
- Delta Code Coverage and Coverage for New or Modified Lines of Code
- Plugin for Continuous Integration: Jenkins, Azure DevOps, and SonarQube support.
