Using a generative test library in clojure vs build your own using higher order functions -


Closer has many libraries, such as generating testing, or

It is possible to use higher command functions such as compose to create random data generators:

  (defn gen [create-fn content-fn lazy] ( Fn [] (# lower -fn% 1% 2) (for [a lazy] (content-fn))) (def one (gen str # (rand-nth [\ a \ b \ c]) ( Limit 10)) (DEF B (Normal vector # (Rand-At 10) (Range 2)) (B) (Diff C (Gene hash-set B (category (RAND-int10))) () C)   

This is just an example and modified with data parameters, filters, partial etc. Can be obtained in order to be flexible enough data creation functions.

Is there anything that can do this to any productive libraries, by typing some high order tasks, not even in the form of short (or more)?

As an aside for the Stackworflow deities: I do not believe this question is subjective. I am not asking for any opinion on which the library is better. I want to know that specific feature (or) (techniques) of any / all data generative libraries separates them from making vanilla high order functions. In response to an example, using any libraries should clarify the generation of random data, as I have said that by preparing the HOF it would be more complicated to do this so that I did this in the way described above.

test.check better method most especially, the value Take that you generate a random list of 100 elements, and fails your exams: The list you handled that list is wrong. now what? How do you find the original bug? It really does not depend on those 100 inputs; You may possibly reproduce it with a list of some elements or an empty list if something in your base case is wrong.

This feature that really makes sense, it is not a random generator, it is "shrinking" of those generators, once test.check finds the input that breaks your tests, this input can be as much as possible Try to make that simple, while still breaking your test. For a list of integers, the contracts are quite simple, you can probably do them yourself: remove any element, or reduce any element. Switch to even it really can not be too: Maybe I want to select the order of the hard work I, I know. And for larger input, such as from the vector to the 3-topless list of the map [string, int, keyword] you will find it completely inconvenient, while test.check has already done all the hard work.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -