CtrlK
BlogDocsLog inGet started
Tessl Logo

evilissimo/property-based-testing

Generates **property-based tests** that use randomized input generation to validate invariants and contracts (rather than hand-picked examples). Triggers when the conversation involves: PBT frameworks (Hypothesis library for Python, fast-check for TypeScript, proptest for Rust, rapid for Go, RapidCheck for C++); concepts like invariants, contracts, round-trip symmetry, encode/decode, serialize/deserialize, generative testing, or shrinking; or requests to find edge cases that example-based tests miss — e.g., "find edge cases automatically", "test all possible inputs", "verify this property holds". Does NOT trigger for: writing regular example-based unit tests, debugging, CI/CD setup, UI/component testing, or integration/E2E testing. Identifies up to 7 property patterns (round-trip, idempotence, invariance, metamorphic, inverse, ordering, no-crash), designs input generators, writes property tests, and extracts regression tests from failures.

91

1.11x
Quality

90%

Does it follow best practices?

Impact

94%

1.11x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-5/

Codec Contract Tests

Problem/Feature Description

A C++ library encodes packet headers to a compact byte string and decodes them back. Current GoogleTest cases use two fixed packets, but interoperability bugs have appeared with empty tags, maximum sequence numbers, and random payload lengths. The maintainers want generated tests that express the codec contract and are easy to run with their existing gtest-based test target.

Write a test file for the API below. Include any helper generators you need and a note about dependency/setup options.

Output Specification

Produce packet_properties_test.cpp containing GoogleTest-compatible property tests. Produce NOTES.md explaining the chosen properties, run configuration, and future failure workflow.

Input Files

=============== FILE: packet.hpp ===============

#pragma once
#include <cstdint>
#include <string>
#include <vector>

struct Packet {
  uint32_t sequence;
  std::string tag;
  std::vector<uint8_t> payload;

  bool operator==(const Packet& other) const {
    return sequence == other.sequence && tag == other.tag && payload == other.payload;
  }
};

std::string encode(const Packet& p);
Packet decode(const std::string& bytes);

evals

SKILL.md

tessl.json

tile.json