I.e. For all x, Fib(x+2)=Fib(x)+Fib(x+1)
A property based test produces values of x and tests this property (or invariant).
If it fails the framework usually then tries to find the simplest failing case.
That said, there are plenty of cases where your reaction is justified, where the test is implemented the same way as the function it's testing when the correctness property could be specified more simply.
Property based tests fuzz test values you may not have dreamed of. Given a string as the required type it could generate some exotic stuff.
Even outside that special case it is always possible to generate just some input data and check for the absence of runtime errors or exceptions. That approach can be improved by adding assertions, pre- and postconditions to your code under test.
Additionally, there a different ways to come up with good properties, see: https://www.youtube.com/watch?v=zvRAyq5wj38
* Test the externally visible useful properties of your system, rather than implementation details. Related: don’t bother with mocks unless there’s no other way
* Keep your tests DRY: if there’s some invariant you want to check have it appear once in your test code
* Don’t over-test: you can delete tests and checks that fully overlap with other tests
* If you need to over-test make it easy to regenerate the expected results from your implementation (characterisation tests) as espoused by the article. * the amount of testing effort should be proportional to how important the functionality is. Reduce the effort for low impact features
I'm still on the fence about that but I'm not sure how else to test something that is essentially a glorified algebra formula.