On Github AshtonKem / Conj-Talk
@ashton
My Wife Leah
The Conj Organizers
Countless open source contributors
Don't forget:Pivotal Labs
Pivotal Tracker
An agile project management tool. More reliable software: easier to reason & tests.Represent actions as data
Shrinking finds the minimal user actions to provoke a bug.
Trade blind hunting for code that searches for you
Canvasing the application as a whole can find missed errors.
Creates a very large regression net
We use JDBC for setup and assertions, replace with whatever driver you need
We use simple queries, if you need more power be very mindful of performance
Port of QuickCheck
Written by Reid Draper
(defspec first-element-is-min-after-sorting 100 (prop/for-all [v (gen/not-empty (gen/vector gen/int))] (= (apply min v) (first (sort v)))))This is from the Test.Check docs. More complicated examples left as an exercise to reader.
Functions to produce data
Simple or higher-ordered
{:story 2198 :type ::drag-drop :via ::selenium :args 2192}
(defspec drop-drop-spec 10 (prop/for-all [actions (gen/not-empty (gen/vector (gen/hash-map :type (gen/return ::drag-drop) :via (gen/return ::selenium) :story (gen/elements @story-ids) :args (gen/elements @story-ids))))] (perform-actions db project-id actions)))
Multimethods are your friends
(defmulti perform-action (fn [type via project-id story args] [type via]))
Separate context from action
Allow for different execution order (parallel, sequential)
Strategies must setup the environment for themselves
Assertions can be slower than actions
Generative tests are very sensitive to performance issues
Slower assertions reduce the number of runs you can do