GithubHelp home page GithubHelp logo

pombredanne / conjecture-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bachmann1234/conjecture

0.0 0.0 0.0 357 KB

Conjecture is a new approach to property based testing

License: GNU General Public License v3.0

Makefile 4.52% Python 18.44% C 77.04%

conjecture-1's Introduction

Conjecture

Conjecture is a new approach to property based testing in C.

The core concept of Conjecture is: What if you could do the most basic sort of randomized testing which everybody starts out with, only instead of it being awful it was actually amazing?

Classic property based testing has a strict separation between example generation and testing, which makes it very hard to use for tests that don't easily match that discipline. Suppose I want to do some calculation and then pick a random element of the result. How do I do that?

In Conjecture, instead of having distinct concepts of example generation and tests, everything is a test and everything can generate examples. Testing is a simple matter of writing functions which take a type of random number generator but whose output is under Conjecture's control and can be controlled to produce interesting behaviour and then simplified to produce the minimal possible behaviour.

The result is a style of testing that is more natural to use, easier to implement, and yet strictly more powerful than classic Quickcheck style property based testing.

If you want to know more about how it works, there is a rough design doc also checked in to this repo.

If you want to see some examples of usage, there's a collection of simple tests (most or all of which fail) in the repo demonstrating some common behaviours and approaches.

Community

Conjecture is very young and doesn't really have a community of its own, but discussion of it is extremely welcome in the Hypothesis Community.

In particular we have the IRC channel #hypothesis on Freenode.

Please note that there is a code of conduct in effect in this community and you are expected to adhere to it.

Development Status

Conjecture is currently not even alpha quality. It is very much a proof of the concept. I intend to make it into production ready software, but it's just not there yet. It's not even hanging out in the same time zone.

I'll be working on it a fair bit, but there's quite a lot to do and it's more likely to make progress if someone is interested in paying for the work.

Current limitations

  1. It is not particularly easy to write bindings which e.g. tie into a language's exception system rather than just crashing the process when you do something wrong.
  2. The quality of data generation is not particularly good - it's essentially what you would get out of a normal random number generator, which is not really optimal for triggering bugs.
  3. Shrinking is currently much slower than it should be.
  4. It has not been tested on any significant range of platforms and compilers - right now it's very much in a "works on my machine" stage. It is unlikely to work on anything that is not 64-bit Linux right now. It definitely will not work on Windows and I'm not currently sure how to make it do so.
  5. It hasn't really been tested much at all other than manually poking at it myself.

Licensing

Conjecture is licensed under the GPL v3. If you wish to use it under a different license, please contact me at [email protected].

conjecture-1's People

Contributors

bachmann1234 avatar drmaciver avatar ianh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.