Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eris Laravel Package

giorgiosironi/eris

Eris brings QuickCheck-style property-based testing to PHP and PHPUnit. Define properties, generate many random inputs, and find minimal counterexamples automatically. Works with PHP 8.1–8.4 and PHPUnit 10–13.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Shift from traditional unit testing to property-based testing (PBT) for critical business logic, reducing edge-case bugs by generating diverse test inputs programmatically.
  • Build vs. Buy: Opt for this package over custom PBT implementations to leverage a battle-tested, PHPUnit-integrated solution with shrinking capabilities.
  • Use Cases:
    • Financial systems: Validate invariants (e.g., "transaction totals must balance").
    • Data pipelines: Ensure transformations preserve constraints (e.g., "dates must not be in the future").
    • API contracts: Verify responses adhere to schemas or business rules.
    • Legacy codebases: Uncover hidden bugs in untested or poorly tested modules.
  • Roadmap Alignment:
    • Enable reproducible testing for CI/CD pipelines by fixing edge cases with deterministic shrinking.
    • Reduce manual test case writing for complex edge cases (e.g., nested data structures, random inputs).
    • Integrate with existing PHPUnit suites without disrupting workflows.

When to Consider This Package

  • Adopt if:

    • Your team relies on PHPUnit and needs automated edge-case discovery for critical logic.
    • You frequently encounter "works on my machine" bugs or unexpected input failures in production.
    • Your codebase handles complex data structures (e.g., nested arrays, dates, regex patterns) where manual testing is error-prone.
    • You’re willing to invest in training developers on PBT concepts (e.g., generators, shrinking).
  • Look elsewhere if:

    • Your team lacks PHPUnit experience or prefers BDD-style testing (e.g., Behat).
    • You need performance-critical testing (PBT can be slower than traditional tests).
    • Your use case is simple CRUD operations with well-defined inputs (traditional unit tests suffice).
    • You require GUI/interaction testing (use tools like Codeception or Laravel Dusk instead).

How to Pitch It (Stakeholders)

For Executives:

"Eris lets us automatically find bugs we’d miss with manual testing—like a stress test for our code. For example, if we’re processing payments, Eris can generate thousands of edge cases (e.g., fractional cents, malformed dates) to ensure our logic never fails in production. This reduces costly post-launch fixes and builds confidence in our systems. It’s like having a bug-hunting AI for our PHP codebase, with minimal upfront effort."

ROI:

  • Fewer production bugs → Lower MTTR (mean time to resolve).
  • Faster validation of complex logic (e.g., pricing engines, data migrations).
  • Future-proofing: Works alongside existing PHPUnit tests without disruption.

For Engineering Teams:

"Eris brings property-based testing (PBT) to PHP, inspired by Haskell’s QuickCheck. Instead of writing one test per edge case, we define invariants (e.g., ‘all user IDs must be positive integers’) and let Eris generate inputs to break them. When it finds a failure, it shrinks the input to the simplest case that still breaks the code—saving us hours of debugging.

Key Benefits:

  • Find bugs faster: Automatically explores edge cases we’d never think of.
  • Less flaky tests: Shrinking pinpoints the exact input causing failures.
  • Works with PHPUnit: No new toolchain needed; integrates seamlessly with existing tests.
  • Example: Instead of writing 10 tests for date validation, we write one property that Eris tests against 1,000+ inputs.

Getting Started:

  1. Add composer require --dev giorgiosironi/eris.
  2. Replace a traditional test like:
    $this->assertTrue(is_int($userId));
    
    With a property-based test:
    $this->forAll(Generators::nat())->then(fn($id) => $this->assertTrue(is_int($id)));
    
  3. Let Eris find the smallest $id that fails—often revealing a hidden bug in our logic.

Trade-offs:

  • Steeper learning curve than traditional tests (but worth it for critical systems).
  • Slower test runs (mitigate by running PBT in CI for high-risk modules only).

Proposal: Pilot Eris on one high-risk module (e.g., payment processing) to measure bug detection improvements."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony