CommunityCodierung & Entwicklunggithub.com

negative-test

Negative, boundary and edge-case testing for backend APIs, frontend forms, mobile screens, admin panels and database constraints. Tests invalid/empty/null/oversized/malformed input, wrong types, boundary values, unauthorized states, unexpected responses, duplicate and concurrent actions, and verifies the app fails safely without crashing or leaking data. Finds missed validation and reports by severity into testcase.md. Use when asked for "negative testing", "edge cases", "invalid input", "boundary testing", "validation testing", or "what can break this".

Was ist negative-test?

negative-test is a Cursor agent skill that negative, boundary and edge-case testing for backend APIs, frontend forms, mobile screens, admin panels and database constraints. Tests invalid/empty/null/oversized/malformed input, wrong types, boundary values, unauthorized states, unexpected responses, duplicate and concurrent actions, and verifies the app fails safely without crashing or leaking data. Finds missed validation and reports by severity into testcase.md. Use when asked for "negative testing", "edge cases", "invalid input", "boundary testing", "validation testing", or "what can break this".

Funktioniert mit~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/joshijignesh/faultline/tree/HEAD/skills/negative-test

Installed? Explore more Codierung & Entwicklung skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht negative-test?

Goal: prove the system rejects bad input and bad states safely. Test the failure path, not only the happy path.

Follow references/core-rules.md, references/automation-workflow.md, references/severity-model.md. Write the report in the format of references/testcase-template.md. Prefix IDs with NEG-. For every detected language, also apply references/languages/<language>.md (index: references/languages/README.md).

Rules

  • Validation must happen on the server. Client-side validation is UX, not security. A field validated only on the client is a VALIDATION finding, at least High for sensitive fields.
  • For every input, check: type, presence, length/size, format, range, allowed values, ownership, uniqueness.
  • Every negative case must check four things: (a) no crash, (b) the correct status or error message, (c) no sensitive data in the error, (d) state is unchanged or rolled back, and the user can recover.

Input matrix (apply it to every field and parameter)

ClassValues to try
Missingfield absent, null, undefined, "", " " (whitespace), [], {}
Typestring↔number, "123" vs 123, boolean as "true", array where object expected, nested object where scalar expected
Size0, 1, max-1, max, max+1, 10× max, 1 MB string, 10k-item array, deeply nested JSON (1000 levels)
Numeric0, -1, -0, 0.1+0.2, 1e308, NaN, Infinity, 2^31, 2^53+1, too many decimal places for currency
Formatbad email/phone/URL/UUID/date, 2026-02-30, timezone-less timestamp, leap day, DST change, far past/future dates
CharactersUnicode, emoji 👍🏽, RTL text, zero-width chars, homoglyphs, \0 null byte, CRLF \r\n, very long single word
Injection-ish' OR 1=1--, <script>, {{7*7}}, ../../etc/passwd, ; ls, ${jndi:...}. Detail lives in security-test; here just confirm it's rejected or escaped
Enumunknown value, wrong case, old or deprecated value
IdentityID of a resource that doesn't exist, was deleted, or belongs to another user
Duplicatessame request twice, double-click submit, same unique value (email, SKU), replayed webhook
Files0-byte file, huge file, wrong extension, spoofed MIME, corrupted image, zip bomb, filename with ../ or unicode

Checklist by layer

Backend / API (BE)

  • Schema validation (Zod, Joi, class-validator, Pydantic, Bean Validation) on every body, query, param, and header.
  • Unknown fields are rejected or stripped. No mass assignment of role, isAdmin, price, userId, status.
  • Invalid JSON returns 400, not 500.
  • Wrong Content-Type returns 415 or 400.
  • Pagination: page=-1, limit=0, limit=100000, cursors that don't exist.
  • Sort/filter params checked against an allowlist of columns.
  • Missing, expired, or malformed auth token gives 401. Valid token but wrong role gives 403. Other user's resource gives 404 or 403 consistently.
  • Rate limit returns 429 with a Retry-After header.
  • Error messages don't reveal stack traces, SQL, internal paths, or whether an account exists (on login or reset).

Frontend web (FE)

  • Each form field shows an inline error and the submit button is disabled or guarded while submitting (stops double submit).
  • Server-side validation errors are mapped back to the right fields.
  • Empty states for lists and search with no results.
  • Error boundary catches render errors, so one widget failing doesn't white-screen the page.
  • Back, forward, refresh mid-flow, a session expiring mid-form, and multiple tabs.
  • Untrusted strings render as text, not via dangerouslySetInnerHTML or v-html.

Mobile (MOB)

  • Keyboard types and input masks don't stop the user from pasting valid values.
  • Rotation, split screen, and font scaling at 200% with long text.
  • Rapid double taps on buttons that trigger navigation or a submit.
  • Component unmounts mid-request: no setState-on-unmounted warning or crash. Requests use AbortController.
  • Low storage, low memory, and the app killed in the background during an upload.
  • Permission denied, and permission revoked while the app is in use.
  • Out-of-order responses: an older search response must not overwrite a newer one.

Admin panel (ADM)

  • Admin forms get the same server validation as user forms. Admin is not a trusted input source.
  • Bulk operations with mixed valid and invalid rows report row-level errors and don't silently skip rows.
  • CSV import: wrong delimiter, BOM, formula injection (=HYPERLINK(...), +cmd, @SUM), missing headers, a 100k-row file.
  • Destructive actions need confirmation and can't be triggered by a GET.
  • Editing a record someone else edited at the same time is handled (optimistic locking or a last-write warning).

Database (DB)

  • NOT NULL, CHECK, UNIQUE, and FK constraints exist so the DB catches what the app misses (defence in depth).
  • Column lengths match API max lengths, so a valid API input can't fail with a DB truncation error.
  • Decimal or integer-cents for money, never float.
  • Timestamps stored in UTC with timezone (timestamptz).
  • A unique-violation or FK error is translated to 409 or 422, not 500.
  • Soft-deleted rows are excluded from uniqueness and lookups where they should be.

Concurrency and race cases

  • Two requests at once on the same resource: double spend, oversell inventory, duplicate coupon use.
  • Request cancellation and retry after timeout.
  • Rapid toggle (like/unlike, follow/unfollow) ends in a consistent final state.

Automation hint

Generate table-driven tests from the input matrix in the project's framework, e.g. it.each(cases), @pytest.mark.parametrize, or property-based tests (vendor property-based-testing) for fuzz-style coverage.

Output per test

ID | Scenario | Input | Expected | Actual | Pass/Fail | Follow-up. Add it to testcase.md.

Scope, prerequisites, and missing tools

Don't use it for dependency or network failure handling (fallback-test), business-rule correctness (logical-test), or a full security review (security-test). Injection strings here only confirm input is rejected or escaped.

Prerequisites: read access to the repository. Optional: the project's own test runner and the scanners listed in the language guides. Nothing extra needs to be installed; every check also works by reading the code.

If something is missing: if a tool, the test runner, or a running app isn't available, or a step is blocked, record it as NOT RUN: <reason> and continue statically. Always finish by writing the report.

Example finding row

IDLayerTypeFindingLocation / EvidenceFailure scenarioFixStatus
NEG-BE-004BEVALIDATIONquantity accepts negativesapi/orders.py:41 no bounds checkquantity=-5 → total −49.95, order acceptedconint(ge=1, le=10) in the Pydantic modelOpen

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

Verwandte Skills