testing-conventions

testing-conventions is a cursor rule for Cursor from baijum/ukulele-companion. It costs 0 tokens per session (773 once invoked), scanned A, original, MIT.

A set of testing rules for Kotlin, Android, Jetpack Compose, and iOS code. It specifies when to use JUnit 4, Kotest property tests, Compose UI tests, XCTest, and device-based tests.

In plain words
What is it for?
Use it when changing chord or note logic, fretboard or interface behavior, accessibility, themes, or other domain code.
Why use it?
It gives the project a consistent way to test behavior, user interfaces, accessibility, themes, and randomly generated inputs.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/baijum/ukulele-companion/testing-conventions
Clone the repo
git clone --depth 1 https://github.com/baijum/ukulele-companion

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-conventions

README.md
[![agentmods](https://agentmods.dev/badge/rules/baijum/ukulele-companion/testing-conventions.svg)](https://agentmods.dev/rules/baijum/ukulele-companion/testing-conventions)
Your own site
<a href="https://agentmods.dev/rules/baijum/ukulele-companion/testing-conventions"><img src="https://agentmods.dev/badge/rules/baijum/ukulele-companion/testing-conventions.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 773 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00773
Opus 5 $0.00000 $0.00387
Sonnet 5 $0.00000 $0.00155
Haiku 4.5 $0.00000 $0.00077

Measured 6d ago against content hash 39435a5c82c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

testing-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/testing-conventions.mdc · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Conventions

Frameworks

  • Unit tests: JUnit 4
  • Property tests: Kotest Property Testing (io.kotest:kotest-property)
  • UI tests: Compose UI Testing (ui-test-junit4)
  • iOS tests: XCTest

Running tests

./gradlew testDebugUnitTest       # All Android unit tests
./gradlew connectedAndroidTest    # Instrumented tests (requires emulator/device)

Property tests (Kotest)

Property tests generate thousands of random inputs and verify invariants. Use runBlocking { checkAll(...) { ... } } with JUnit 4.

@Test
fun `transpose identity`() = runBlocking {
    checkAll(Arb.string(), Arb.int(0..11)) { chord, semitones ->
        val result = transpose(transpose(chord, semitones), -semitones)
        assertEquals(chord, result)
    }
}

Domain logic (domain/ package) is pure Kotlin — add property tests for new invariants.

What to test when

  • Chord/note logic changes: Test both High-G and Low-G tuning
  • Fretboard UI changes: Test left-handed mode
  • UI changes: Verify light, dark, and high-contrast themes
  • New domain logic: Add property tests for invariants
  • Accessibility changes: Run instrumented accessibility tests

Existing test files

Unit tests (app/src/test/)

File Tests
PitchDetectorTest.kt YIN pitch detection with synthetic sine waves
AudioResamplerTest.kt Downsampling ratio, empty input, frequency preservation
FFTProcessorTest.kt DC signal, pure sine peak, FFT/IFFT round-trip
TunerNoteMapperTest.kt Frequency-to-note mapping, string matching, hysteresis
TtsAnnouncementThrottlerTest.kt Tuner spoken feedback throttling

Property tests (app/src/test/, *PropertyTest.kt)

File Invariants
TransposePropertyTest.kt Identity, inverse round-trip, associativity, chord name preservation
ChordNameParserPropertyTest.kt Arbitrary string robustness, known chord parsing, case insensitivity
ChordDetectorPropertyTest.kt Empty/single/pair handling, known formula detection
FFTProcessorPropertyTest.kt FFT/IFFT round-trip with random signals, sine peak detection
PitchDetectorPropertyTest.kt Silent/quiet buffer rejection, pure sine accuracy
ChordSheetTransposePropertyTest.kt Zero/twelve identity, double transpose round-trip
CapoCalculatorPropertyTest.kt Capo position range, score ordering, voicing fret range

Read the full file on GitHub · 83 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 83 lines · 0 tokens per session scan A 39435a5c82c5

Subscribe to this mod's changes

testing-conventions is a cursor rule published in the GitHub repository baijum/ukulele-companion (13 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 773 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.