Central Iowa Software Symposium

August 2 - 4, 2013

Generative Testing

Sunday - Aug 4 11:00 AM - Woodbury

Stuart Halloway

Stuart Halloway

President of Cognitect

Traditional automated testing approches combine input generation, execution, output capture, and validation inside the bodies of single functions. Generative testing approaches gain expressive power by isolating these steps.

With generative testing:

  • a generator is a declarative description of possible inputs to a function
  • execution is up to your program
  • outputs are data, and can be captured for future study
  • validators are programs that have access to the generators, the program, and the outputs

There are a number of benefits to this approach:

  • once test data generation is separate, it is immediately obvious that such data generation should be statistical, not merely a few hand-picked cases
  • validators can be reused in a variety of
  • it becomes easier to identify and develop declarative, logic-based validations, rather than imperative ones
  • the various phases can be decoupled and run at different times

This talk introduces test data generation and generative testing, using for its examples the data.generators and test.generative libraries developed by the author.


Video Preview

About Stuart Halloway

Stuart Halloway is a founder and President of Cognitect, Inc. (www.cognitect.com). He is a Clojure committer, and a developer of the Datomic database.

Stuart has spoken at a variety of industry events, including StrangeLoop, Clojure/conj, EuroClojure, ClojureWest, SpeakerConf, QCon, GOTO, OSCON, RailsConf, RubyConf, JavaOne, and NFJS.

Stuart has written a number of books and technical articles. Of these, he is most proud of Programming Clojure.

Learn more about Stu's presentations on his wiki.