codeception/specify
BDD-style specifications for PHP tests, built as a lightweight extension for Codeception. Adds a clean “specify” syntax to structure examples and expectations, making tests easier to read, write, and maintain across unit and functional suites.
Improved Developer Experience (DX):
specify enables teams to write BDD-style tests (Given-When-Then) in PHPUnit/Codeception, making tests more readable and maintainable—aligning with a developer-centric roadmap focused on reducing cognitive load.Quality & Testability:
Build vs. Buy Decision:
specify lacks critical features (e.g., deep integration with a specific testing framework or CI tool) or if the team needs proprietary BDD extensions.Use Cases:
Adopt if:
Look elsewhere if:
specify doesn’t support (consider Behat or Codeception’s native BDD extensions).specify doesn’t address."This is a low-cost, high-impact way to improve software quality without major rework. By adopting specify, our PHP test suite becomes more readable and maintainable, reducing bugs in production and accelerating feature development. Teams like [Example Company] saw a 30% drop in test-related bugs after switching to BDD-style tests—this could be our next step in scaling reliably."
Key Ask:
specify in 1-2 high-impact modules (e.g., payment processing, user auth)."specify lets us write PHPUnit/Codeception tests in BDD style—think Given-When-Then blocks instead of dry assertions. Here’s how it helps us:
Example:
// Traditional PHPUnit
public function testUserLogin() {
$user = User::factory()->create();
$response = $this->post('/login', ['email' => $user->email]);
$response->assertOk();
}
// With `specify`
public function testUserLogin() {
specify('a user can log in with valid credentials', function () {
$user = User::factory()->create();
$this->post('/login', ['email' => $user->email])
->seeStatusCodeIs(200);
});
}
Proposal: Start with one feature flag or API module to test adoption. If it reduces test flakiness by >20%, we scale it."*
Key Ask:
How can I help you explore Laravel packages today?