Difference between revisions of "Property Based Developer Testing"

From CitconWiki
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
  
 
Proposed by [[Paul Holser]]
 
Proposed by [[Paul Holser]]
 +
 +
* Amounts to adding "for-all" style assertions about a function to some "there-exists" style tests.
 +
* Works best on already-TDD'ed code. TDD builds up designs example by example. Hard to see the "for-all" statements without data point to triangulate from.
 +
* Agitar does something similar -- execute code using lots of different kinds of inputs, possibly deriving interesting data points by inspecting the test subject itself...
 +
* Works well on already "math-y" domains
 +
* Drives you, if you're paying attention, away from Primitive Obsession and modeling things like SKUs, Prices, SSNs, etc. as first-class concepts. Otherwise generators miss too much, or try to create invalid things.
  
 
= Literature =
 
= Literature =
 +
* [http://natpryce.com/articles/000802.html Property Based TDD at SPA 2013]
 +
* [http://shareandenjoy.saff.net/tdd-specifications.pdf The Practice of Theories: Adding "For-all" Statements to "There-exists" tests]
 
* [http://debasishg.blogspot.com/2012/07/property-based-testing-for-domain-models.html Property based testing for domain models]
 
* [http://debasishg.blogspot.com/2012/07/property-based-testing-for-domain-models.html Property based testing for domain models]
 
* [http://blog.jessitron.com/2013/04/property-based-testing-what-is-it.html Property-based testing: What is it?]
 
* [http://blog.jessitron.com/2013/04/property-based-testing-what-is-it.html Property-based testing: What is it?]
Line 9: Line 17:
 
* [http://www.slideshare.net/FranklinChen/handout-18644963 Beyond xUnit exampled-based testing: property-based testing with ScalaCheck]
 
* [http://www.slideshare.net/FranklinChen/handout-18644963 Beyond xUnit exampled-based testing: property-based testing with ScalaCheck]
 
* [https://gist.github.com/npryce/4147916 Property-Based Testing Tools]
 
* [https://gist.github.com/npryce/4147916 Property-Based Testing Tools]
 +
* [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.208.6016&rep=rep1&type=pdf Theory-infected: Or How I Learned to Stop Worrying and Love Universal Quantification]
  
 
= Tooling: =
 
= Tooling: =

Latest revision as of 08:52, 26 August 2013

Session at CITCONNA2013Sessions

Proposed by Paul Holser

  • Amounts to adding "for-all" style assertions about a function to some "there-exists" style tests.
  • Works best on already-TDD'ed code. TDD builds up designs example by example. Hard to see the "for-all" statements without data point to triangulate from.
  • Agitar does something similar -- execute code using lots of different kinds of inputs, possibly deriving interesting data points by inspecting the test subject itself...
  • Works well on already "math-y" domains
  • Drives you, if you're paying attention, away from Primitive Obsession and modeling things like SKUs, Prices, SSNs, etc. as first-class concepts. Otherwise generators miss too much, or try to create invalid things.

Literature

Tooling:

Java

Scala

Python

Ruby

Haskell

Erlang