https://github.com/parapluu/target
https://github.com/parapluu/target
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/parapluu/target
- Owner: parapluu
- License: other
- Created: 2015-07-11T13:30:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-07T16:18:33.000Z (almost 9 years ago)
- Last Synced: 2025-01-09T03:41:57.790Z (about 1 year ago)
- Language: Erlang
- Size: 251 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/parapluu/target)
# Target - Targeted Property-Based Testing
Target adds a search-based strategy component to PropEr's input generation
process, which helps in finding counterexamples faster in properties that
aim to maximize (or minimize) the value of some variable of the property.
## Simple Example
```Erlang
-include_lib("proper/include/proper.hrl").
-include_lib("target/include/target.hrl").
prop_example_target() ->
?TARGET_STRATEGY(target_sa,
?FORALL(X, ?TARGET(target_sa:float(0.0, 10000.0)),
begin
?MAXIMIZE(X),
X < 9990.0
end)).
%% prop_example() ->
%% ?FORALL(X, float(0.0, 10000.0), X < 9990.0).
```
Target will be able to falsify properties like these much faster than vanilla
PropEr.
```Erlang
put(target_sa_steps, 10000).
proper:quickcheck(prop_example_target(), 10000).
```