Skip to content

giorgio-v/brioches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brioches

Let them eat cakes.

If you don’t get it, you don’t need to read further.

brioches.core-test

Clojure repo with to play with property-base testing. The brioches.core-test shows a rather boring example with concat. The main point of this example is showing how you can completely characterize the function with the basic algebraic properties.

One of these properties, namely assoc-closure?, shows that property-based testing can express and, more importantly, check rather subtle aspects of functions under test: concat returns a lazy seq and, by doing so, does not respect the algebraic closure property; on the other hand, we can relax the post-conditions by requiring that concat should return a Sequential collection.

concat is a very basic function but it shows how you can use property-based testing as a proxy of the quality of your design, something like traditional unit testing.

brioches.core

One of the most crucial aspects of property-based testing is the usage of generators. Here we show standard generators and generators built upon Prismatic’s Schema.

Usage

Just use

lein repl

and then issue

(reset)

to load the namespaces of the project.

Useful links

License

Copyright © 2014 Giorgio Valoti

Distributed under the Eclipse Public License, the same as Clojure.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published