Giter Club home page Giter Club logo

Comments (3)

rkraneis avatar rkraneis commented on July 20, 2024

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.

DevBoxFanBoy avatar DevBoxFanBoy commented on July 20, 2024

Thanks to @rkraneis for your comment.

I will give it a try.

from jqwik.

jlink avatar jlink commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.