 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Ibuildings techPortal: Beyond TDD with PHPSpec
by Chris Cornutt August 03, 2011 @ 09:41:20
On the Ibuildings techPortal today there's a new post from Marcello Duarte following up on his previous post looking at behavior driven development (here) with a look at PHPSpec, a port of RSpec that is the first PHP BDD framework.
PHPSpec is the first ever PHP BDD framework. It is a port of RSpec to PHP created back in 2007 by Padraic Brady and Travis Swicegood. Development in this framework stopped for a while and was reignited last August (2010).
He goes over how to get it installed via PEAR and how to write some sample tests following along the topic from his previous post (handing videos and reviews). He gets into a bit more detail by describing how MVC is handled with PHPSpec and how the Zend Framework command line tool can be used to create a controller that satisfies the test.
voice your opinion now!
behaviordriven development phpspec testdriven framework
DZone.com: PHPSpec BDD for your classes
by Chris Cornutt June 03, 2011 @ 08:57:12
In a new post to the "PHP on Windows" section of DZone.com, Giorgio Sironi looks at another testing tool to add to your arsenal - PHPSpec, a behavior-driven development testing tool similar to Ruby's RSpec.
Behavior-Driven Development can be seen as an evolution of Test-Driven Development, stricly in its outside-in version and with a refined language. In the case of the tool I'm reviewing today, BDD is implemented with code instead of with textual feature files (e.g. written in Gherkin) like in Behat. PHPSpec is similar to (or a port of) RSpec, the original BDD Ruby tool. It fills the need for an approach different from the classical xUnit at the class level.
He points out the place he thinks PHPSpec has in the software testing world as it fits with things like Behat and PHPUnit. He also includes some sample code to show it at work - a sample test that checks against an object for things like "should be an object" or "should not return the same number for multiples of three" for the basic class FizzBuzz.
voice your opinion now!
phpspec behaviordriven development testing unittest class
Padraic Brady's Blog: A Domain Specific Language for Behaviour Driven Development (BDD) in PHP
by Chris Cornutt 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.
voice your opinion now!
behaviour driven development phpspec domain specific language
Padraic Brady's Blog: The PHPSpec Zend Framework App Testing Manifesto ZF Integration
by Chris Cornutt January 21, 2008 @ 10:21:00
Continuing on from his preamble on the integration of the PHPSpec BDD tool into the Zend Framework, Padraic Brady has posted the next in the series - a look at what it would take to make the integration happen.
The ideal was to move away from line-by-line setup and manipulation of Zend instances towards a more simplified model which is standardised for any PHPSpec specs.
He's already created an "experimental branch" to work inside of and some of these updates have been made to the trunk for the release of PHPSpec 0.3.0. The key that he found was in getting the customization of the "Zend Context operational to set up elements of the FrontController". He also includes a simple example of the extended functionality in action - simple interface methods to work with Twitter.
voice your opinion now!
phpspec bdd zendframework integrate testing example
Padraic Brady's Blog: Mutation Testing Brain Dump
by Chris Cornutt November 30, 2007 @ 10:26:00
Padraic Brady has made a post about some of the mutation testing thoughts running through his head for the Behaviour-Driven Development framework he's been working on - PHPSpec.
Mutation Testing is like testing, for tests. The idea is actually quite simple. Mutation testing adds small changes to your source code on the assumption that changing something, will most likely break it, which in turn means at least one test/spec should fail. [...] The reason why it's useful it that it gets around the problem of being over reliant on code coverage - just because some code executes when running tests, doesn't prove the tests will detect problems with it!
He wants to create a way that doesn't rely on external dependencies and is looking at working with the tokenizer functions native to PHP. He includes two examples of the way he's thinking - an example of simple token output and a way to go "backwards" to recreate the original source code.
voice your opinion now!
mutation testing unittest phpspec tokenizer mutation testing unittest phpspec tokenizer
Padraic Brady's Blog: PHPSpec Reporting Gets A Needed Boost
by Chris Cornutt November 14, 2007 @ 14:25:00
Padraic Brady has made a few updates to the PHPSpec software he's developed in preparation for the first stable release - additions to the reporting functionality to give as much information as possible.
PHPSpec is closing in on its first stable release, so the time had finally come to spruce up its output! No more the simple reporting of failed specs - now you get a few more details in a readable format, exceptions and errors even come with traces. In addition, I've implemented specdoc output as an option (using "-s") so you can get a list of specs in their plain text form.
He's also included an example of the new output in the post as well, showing the results of both successful and errored responses. You can check out the actual spec files on the googlecode repository for the project and get more details on the project itself (including the latest development snapshots) on the project's website.
voice your opinion now!
phpspec reporting stable release spec snapshot phpspec reporting stable release spec snapshot
|
Community Events
Don't see your event here? Let us know!
|