PHPackages                             hoa/praspel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. hoa/praspel

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

hoa/praspel
===========

The Hoa\\Praspel library.

1.17.01.10(9y ago)4063.1k↓34.1%7[3 issues](https://github.com/hoaproject/Praspel/issues)4BSD-3-ClausePHP

Since Sep 16Pushed 9y ago11 watchersCompare

[ Source](https://github.com/hoaproject/Praspel)[ Packagist](https://packagist.org/packages/hoa/praspel)[ Docs](https://hoa-project.net/)[ RSS](/packages/hoa-praspel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (18)Used By (4)

 [![Hoa](https://camo.githubusercontent.com/2b5c32c5d4bc5e9298821b22d364a522e2dbc0295c1c011b1f9f86a4d07df07e/68747470733a2f2f7374617469632e686f612d70726f6a6563742e6e65742f496d6167652f486f612e737667)](https://camo.githubusercontent.com/2b5c32c5d4bc5e9298821b22d364a522e2dbc0295c1c011b1f9f86a4d07df07e/68747470733a2f2f7374617469632e686f612d70726f6a6563742e6e65742f496d6167652f486f612e737667)

---

 [![Build status](https://camo.githubusercontent.com/08502fbc3a1cd8c56104a78db31b68d74bea75f8de3ceb4e537ece4fade00429/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f686f6170726f6a6563742f7072617370656c2f6d61737465722e737667)](https://travis-ci.org/hoaproject/praspel) [![Code coverage](https://camo.githubusercontent.com/cae685347f2e377b8032e8b867d82c824b15f60e863fc4c1b0f9e9e8ce8402c9/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f686f6170726f6a6563742f7072617370656c2f6d61737465722e737667)](https://coveralls.io/github/hoaproject/praspel?branch=master) [![Packagist](https://camo.githubusercontent.com/fb1be96fd621dfc42deb30a4aed2a87f8eb29acbe6f4d61a1da2a4ab972d16e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686f612f7072617370656c2e737667)](https://packagist.org/packages/hoa/praspel) [![License](https://camo.githubusercontent.com/6fb1a28146b773ce846bf93115e987d69fc724685ebe944252eb491b07ce12dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f686f612f7072617370656c2e737667)](https://hoa-project.net/LICENSE)

 Hoa is a **modular**, **extensible** and **structured** set of PHP libraries.
 Moreover, Hoa aims at being a bridge between industrial and research worlds.

Hoa\\Praspel
============

[](#hoapraspel)

[![Help on IRC](https://camo.githubusercontent.com/4dbc9c9d28c30cf1ab591f4bb8212fe4dbddc734145df532a9bb86b09878d4c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f68656c702d253233686f6170726f6a6563742d6666303036362e737667)](https://webchat.freenode.net/?channels=#hoaproject)[![Help on Gitter](https://camo.githubusercontent.com/8c4c85951788ff606b1268cb3dd946be05e3054795455d0a7b9250711bc2ac05/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f68656c702d6769747465722d6666303036362e737667)](https://gitter.im/hoaproject/central)[![Documentation](https://camo.githubusercontent.com/7059ad5f1a363f9098686c59d432f01d7330aed9d4b6c8111d985fd64cfc6c60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63756d656e746174696f6e2d6861636b5f626f6f6b2d6666303036362e737667)](https://central.hoa-project.net/Documentation/Library/Praspel)[![Board](https://camo.githubusercontent.com/fd81654ba14b3aca3a713e1b471bc3fc3ba7b5bb3761ccffd6eea2e2ed1fa5ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f7267616e69736174696f6e2d626f6172642d6666303036362e737667)](https://waffle.io/hoaproject/praspel)

Praspel and the Realistic Domains
---------------------------------

[](#praspel-and-the-realistic-domains)

Praspel (PHP Realistic Annotation and Specification Language) is a **formal specification language** for PHP. It is based on the Design-by-Contract paradigm and uses preconditions, postconditions, invariants etc. Specifications are written in the comments of the PHP code. Praspel is used for manual, automated or **automatic software validation and verification**.

This language is inspired by [JML](http://www.jmlspecs.org/) but the difference is in the way to specify the data. PHP is dynamically and weakly typed. To specify the data, Praspel relies on **realistic domains**: Structures allowing to validate and generate data, with the ability to compose them to represent more **complex data**. Realistic domains are implemented in [the `Hoa\Realdom` library](https://central.hoa-project.net/Resource/Library/Realdom).

Data generators
---------------

[](#data-generators)

A contract can be used to automatically generate unit tests. A test is constitued of 2 parts: Test data, and an oracle. Test data are crucial since it must reflect “realistic” data as much as possible, and being to generate data at the limits is also very important. Realistic Domains is an answer to this problem by being able to generate integers, reals, strings (based on regular expressions or grammars for instance), arrays (based on a constraint solver) or objects, for the PHP language types. Thus, it is possible to combine these realistic domains to generate more sophisticated data (like dates, object models etc.).

Contract Coverage Criteria
--------------------------

[](#contract-coverage-criteria)

The contract language can be evaluated to validate and verify data manipulated by the program on one hand. On the other hand, we have algorithms able to automatically generate test data from a piece of a contract. In order to ensure whether the contract is correctly covered, we have defined several contract coverage criteria.

Thus, we are able to generate unit test suites satisfying these contract coverage criteria, and thus ensuring that generated unit test suites reflect all the behavior expressed in the contract.

Research papers
---------------

[](#research-papers)

This language is the result of several research papers, journals and PhD thesis.

- *Praspel: A Specification Language for Contract-Driven Testing in PHP*, presented at [ICTSS 2011](http://ictss2011.lri.fr/) (Paris, France) ([article](https://hoa-project.net/En/Literature/Research/Ictss11.pdf), [presentation](http://keynote.hoa-project.net/Ictss11/EDGB11.pdf)),
- *Grammar-Based Testing using Realistic Domains in PHP*, presented at [A-MOST 2012](https://sites.google.com/site/amost2012/) (Montréal, Canada) ([article](https://hoa-project.net/En/Literature/Research/Amost12.pdf), [presentation](http://keynote.hoa-project.net/Amost12/EDGB12.pdf), [details](https://hoa-project.net/En/Event/Amost12.html)),
- *A Constraint Solver for PHP Arrays*, presented at [CSTVA 2013](http://cstva2013.univ-fcomte.fr/) (Luxembourg, Luxembourg) ([article](https://hoa-project.net/En/Literature/Research/Cstva13.pdf), [presentation](http://keynote.hoa-project.net/Cstva13/EGB13.pdf), [details](https://hoa-project.net/En/Event/Cstva13.html)).

[Learn more](https://central.hoa-project.net/Documentation/Library/Praspel).

Installation
------------

[](#installation)

With [Composer](https://getcomposer.org/), to include this library into your dependencies, you need to require [`hoa/praspel`](https://packagist.org/packages/hoa/praspel):

```
$ composer require hoa/praspel '~1.0'
```

For more installation procedures, please read [the Source page](https://hoa-project.net/Source.html).

Testing
-------

[](#testing)

Before running the test suites, the development dependencies must be installed:

```
$ composer install
```

Then, to run all the test suites:

```
$ vendor/bin/hoa test:run
```

For more information, please read the [contributor guide](https://hoa-project.net/Literature/Contributor/Guide.html).

Documentation
-------------

[](#documentation)

The [hack book of `Hoa\Praspel`](https://central.hoa-project.net/Documentation/Library/Praspel)contains detailed information about how to use this library and how it works.

To generate the documentation locally, execute the following commands:

```
$ composer require --dev hoa/devtools
$ vendor/bin/hoa devtools:documentation --open
```

More documentation can be found on the project's website: [hoa-project.net](https://hoa-project.net/).

Getting help
------------

[](#getting-help)

There are mainly two ways to get help:

- On the [`#hoaproject`](https://webchat.freenode.net/?channels=#hoaproject)IRC channel,
- On the forum at [users.hoa-project.net](https://users.hoa-project.net).

Contribution
------------

[](#contribution)

Do you want to contribute? Thanks! A detailed [contributor guide](https://hoa-project.net/Literature/Contributor/Guide.html) explains everything you need to know.

License
-------

[](#license)

Hoa is under the New BSD License (BSD-3-Clause). Please, see [`LICENSE`](https://hoa-project.net/LICENSE) for details.

Related projects
----------------

[](#related-projects)

The following projects are using this library:

- [`atoum/praspel-extension`](http://central.hoa-project.net/Resource/Contributions/Atoum/PraspelExtension), Test data generation, and unit test suite generation inside atoum.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 97.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Recently: every ~90 days

Total

17

Last Release

3415d ago

Major Versions

0.15.09.08 → 1.16.01.142016-01-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/a410060743cec0e0d8654661b726a7a25f5888f18059d4c942a8fd9a8128f0da?d=identicon)[Hoa](/maintainers/Hoa)

---

Top Contributors

[![Hywan](https://avatars.githubusercontent.com/u/946104?v=4)](https://github.com/Hywan "Hywan (248 commits)")[![vonglasow](https://avatars.githubusercontent.com/u/1275202?v=4)](https://github.com/vonglasow "vonglasow (2 commits)")[![apiv-thomas](https://avatars.githubusercontent.com/u/53090992?v=4)](https://github.com/apiv-thomas "apiv-thomas (1 commits)")[![shulard](https://avatars.githubusercontent.com/u/482993?v=4)](https://github.com/shulard "shulard (1 commits)")[![stephpy](https://avatars.githubusercontent.com/u/232744?v=4)](https://github.com/stephpy "stephpy (1 commits)")[![jubianchi](https://avatars.githubusercontent.com/u/327237?v=4)](https://github.com/jubianchi "jubianchi (1 commits)")[![Bhoat](https://avatars.githubusercontent.com/u/4126670?v=4)](https://github.com/Bhoat "Bhoat (1 commits)")

---

Tags

constraint-solvercontract-based-testingcontract-coverage-criteriahoalibraryphppraspelrealistic-domainsspecification-languagetestingtestvalidationspecificationlibrarygenerationcontractpreconditionpostconditionpraspelinvariant

### Embed Badge

![Health badge](/badges/hoa-praspel/health.svg)

```
[![Health](https://phpackages.com/badges/hoa-praspel/health.svg)](https://phpackages.com/packages/hoa-praspel)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[leanphp/behat-code-coverage

Generate Code Coverage reports for Behat tests

50359.8k2](/packages/leanphp-behat-code-coverage)[quizlet/hammock

Hammock is a stand-alone mocking library for Hacklang.

27445.5k](/packages/quizlet-hammock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
