Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:20000419 Fauxnix Differential Testing

From Leeroopedia
Knowledge Sources
Domains Testing, Differential_Testing, Validation
Last Updated 2026-10-26 00:00 GMT

Overview

A validation technique that executes a curated corpus of bash commands on both the system under test (fauxnix) and a reference oracle (real Git Bash) in fresh, isolated file trees and compares stdout, stderr, and exit code for identity.

Description

Differential Testing is the correctness evidence for fauxnix. A curated corpus (270 cases) covers the supported bash subset. For each case, the runner creates a fresh pair of file trees (one for fauxnix, one for bash) to prevent cross-engine contamination, runs the command on fauxnix via a prewarmed FauxnixSession and on Git Bash via spawnSync, and compares the results. The oracle is opt-in (FAUXNIX_DIFF_ORACLE) and skip-safe on developer machines without Git Bash. Fresh trees per case also prevent files created by an earlier case from changing a later case's result. The comparison normalizes CRLF before comparing stdout and stderr and requires exact exitCode equality. The corpus defines a gate (targetCases=200, identity=0.95) and a knownMismatchIds baseline for reviewed, accepted differences.

Usage

Use this principle when a translator or compatibility layer must be validated against a reference implementation. The fresh-trees-per-case + opt-in-oracle pattern is the right choice when the reference is not universally available and cross-test contamination is a risk.

Theoretical Basis

for each case in corpus.cases:
  fauxnixDir = mkdtemp(); bashDir = mkdtemp()
  writeTree(fauxnixDir, shared + case.files); writeTree(bashDir, shared + case.files)
  session.cd(fauxnixDir)
  fauxnix = session.run(translate(parse(case.cmd)))
  bash = runBash(bashPath, bashDir, case.cmd)  # spawnSync --noprofile --norc -c
  result.identical = sameIdentity(fauxnix, bash)
identity = count(identical) / total
gate: identity >= 0.95

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment