https://speakerdeck.com/ohbarye/unlocking-potential-of-prope...
Speaking of my personal story, I used the fast-check documentation and Fred Herbert's book (their links are in the README) to study.
88 karma · joined January 12, 2019
https://speakerdeck.com/ohbarye/unlocking-potential-of-prope...
Speaking of my personal story, I used the fast-check documentation and Fred Herbert's book (their links are in the README) to study.
Pbt.assert do
Pbt.property(name: Pbt.printable_string, age: Pbt.integer(min: 0, max: 100)) do |name:, age:|
user = User.new(name: name, age: age)
# write your test here
end
end- Create a test case that doesn't depend on PBT as you suggest.
- Fix the production code being tested since its failure is an unexpected bug.
- Fix the PBT itself. This means that the programmer has had wrong assumption for the test target.
I think it's difficult for the tool to know which choice is the best on a failure. But if there's any good idea, I'd like to incorporate it. :)
Correct. The test inputs are determined by a seed and generators (including the order of generators).
In my opinion, PBT should be used in combination with example-based testing. Besides, since example-based testing cases account for the majority of tests, I think it's rare that PBT's execution time is dominant.
As for the combination and usages, refs: https://medium.com/criteo-engineering/introduction-to-proper...
This gem doesn't aim to reimplement a testing framework. It can also be considered just an assertion. You can use this alongside any testing framework like RSpec, minitest, and etc.