Back to directory

Dexmaker

A Java API for compile-time or runtime code generation targeting Android's Dalvik VM, most commonly used to let the Mockito mocking library create class proxies in Android instrumentation tests.

Dexmaker

Dexmaker generates Dalvik .dex bytecode rather than Java .class files, giving a close-to-the-metal API that mirrors the Dalvik bytecode specification for instruction-by-instruction code generation, backed by Dalvik's dx tool for efficient register allocation.

Its main use is enabling the Mockito mocking library inside Android instrumentation tests: adding a dependency on dexmaker-mockito lets a test use Mockito as normal, and dexmaker-mockito-inline additionally supports mocking final classes and methods on Android P and later. It also includes a stock code generator for class proxies for AOP or mocking use cases without handling bytecode directly, and supports generating and loading a class and invoking its methods at runtime.

It is distributed as a Maven/Gradle dependency, with its version tracking the Mockito version it targets.

More in Testing

See all 69
  • Canary

    runcanary.ai

    An independent testing service, backed by Y Combinator, that runs an application and tries to break every change an AI coding agent makes, reporting what would have reached production.

  • MoEWatch

    github.com

    A diagnostic and audit library for Mixture-of-Experts models in HuggingFace Transformers that instruments router modules to catch expert collapse, routing entropy collapse and load imbalance during training.

  • Mockwave

    github.com

    An open-source, multi-protocol mock server for HTTP, GraphQL, SOAP, and gRPC, with weighted traffic splitting, dynamic JavaScript responses, chaos-testing fault injection, and an MCP server so an AI assistant can generate mock rules directly.