Comments (3)
To chime in from the side, @CppCoderGermany, please care to read what Property-Based Testing (the link is from the Home area of the main web site) is all about. TL;DR: You want to test general properties of your code that should hold, e.g. if you append two Strings then the length of the resulting String is always the sum of the lengths of the two input Strings, regardless of which Strings you choose. Or if you add two positive integers then the sum is always positive (which will not be true, if you write the jqwik test for it).
Addendum: To actually answer your question: jqwik tests the property “every third element starts with fizz” for (by default) 1000 random samples, your code is equivalent to 100 examples for the first 100 elements. The properties “every fifth element contains buzz” should probably also be tested ;-) The nice thing here is that you can derive these properties directly from the problem specification.
from jqwik.
Thanks to @rkraneis for your comment.
I will give it a try.
from jqwik.
BTW, one of the next main features I will tackle is exhaustive generation of parameters, so that when you specify something like:
@ForAll @IntRange(min = 1, max = 100) int
all parameters (or combinations thereof) will be generated - up to a certain limit. That would functionally be equivalent to your code in fizzBuzz_startsWithFizzEach3thItem_shallBeTrue
.
from jqwik.
Related Issues (20)
- Every X years in @YearRange HOT 1
- Allow parallel test runs with SBT HOT 15
- Infinite action chains biased towards small sizes HOT 5
- 1.8.0 contracts regression HOT 16
- IllegalArgumentException: "At least one shrinkable is required" during shrinking hides cause of test failure HOT 4
- Consider supporting @UseType for sealed interfaces HOT 8
- Shrinking of large arrays uses a very large amount of memory HOT 11
- StackOverflowError when shrinking large arrays HOT 14
- question: any way to imperatively summon a pre-configured arbitrary? HOT 15
- Make nested groups work for JDK >= 18 HOT 31
- Combinators.combine.as nullability of arguments HOT 4
- Can't figure out how to create an Arbitrary I want HOT 10
- Bug: Arbitraries.strings().uniqueChars() will sometimes shrink to values with duplicate chars HOT 5
- Bug: Uniform Distribution of Integers does not work if range is >= Integer.MAX_VALUE HOT 2
- Kotlin K2 Support HOT 23
- Time Module: Support generating java.sql.Timestamp
- adding `jqwik-kotlin` causes existing tests written in java to fail with NPE HOT 18
- Potential idea for running `SAMPLE_FIRST`/`SAMPLE_ONLY` for stateful tests HOT 2
- Lifecycle method called twice when subclassing HOT 4
- Cannot use Arbitrary.generator() outside jqwik HOT 6
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 jqwik.