github.com/sgepigon/piggy ↗
Test for spec compatibility and breaking changes.
Open this visualization on its own page →
Contributors
1
Lines of Code
113
From
2018-08-01
To
2019-11-25
About sgepigon/piggy
Piggy is a Clojure library for detecting breaking changes in clojure.spec specifications. It provides compatibility testing tools that help developers understand when spec updates introduce incompatibilities, such as weakening promises about return types or strengthening requirements on arguments.
The library introduces two main spec combinators: `compat` for comparing simple specs and predicates, and `fcompat` for comparing function specifications. These work alongside standard clojure.spec functions like `conform`, `unform`, `explain`, and `gen`, allowing developers to test whether modifications to specs maintain backward compatibility. The library is designed around property-based and generative testing approaches to catch spec incompatibilities programmatically.
The project emerged during the alpha period of clojure.spec and serves developers who need to evolve their API contracts safely, particularly when dealing with complex functions like variadic operations or polymorphic number handling. It addresses real-world scenarios where changing from basic specs to more flexible ones can inadvertently break compatibility guarantees.