BitDive is a tool for Java applications that captures method-level behavior at runtime, then generates JUnit tests from what it observed. The problem it addresses is the one every Java team knows: maintaining a mock-heavy test suite eventually costs more time than it saves, and the test code grows to half the codebase.
How it works
- Captures method calls at runtime: parameters, return values, exceptions, SQL, and call chains.
- Generates JUnit tests from the captured behavior. No manual test code.
- Automatically isolates external dependencies (databases, Kafka, gRPC, downstream HTTP) using the observed interactions, so tests run deterministically without a real environment.
- Produces regression suites and behavior-based contract checks from the same scenarios.
When it helps
- A legacy Java service with poor test coverage, where writing mocks by hand is not realistic.
- A team whose test maintenance tax has grown to the point where shipping slows down.
- A refactor where you want to lock in current behavior before changing it.
Notes
Focused on Java and the JVM ecosystem. The capture-and-replay approach is a real alternative to hand-written mocks for the right kind of codebase.