Coverage instrumentation

Coverage instrumentation tells Antithesis which lines of code are reached over the course of testing. Having coverage callbacks at every basic block in the program’s control flow enables the Antithesis platform to test your program more effectively.

For some languages, instrumentation is required to define test properties, consult the language-specific documentation for more details.

When you instrument your code, you may need to install additional runtime dependencies into your containers, but the benefits are well worth it.

Coverage instrumentation has a higher overhead than other SDK functions. We do not recommend running binaries with coverage instrumentation in production.

Benefits of instrumentation

When run in Antithesis, instrumentation provides the following benefits,

  • Instrumentation sends continuous feedback to Antithesis, which enables it to find bugs faster and more reliably.
  • Instrumentation enables a powerful fault-injection technique called thread pausing which is useful for finding subtle race conditions and other concurrency bugs.
  • Instrumentation provides much richer data to the bug report, allowing us to automatically discover which lines of code were most and least associated with the bug.

Supported languages

The following is a list of languages that are supported for instrumentation.

If your language is not on this list, it may still be possible to enable instrumentation. For more details, contact us at support@antithesis.com or ask on our Discord.

Symbolization

Symbolization is the process of translating between locations in your compiled code and locations in your source files. For some languages, Antithesis handles all of this automatically. For other languages, you might need to compile with specific flags, or have your build/CI system put symbol files into a specific location in order for symbolization to work.

If your code includes coverage instrumentation (whether from an Antithesis instrumentor or the language compiler) Antithesis expects to find symbol files, so if it doesn’t find any, it will report a failing property in the triage report under the “No Antithesis session errors” group to remind you to add them.

Please consult the language-specific documentation for detailed instructions on enabling symbolization.

Symbols are placed in the image containing the instrumented software. Antithesis will search the root of every container image you push for a directory named /symbols and automatically extract any symbol files it finds there. When searching for symbol files, Antithesis will follow symlinks, so you can place a symlink in the /symbols directory instead of a symbol file, which you might want to do if, for instance, your symbols are normally part of the same binary as your code.

Validation

You can confirm that the instrumentation process worked correctly by looking at your triage report.

Under the Setup property group, there is a default property called Software was instrumented. If this property is passing, then your code was instrumented successfully and we were able to symbolize it as well. Each example listed under this property is a different binary, program, or module that was successfully instrumented. The details section for the examples will list the name of the module and the number of locations within it that were instrumented.

  • Introduction
  • How Antithesis works
  • Using Antithesis documentation with AI
  • Get started
  • Test an example system
  • With Docker Compose
  • Build and run an etcd cluster
  • Meet the Test Composer
  • With Kubernetes
  • Build and run an etcd cluster
  • Meet the Test Composer
  • Setup guide
  • For Docker Compose users
  • For Kubernetes users
  • Product
  • Test Composer
  • Test Composer basics
  • Test Composer commands
  • How to check test templates locally
  • How to port tests to Antithesis
  • Test launchers
  • Reports
  • The triage reports
  • Findings
  • Environment
  • Utilization
  • Properties
  • The bug reports
  • Context, Instance, & Logs
  • Bug likelihood over time
  • Logs Explorer & multiverse map
  • Multiverse debugging
  • Overview
  • The Antithesis multiverse
  • Querying with event sets
  • Environment utilities
  • Using the Antithesis Notebook
  • Cookbook
  • Tooling integrations
  • CI integration
  • Discord and Slack integrations
  • Issue tracker integration - BETA
  • Configuration
  • Access and authentication
  • The Antithesis environment
  • Optimizing for testing
  • Docker best practices
  • Kubernetes best practices
  • Concepts
  • Properties and Assertions
  • Properties in Antithesis
  • Assertions in Antithesis
  • Sometimes Assertions
  • Properties to test for
  • Fault injection
  • Reference
  • Webhooks
  • Launching a test
  • Launching a debugging session
  • Webhook parameters
  • SDK reference
  • Define test properties
  • Generate randomness
  • Manage test lifecycle
  • Assertion catalog
  • Coverage instrumentation
  • Go
  • Instrumentor
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Java
  • Using the SDK
  • Building your software
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • C
  • C++
  • C/C++ Instrumentation
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • JavaScript
  • Python
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Rust
  • Instrumentation
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • .NET
  • Instrumentation
  • Tutorial
  • Assert (reference)
  • Lifecycle (reference)
  • Random (reference)
  • Languages not listed above
  • Assert (reference)
  • Lifecycle (reference)
  • Assertion Schema
  • Handling external dependencies
  • FAQ
  • Product FAQs
  • About Antithesis POCs
  • Release notes
  • Release notes
  • General reliability resources
  • Reliability glossary
  • Techniques for better software testing
  • Autonomous testing
  • Deterministic simulation testing
  • Property-based testing
  • White paper — How much does an outage cost?
  • Catalog of reliability properties for key-value datastores
  • Catalog of reliability properties for blockchains
  • Test ACID compliance with a ring test