jamespthomas / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

support QuickCheck-style declarative random tests #320

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
QuickCheck (http://en.wikipedia.org/wiki/QuickCheck) is a widely-used Haskell 
library for writing very-high-level test assertions about the properties of a 
piece of code, and the assertions will be verified by randomly generated test 
data.  The user can declaratively control the generation of the random data.

This style of testing can greatly complement what gtest already offers, and 
significantly increase test coverage with little code.

There is a C++ implementation at http://software.legiasoft.com/quickcheck/, but 
that's more of a prototype than a mature library.  We should carefully think 
through the design in the context of C++ rather than doing a quick port from 
Haskell.

Original issue reported on code.google.com by w...@google.com on 28 Sep 2010 at 7:05

GoogleCodeExporter commented 9 years ago
I completely agree with the original poster: "This style of testing can greatly 
complement what gtest already offers, and significantly increase test coverage 
with little code."

Please consider implementing this :-)

Original comment by marco.mo...@gmail.com on 1 Nov 2012 at 8:08

GoogleCodeExporter commented 9 years ago
This seems much better: https://github.com/grogers0/CppQuickCheck

Original comment by gerard.b...@gmail.com on 2 Dec 2012 at 7:43

GoogleCodeExporter commented 9 years ago
@Gerard: thanks for mentioning CppQuckCheck, I wasn't aware of it. According to 
the web page: BSD license (instead than GPLv3), support for test case shrinking 
(which is one of the power of the original quickcheck in my understandind). 
Time to play with it! :-)

Original comment by marco.mo...@gmail.com on 2 Dec 2012 at 8:11

GoogleCodeExporter commented 9 years ago
I wrote my own QuickCheck clone for C++11 [1] with what I feel is a better 
architecture. I also wrote a reporter to help me integrate it with my own 
Google Tests [2]. Some example tests can be found in another library of mine 
[3]. Please let me know what you think, or email me if you have questions.

[1] https://github.com/thejohnfreeman/autocheck
[2] 
https://github.com/thejohnfreeman/autocheck/blob/master/include/autocheck/report
er.hpp
[3] https://github.com/thejohnfreeman/clrs/tree/master/test

Original comment by jfreema...@gmail.com on 14 Jan 2013 at 7:52