News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Padraic Brady's Blog:
A Domain Specific Language for Behaviour Driven Development (BDD) in PHP
July 21, 2008 @ 11:13:35

Padraic Brady has posted about a part of his PHPSpec library, the domain specific language.

PHPSpec implements a domain specific language (DSL) in PHP for specifying the behaviour of functional units such as methods and objects. The purpose of a DSL was to move away from the xUnit style declaration of tests towards a specification language centred on describing behaviour.

He illustrates with a bowling example - described with a sample class (with a itShouldScore0ForGutterGame test) and how to use it to fit his proposal:

My proposal therefore is to re-implement the current programming language DSL as a specification language - i.e. a new (extremely limited and narrow!) language capable of being parsed by PHPSpec into its PHP equivalent. [...] Using a specification DSL, we can simply ignore the existence of classes in PHP (well, the pretense is nice). Instead the DSL would incorporate a syntax for denoting shared behaviours.
0 comments voice your opinion now!
behaviour driven development phpspec domain specific language


blog comments powered by Disqus

Similar Posts

php|architect: PHP is not a Swiss Army Knife, quit calling it that.

Java.Sys-con.com: Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?

PHP-GTK Community Site: Anubis (a PHP-GTK RAD/IDE Tool)

Padraic Brady's Blog: Any Behaviour-Driven Development Tools for PHP?

Padraic Brady's Blog: ext/snarl: PHP interface to the Windows Snarl Notification Tool API


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe introduction series community laravel release install opinion list unittest interview symfony2 podcast developer refactor framework code language testing api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework