It is my pleasure to announce release 0.90 of the QCheck packages. QCheck is an OCaml library for randomized property-based testing in the style of Haskellโs QuickCheck. Release 0.90 ยท c-cube/qcheck ยท GitHub It has been over 12 years and 40 releases since @c-cube released version 0.1 back in October 2013. Over this period QCheck has grown organically with new combinators on a โby-needโ basis and with a separate QCheck2 module offering generators with integrated shrinking. This has unfort...
Gave a talk yesterday:
"Property Based Testing to verify a pipelined CPU design (hardware)"
at the New England Programming Languages and Systems Symposium (NEPLS),
about verifying my Fife RISC-V CPU using U.Cambridge's TestRIG (which uses Haskell's QuickCheck) and RISC-V International's RISC-V ISA Formal Specification (written in Sail)
https://nepls.org/
https://nepls.org/Events/36/
#NEPLS #FIFE #RISCV #RVI #Haskell #QuickCheck #TestRIG #PBT #Sail
Started hacking on a shrinker (reducer) of floats for QCheck a while back - and struggled. Yesterday I finally made some progress and now opened a PR for it:
https://github.com/c-cube/qcheck/pull/357 โ๏ธ ๐ข ๐ค
Here's a preprint of the paper I wrote up for Olivier's festscrift ๐ ๐พ
Property-Based Testing of OCaml 5's Runtime System:
Fun and Segfaults with Interpreters and State Transition Functions
We describe our effort on using property-based testing to test the OCaml 5 multicore runtime system. In particular, we cover three case studies of increasing complexity that utilize a model-based state machine framework: (a) Testing the Array module, (b) testing weak hash sets, and (c) testing the garbage collector, with the latter two behaving non-deterministically from the point of view of the blackbox testing process. We evaluate the approach empirically by analyzing the bugs found, and discuss both limitations and challenges we have met underway.
https://janmidtgaard.dk/papers/Midtgaard%3aOLIVIERFEST25.pdf
falsify A few days ago, Edsko de Vries of Well-Typed published an in-depth article on property-based software testing, with a focus on the concept of โshrinking.โ
In brief, property-based testing is sort-of like fuzz testing but for algorithms and protocols. Like fuzz testing, random test cases are procedurally generated, but unlike fuzz testing, the test cases are carefully designed to verify whether a software implementation of an algorithm satisfies a specific property of that algorithm, such as:
n*log(n) number of iterations for input dataset of size nโโthe sequence of log messages is guaranteed to obey this rules of this particular finite-state automata: (connect | fail) -> (send X | fail) -> (receive Y | receive Z | fail) -> success .โ
Shrinking is the process of simplifying a failed test case. If you have found some input that makes your function return a value when it should have thrown an exception, or produce a result that does not satisfy some predicate, then that input is a โcounterexampleโ to your assertion about the properties of that function. And you may want to be able to โshrinkโ that counterexample input to see if you can cause the function to behave incorrectly again but with a simpler input. The โQuickCheckโ library provides a variety of useful tools to let you define property tests with shrinking.
Defining unit tests with such incredible rigor takes quite a lot of time and effort, so you would probably do not want to use property-based testing for your ordinary, every-day software engineering. If you are, for example, being scrutinized by the US Department of Government of Efficiency, you would likely be fired if you were to take so much time to write such high-quality software with such a strong guarantee of correctness.
But if you are, for example, designing a communication protocol that will be used in critical infrastructure for the next 10 or 20 years and you want to make sure the reference implementation of your protocol is without contradictions, or if you are implementing an algorithm where the mathematical properties of the algorithm fall within some proven parameters (e.g. computational complexity), property-based testing can give you a much higher degree of confidence in the correctness of your algorithm or protocol specification.
#tech #software #haskell #WellTyped #QuickCheck #UnitTesting #PropertyTesting
๐ญ๐ฌ ๐๐ฒ๐ฐ๐ผ๐ป๐ฑ๐ ๐ผ๐ป ๐๐ฎ๐บ๐ฒ๐ฐ๐ต๐ฒ๐ฐ๐ธ ๐ฒ๐พ๐๐ฎ๐น๐ ๐ฝ๐ฒ๐ฎ๐ฐ๐ฒ ๐ผ๐ณ ๐บ๐ถ๐ป๐ฑ
A quick search is all it takes.
Enter the casino URL. Look for the green "Real Games" badge.
If it is there, it has been verified by us. If it is not, Gamecheck before you play.
โ Gamecheck before you play