Page 1 of 1
PHPSpec 0.2.0beta Released
Posted: Mon Jan 07, 2008 11:38 am
by Maugrim_The_Reaper
Some self-promotion

. I just released PHPSpec 0.2.0beta which is the first Behaviour-Driven Development (BDD) framework for PHP. The release has several rough edges but is otherwise reasonably feature complete (0.3.0 will be much nicer) and free of any known holdup bugs.
You can read the official announcement on my blog:
http://blog.astrumfutura.com/archives/3 ... eased.html
There's a manual over at:
http://dev.phpspec.org/manual
And some real life examples as part of the PHPMock project:
http://phpmock.googlecode.com/svn/branc ... raic/specs
There's even a mailing list hosted by Google Groups:
http://groups.google.com/group/phpspec-dev
If you haven't heard of BDD yet, it's basically an evolution or repackaging of TDD and several other XP concepts which is aimed at improving the adoption rate and practice of designing code by focusing on behaviour and specifications. It's a confusing point when learning TDD that it somehow is focused on testing (technically untrue). BDD shifts the focus to specifying behaviour before code - which helps maintain a far more straightforward intuitive approach which tends to be more consistent with a reduced learning curve.
Once a full 0.2.0 stable is prepared, PHPSpec will begin integrating with several other packages undergoing planning such as PHPMock (which is also scheduled for integration with PHPUnit 4) and PHPMutagen (Mutation Testing), and also Autotest for PHP (which means less fiddling around with a console, and more time coding!).
Posted: Mon Jan 07, 2008 12:23 pm
by Kieran Huggins
Wow - congratulations Pádraic!
Posted: Mon Jan 07, 2008 2:06 pm
by Ollie Saunders
In my brief involvement in the PHPSpec (I committed no code) I got to see Maugrim in action and I can safely say that PHPSpec is *very* well written. I swear you must be genius Maugrim to write some much stuff of such a high standard in such a short amount of time. I'm quite jealous. Well done
So check it out, it has my seal of approval. If I was still doing PHP things I would be using PHPSpec lots.
Posted: Mon Jan 07, 2008 3:22 pm
by Maugrim_The_Reaper
Thanks, guys

.
Posted: Wed Jan 09, 2008 10:09 am
by Maugrim_The_Reaper
A stable release of PHPSpec 0.2.1 has now been released. New to the stable version is a HTTP Runner (see manual), about 5 bug fixes, and a Japanese translation of the manual. Lots of other misc improvements ranging from small tweaks to minor refactorings are also included.
Posted: Wed Jan 09, 2008 10:53 am
by Luke
This is awesome. I'm going to download it tonight... I'll let you know what I think. I was trying to follow the development of this, but I've been busy. Let me know when/if you need any publicity... I'd be happy to link ya (not that my site is all the popular, but anything helps)

Posted: Wed Jan 09, 2008 12:36 pm
by Ollie Saunders
Let me know when/if you need any publicity
He won't. He's on Zend Developer Zone.
Posted: Wed Jan 09, 2008 12:43 pm
by Luke
yea I noticed that... very cool

Re: PHPSpec 0.2.0beta Released
Posted: Fri Jan 11, 2008 2:59 am
by Maugrim_The_Reaper
A little publicity harms no-one

. It's only the first stable release - there is still work ahead to improve the documentation (I quite like the current manual but we were pressed for time so it's smaller and less detailed than it could be) and how PHPSpec performs in practice. Being such an early release the main concerns from my perspective is solidifying conventions - how to name, organise, and mix specs to be as productive as possible. Hoping to have that complete for 0.3.0 in a few weeks. For the moment I'm intent on making a new release at high speeds since people are starting to use it, and I'm already getting patches for small improvements.
Re: PHPSpec 0.2.0beta Released
Posted: Sat Jun 28, 2008 2:44 am
by dreamscape
Hey Maugrim,
Great to see some other developers trying to get some BDD tools for PHP out there. =)
A few concerns/questions/issues that I have:
1. In
the first example shown in the manual, the spec is actually running on a different context than it is defined in. I'm not sure it's good practice to do this. Specifications are granular at the context level, i.e., all specs in a given context should be specific to that context. If they invoke a new context (in this case, the context is being changed from a new game to a gutter game), then a new context should be created and the specification should belong to that context. That's just what I think though. Could be wrong though.
2. I noticed you're not using PHPSpec itself for specing/testing PHPSpec. Any reason behind this? That would be the ultimate example/proof of concept, IMO.
Re: PHPSpec 0.2.0beta Released
Posted: Sat Jun 28, 2008 4:03 am
by Ollie Saunders
2. I noticed you're not using PHPSpec itself for specing/testing PHPSpec. Any reason behind this? That would be the ultimate example/proof of concept, IMO.
I think the reason for this is due to the chicken/egg problem there.
Re: PHPSpec 0.2.0beta Released
Posted: Sat Jun 28, 2008 9:12 am
by dreamscape
ole wrote:2. I noticed you're not using PHPSpec itself for specing/testing PHPSpec. Any reason behind this? That would be the ultimate example/proof of concept, IMO.
I think the reason for this is due to the chicken/egg problem there.
There's not really a chicken/egg problem though. Specs always come first. There is a problem of Specs not being runnable until the runner part of the framework is in place, but that is the only issue, and encompasses such a small part of the overall framework, it's hard to swallow as the reason for not specing on the framework itself.
Not to mention that if you consider a fatal error to be an unimplemented spec, the issue goes away all together. You're just missing pretty spec result output until the base runner is working. Or if you're a stickler, you could use a different framework for that part and once in place start writing specs on the framework for the rest of the functionality.
A lot of both TDD and BDD frameworks write the functional tests/specs for the framework on themselves.
Re: PHPSpec 0.2.0beta Released
Posted: Sat Jun 28, 2008 6:04 pm
by Ollie Saunders
Hmm maybe. The separation from the interface that you get by using another tool during initial development is pretty invaluable, I'd say. Otherwise you'll be permanently going by an updating old specs as the library evolves. You can't code to an API that is a moving target.
Having written the library you could go back and change all the old specs but that's an additional workload, you could make mistakes, plus it's not very BDD to write specs afterwards functional code. Would it really be worth it just as proof of concept - decent tutorials and demos are more effective proof of concept IMO. What would such a thing really prove? A spec library that can spec itself could be useless for speccing anything else; theoretically. It wouldn't be a big selling point for me.
Also I think there's a danger of false positives; specs passing when they should fail. This would most likely be due to a bug in the spec library that prevents the usage of the library from identifying the bug in itself.