{"id":13630801,"url":"https://github.com/pholser/junit-quickcheck","last_synced_at":"2025-12-17T00:52:32.926Z","repository":{"id":37925320,"uuid":"1001284","full_name":"pholser/junit-quickcheck","owner":"pholser","description":"Property-based testing, JUnit-style","archived":false,"fork":false,"pushed_at":"2024-04-15T12:34:10.000Z","size":18254,"stargazers_count":952,"open_issues_count":36,"forks_count":122,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-04-16T10:23:25.913Z","etag":null,"topics":["java","junit","property-based-testing","quickcheck"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pholser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2010-10-18T22:33:36.000Z","updated_at":"2024-04-22T05:30:14.129Z","dependencies_parsed_at":"2024-01-14T06:51:24.845Z","dependency_job_id":"28f99aa2-999c-48b4-ae46-735b1845eec0","html_url":"https://github.com/pholser/junit-quickcheck","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Fjunit-quickcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Fjunit-quickcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Fjunit-quickcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Fjunit-quickcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pholser","download_url":"https://codeload.github.com/pholser/junit-quickcheck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249360014,"owners_count":21257150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","junit","property-based-testing","quickcheck"],"created_at":"2024-08-01T22:01:59.639Z","updated_at":"2025-12-17T00:52:32.840Z","avatar_url":"https://github.com/pholser.png","language":"Java","readme":"[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.pholser/junit-quickcheck/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/com.pholser/junit-quickcheck)\n[![Build Status](https://travis-ci.org/pholser/junit-quickcheck.svg?branch=master)](https://travis-ci.org/pholser/junit-quickcheck)\n[![Code Quality: Java](https://img.shields.io/lgtm/grade/java/g/pholser/junit-quickcheck.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/pholser/junit-quickcheck/context:java)\n[![Total Alerts](https://img.shields.io/lgtm/alerts/g/pholser/junit-quickcheck.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/pholser/junit-quickcheck/alerts)\n\n\u003ca href=\"http://www.yegor256.com/2015/10/17/award-2016.html\"\u003e\n  \u003cimg src=\"http://www.yegor256.com/images/award/2016/winner-pholser.png\" width=\"203\" height=\"45\" alt=\"Software Quality Award 2016\"/\u003e\n\u003c/a\u003e\n\n# junit-quickcheck: Property-based testing, JUnit-style\n\njunit-quickcheck is a library that supports writing and running property-based\ntests in JUnit, inspired by QuickCheck for Haskell.\n\nProperty-based tests capture characteristics, or \"properties\", of the output\nof code that should be true given arbitrary inputs that meet certain criteria.\nFor example, imagine a function that produces a list of the prime factors of\na positive integer `n` greater than 1. Regardless of the specific value of\n`n`, the function must give a list whose members are all primes, must\nequal `n` when all multiplied together, and must be different from the\nfactorization of a positive integer `m` greater than 1 and not equal to\n`n`.\n\nRather than testing such properties for all possible inputs, junit-quickcheck\nand other QuickCheck kin generate some number of random inputs, and verify\nthat the properties hold at least for the generated inputs. This gives us\nsome reasonable assurance upon repeated test runs that the properties\nhold true for any valid inputs.\n\n## Documentation\n\n[Documentation for the current stable version](https://pholser.github.io/junit-quickcheck/index.html)\n\n## Basic example\n\n```java\n    import com.pholser.junit.quickcheck.Property;\n    import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;\n    import org.junit.runner.RunWith;\n\n    import static org.junit.Assert.*;\n\n    @RunWith(JUnitQuickcheck.class)\n    public class StringProperties {\n        @Property public void concatenationLength(String s1, String s2) {\n            assertEquals(s1.length() + s2.length(), (s1 + s2).length());\n        }\n    }\n```\n\n## Other examples\n\nAfter browsing the [documentation](#documentation), have a look at some\n[examples](examples) in module `junit-quickcheck-examples`. These are built\nwith junit-quickcheck.\n","funding_links":[],"categories":["Java","测试"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpholser%2Fjunit-quickcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpholser%2Fjunit-quickcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpholser%2Fjunit-quickcheck/lists"}