# shellspec/shellspec

A full-featured BDD unit testing framework for bash, ksh, zsh, dash and all POSIX shells

Repository: https://github.com/shellspec/shellspec
Canonical: https://ross.abutalabs.com/products/shellspec
Homepage: https://shellspec.info
Language: Shell
License: MIT
License Family: permissive
Topics: dash, bash, ksh, zsh, shell, shell-script, posix-compliant, posix-sh, bdd, test, testing, kcov, coverage, shellspec, mock, script, tdd
Last push: 2025-11-24T18:57:18+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 53, release rhythm 8, longevity 100
- inputs: {"age_days": 2766, "days_push": 282, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1393, forks 78 (observed 2026-08-28T04:04:36.219210+00:00)

## What it is
ShellSpec is a full-featured BDD unit testing framework for shell scripts, supporting bash, ksh, zsh, dash, and all POSIX shells. It provides code coverage, mocking, parameterized tests, and parallel execution for testing shell scripts and libraries.

## Use cases
- unit test bash scripts
- test shell functions with BDD syntax
- get code coverage for shell scripts
- mock commands in shell script tests
- run shell tests in parallel
- test scripts across multiple POSIX shells
- TDD for shell script libraries

## When to choose
- you need a full-featured testing framework for shell scripts
- your scripts must run across many POSIX shells (dash, ksh, zsh, busybox)
- you want mocking, coverage, or parallel execution for shell tests
- you prefer BDD/RSpec-style syntax over Bats or shUnit2

## When to avoid
- you only need simple assertion-based tests and prefer Bats' minimalism
- you are testing Python, Ruby, or other non-shell code
- your team is unfamiliar with BDD-style test syntax

## Facets
- artifact type: framework
- maturity: stable
- function: testing, mocking, cli
- domain: testing, developer-tools
- platform: windows, bsd, cli, cross-platform
- tags: bdd, shell-scripting, posix-shells, tdd, code-coverage, unit-testing, bash, zsh, dash, ksh, command-line, automation, linux, macos

## Member repositories
- shellspec/shellspec (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:36.219210+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-30T04:39:30.231311+00:00, confidence not recorded.
  - readme: https://github.com/shellspec/shellspec (fetched 2026-08-28T04:04:36.219210+00:00, sha d5b9d1635666)
  - homepage: https://shellspec.info (fetched 2026-08-29T11:54:18.441901+00:00, sha b4e81d3b0d7b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
