An open API service indexing awesome lists of open source software.

https://github.com/kensa-dev/kensa

A BDD testing framework for Kotlin & Java
https://github.com/kensa-dev/kensa

agile-methodologies bdd bdd-framework fluent java junit5 kotlin tdd testing

Last synced: 21 days ago
JSON representation

A BDD testing framework for Kotlin & Java

Awesome Lists containing this project

README

          

# Kensa Logo Kensa

![Latest Release](https://img.shields.io/github/v/release/kensa-dev/kensa)

**Kensa** is a BDD testing framework for Kotlin and Java. Write Given-When-Then tests directly in code — no Gherkin files, no step definitions. Kensa parses your test source at runtime to produce rich HTML reports and sequence diagrams.

Check out the [documentation](https://kensa.dev) for quickstarts, API reference, and examples.

| Write this… | …get this |
|---|---|
| ![Kensa test written in Kotlin](kensa.dev/static/img/code-example.png) | ![Kensa generated HTML report with sequence diagram](kensa.dev/static/img/report-example.png) |

## Features

- **Code-first BDD** — Given-When-Then structure in plain Kotlin/Java; no external DSL files
- **HTML reports** — generated directly from test source, always in sync with the code
- **Sequence diagrams** — visualise interactions between actors captured during test execution
- **Framework support** — JUnit 5, Kotest, TestNG
- **Assertion libraries** — Kotest, AssertJ, Hamcrest, HamKrest

## Getting Started

Add the dependency for your test framework:

```kotlin
// build.gradle.kts
dependencies {
testImplementation("dev.kensa:kensa-junit:") // JUnit 5
// or
testImplementation("dev.kensa:kensa-kotest:") // Kotest runner

// Assertions bridge (pick one or more)
testImplementation("dev.kensa:kensa-kotest:")
testImplementation("dev.kensa:kensa-assertj:")
}
```

Find the latest version on the [releases page](https://github.com/kensa-dev/kensa/releases).

See the [Kotlin quickstart](https://kensa.dev/docs/quickstart/kotlin-quickstart) or [Java quickstart](https://kensa.dev/docs/quickstart/java-quickstart) for a full setup walkthrough.

## Tooling

### CLI — serve reports locally

Every release ships pre-built binaries for macOS (Intel + Apple Silicon), Linux, and Windows.
Download `kensa--` from the [latest release](https://github.com/kensa-dev/kensa/releases/latest), then:

```bash
kensa serve
```

This starts a local HTTP server and opens your HTML reports in the browser.

### Claude Code skill — AI-assisted test review

Every release also ships `kensa-test.skill`, a [Claude Code](https://claude.ai/code) skill that reviews Kensa tests for idiomatic style, fluency violations, and best-practice patterns.

Install it once:

```bash
claude plugin install kensa-test.skill
```

Then invoke it in any Claude Code session:

```
/kensa-test review this test
```

The skill checks for fluent English in rendered test bodies, correct use of Fixtures and CapturedOutputs, semantic assertion naming, composable setup toolboxes, and the typed context/mixin pattern for multi-stub tests.