<commit_before># theft: property-based testing for C

theft is a C library for property-based testing. Rather than defining
specific inputs for code under test and checking the results, properties
are asserted ("for any possible input, [condition] should hold"), and
theft searches for counter-examples. If it finds a combination of
arguments that causes the assertion to fail, it will search for simpler
versions of those arguments that still fail, and then print the minimal
failing input.

Property-based testing stresses programs differently than tests biased
by understanding how the program "should" work. Like using fuzz testing
to find security vulnerabilities, this can discover edge cases that have
not been covered by unit tests. It also generates thousands of tests
with just a few lines of code, so it's a great way to get quick feedback
on code that is rapidly evolving.

theft is distributed under the ISC license.


## Installation & Dependencies

theft does not depend on anything beyond C99. Its tests use
[greatest][], but there is not any coupling between them. It also
contains implementations of the [Mersenne Twister][mt] PRNG and the
[FNV-1a][fnv] hashing algorithm - see their files for copyright info.

[greatest]: https://github.com/silentbicycle/greatest
[mt]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
[fnv]: http://www.isthe.com/chongo/tech/comp/fnv/

<commit_msg>Add heatshrink examples and blog post links to README.<commit_after># theft: property-based testing for C

theft is a C library for property-based testing. Rather than checking
the results with specific input, properties are asserted ("for any
possible input, [condition] should hold"), and theft searches for
counter-examples. If it finds a combination of arguments that causes the
property to fail, it will search for simpler versions of those arguments
that still fail, and then print the minimal failing input.

[Property-based testing][pbt] stresses programs differently than tests
biased by understanding how the program "should" work. Like using fuzz
testing to find crashes or security vulnerabilities, this can discover
edge cases that have not been covered by unit tests. It also generates
thousands of tests with just a few lines of code, so it's a great way to
get quick feedback on code that is rapidly evolving.

theft is distributed under the ISC license.

I have a [blog post][] about one of the theft tests used in
[heatshrink][], and its repo has [several other property-test examples][ex].

[pbt]: https://spin.atomicobject.com/2014/09/16/property-based-testing/
[blog post]: https://spin.atomicobject.com/2014/09/17/property-based-testing-c/
[heatshrink]: https://github.com/atomicobject/heatshrink
[ex]: https://github.com/atomicobject/heatshrink/blob/master/test_heatshrink_dynamic_theft.c

## Installation & Dependencies

theft does not depend on anything beyond C99. Its tests use
[greatest][], but there is not any coupling between them. It also
contains implementations of the [Mersenne Twister][mt] PRNG and the
[FNV-1a][fnv] hashing algorithm - see their files for copyright info.

[greatest]: https://github.com/silentbicycle/greatest
[mt]: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
[fnv]: http://www.isthe.com/chongo/tech/comp/fnv/


{'fraction_non_alphanumeric': 0.07879525403103134, 'fraction_numerical': 0.006693033160937024, 'mean_word_length': 4.748251748251748, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7160588', 'n_tokens_mistral': 948, 'n_tokens_neox': 885, 'n_words': 422}