An attribute is a general behavioral statement that software should satisfy across applicable inputs or executions. In property-based testing, it becomes a rule that must hold regardless of the input, shifting attention from individual examples to broader correctness. section 5.2.3
Traditional tests verify manually chosen scenarios, so flawed or incomplete cases can leave bugs undiscovered. Attributes address this limitation by stating the behavior that should remain valid across generated edge cases and unexpected inputs. section 5.2.2 section 5.2.3
Common attributes include:
- Structural preservation: an operation maintains a characteristic such as data length. section 5.2.3
- Idempotency: applying an operation repeatedly produces the same result. section 5.2.3
- Commutativity: changing the order of arguments does not change the result. section 5.2.3
- System invariants: financial debits equal credits, retries avoid duplicate transactions, or API calls meet a latency target. section 5.2.4
Fuzzing a string function
Rather than listing every string edge case, a fuzzing library generates random inputs, including unexpected formats and extreme values. The attribute is that the function should not crash. This tests robustness, while broader property-based testing can also verify structured correctness rules. section 5.2.3
Attributes can describe local functions, APIs, or interacting applications. They complement rather than replace traditional tests, and their explicit rules can serve as living documentation for system behavior. section 5.2.4































