Robolectric is the industry-standard unit testing framework for Android. With Robolectric, your tests run in a simulated Android environment inside a JVM, without the overhead of an emulator. Running tests on an Android emulator or device is slow! Building, deploying, and launching the app often takes a minute or more. That’s no way to do TDD, there must be a better way. Robolectric is a framework that brings fast and reliable unit tests to Android. Tests run inside the JVM on your workstation in seconds. Robolectric is built using Gradle. Both IntelliJ and Android Studio can import the top-level build.gradle file and will automatically generate their project files from it. Robolectric supports running tests against multiple Android API levels. The work it must do to support each API level is slightly different, so its shadows are built separately for each. If you would like to live on the bleeding edge, you can try running against a snapshot build.

Features

  • Robolectric tests run inside a sandbox
  • Allows the Android environment to be precisely configured to the desired conditions for each test
  • Isolates each test from its neighbors, and extends the Android framework with test APIs
  • Provides minute control over the Android framework’s behavior and visibility of state for assertions
  • Robolectric provides a test double that’s suitable for most unit testing scenarios
  • Robolectric lets you run your tests on your workstation, or on your continuous integration environment in a regular JVM

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Roboelectric

Roboelectric Web Site

Other Useful Business Software
$300 in Free Credit Towards Top Cloud Services Icon
$300 in Free Credit Towards Top Cloud Services

Build VMs, containers, AI, databases, storage—all in one place.

Start your project in minutes. After credits run out, 20+ products include free monthly usage. Only pay when you're ready to scale.
Get Started
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Roboelectric!

Additional Project Details

Operating Systems

Android

Programming Language

Java

Related Categories

Java Software Testing Tool, Java Frameworks, Java Unit Testing Tool

Registered

2021-10-18