# mockk/mockk

mocking library for Kotlin

Repository: https://github.com/mockk/mockk
Canonical: https://ross.abutalabs.com/products/mockk
Homepage: https://mockk.io
Language: Kotlin
License: Apache-2.0
License Family: permissive
Topics: verification, chain-calls, matcher, argument-matchers, kotlin, mocking-framework, mock, testing, tdd, hacktoberfest
Last push: 2026-08-08T21:25:07+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 74, longevity 100
- inputs: {"age_days": 3242, "days_push": 25, "days_rel": 96, "gap_med": 51.0, "n_releases_24m": 13}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5757, forks 415 (observed 2026-08-28T04:09:29.267948+00:00)

## What it is
MockK is a mocking library for Kotlin providing a Kotlin-first DSL for creating mocks, stubbing behavior, and verifying calls. It supports coroutines, Android unit and instrumented tests, and BDD-style aliases.

## Use cases
- mock dependencies in Kotlin unit tests
- stub and verify method calls with a Kotlin DSL
- mock suspend functions and coroutines
- write BDD-style tests in Kotlin
- mock classes in Android instrumented tests
- mock Spring beans in Spring Boot Kotlin apps

## When to choose
- you write Kotlin or Android tests and need idiomatic mocking
- you need to mock coroutines, objects, or final classes
- you want strict mocks with verification by default

## When to avoid
- you are writing pure Java projects (Mockito may fit better)
- you need mocking outside the JVM ecosystem

## Facets
- artifact type: library
- maturity: active
- function: mocking, testing
- domain: testing, developer-tools
- platform: jvm
- tags: kotlin, mocking-framework, tdd, bdd, verification, argument-matchers, coroutines, android

## Member repositories
- mockk/mockk (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:29.267948+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:53:15.783628+00:00, confidence not recorded.
  - readme: https://github.com/mockk/mockk (fetched 2026-08-28T04:09:29.267948+00:00, sha 7cfbea42093a)
  - homepage: https://mockk.io (fetched 2026-08-29T08:48:25.079968+00:00, sha 579b0afa9c6c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
