Comments (4)
This is actually not true. PropEr postconditions should be expressed in terms of the state prior to command execution (i.e. State, not State2).
The idea of "postcondition(S, C, Result) -> X" is to express constraints of the form:
when being in state S and performing call C, postcondition X should hold for the Result of the call.
from proper.
Oh. Weird. Although I think I see what you mean. For instance, [1] is some code to test basical add/lookup operations on a btree. Currently the postcondition for the add call is checking that the KVs added are present in the state (which seemed reasonable and lead me to think proper had the bug).
Given your comment, it sounds more like I should really only be making assertions about Result in that call. Plus one could argue that the current thing is really testing dict more than the btree I think. Does that sound right?
[1] https://gist.github.com/1364115
from proper.
I see what you mean, your assumption is reasonable. But then, it is also reasonable that you may want to check the Result of a call, given the context (i.e. state) in which that call was performed, not given the resulting state.
So in our approach, we assume that an error will be detected as an unexpected result of a call. Even if this is not captured
by a false postcondition right after the call, chances are high that it will become obvious sooner or later because of some state inconsistency. And then shrinking helps you identify it.
from proper.
Yeah, I'm pretty sure I see the zen there. I just had my initial assumption and then looked at the code and saw the post condition being evaluated after the state was updated and assumed it was a bug. I just needed that slight tweak to my understanding of what postcondition was for. Thanks again.
from proper.
Related Issues (20)
- ?FORALL_TARGETED does not work with ?TRAPEXIT
- No Shrink in TPBT
- run_parallel_commands doesn't handle exceptions in commands the same way run_commands does HOT 6
- PropEr map() generators
- PropEr should use `printer`. HOT 2
- Target server should update process dictionary
- Add proper examples to shrinking challenge
- New version and hex package HOT 13
- Generate a binary of variable size HOT 2
- Add more detailed installation instructions with Homebrew HOT 9
- Obtaining a PropEr rebar3 HOT 1
- use previous return value as parameter of new command in new state HOT 6
- Arguments shrinking is not working in stateful models. HOT 2
- {var,2} instead of the correct variable during shrink
- `proper_transformer` has unfavorable behavior for fine-grained compile dependencies HOT 4
- Generators inside maps
- Atom generator exhausts the atom limit HOT 4
- Substitute uses of `slave` with `peer` HOT 1
- {'EXIT', {badarg, [{erlang,atom_to_list, ...}]}} in proper_gen_next.erl
- Is there a new version to release? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proper.