New unit testing framework?

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

New unit testing framework?

Post by Luke »

Does anybody know if a newer testing framework than PHPUnit / simpletest is being developedor has been developed? I mean, these work fine, but they just seem out-dated and neither have the most ideal interface. I'm a little surprised these two libraries are the best PHP has to offer. Don't get me wrong, I love simpletest, but I'm just convinced it could be done much better.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: New unit testing framework?

Post by Jenk »

Maugrim was working on PHPSpec, I don't know how far along it came.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: New unit testing framework?

Post by Luke »

It looks like the last release was in January though :(
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: New unit testing framework?

Post by Christopher »

It looks like SimpleTest is not in very active development. The last release was 8 Apr 2008. There is a Contribute Page for a 1.1 release, but it's been almost 9 months since the 1.0.1 release. Perhaps you could contact Marcus Baker, Perrick Penet or Travis Swicegood to see if they are looking for someone to pick-up development. I know Chris Corbyn contacted them when he started his YayMock project. Perhaps Chris has more info on contributing.
(#10850)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: New unit testing framework?

Post by Luke »

I wish I understood the problem well enough to write my own, but I'm still just trying to learn how to unit test my code, there's no way I could write a unit test framework. :lol:
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: New unit testing framework?

Post by Chris Corbyn »

SimpleTest is in active development I can assure you that ;) 1.1 beta is due out shortly.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: New unit testing framework?

Post by Christopher »

Any of your YayMock ideas or other goodies make it in that you'd care to share?
(#10850)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: New unit testing framework?

Post by Luke »

Oh yay! :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: New unit testing framework?

Post by Chris Corbyn »

arborint wrote:Any of your YayMock ideas or other goodies make it in that you'd care to share?
I have to admit, I haven't really had any time to devote to it since being added to the developers list. I'll contribute eventually though. I do read all the developer emails so have an idea of what's going on though.

I am still chipping away at Yay mock behind the scenes though since it's used throughout the Swift Mailer unit tests (as you know) :)

EDIT | Too much red wine and festivities... how many times can you say "though" in a forum post though? ;)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: New unit testing framework?

Post by Luke »

Actually I haven't looked at Yay! Mock in quite some time. I think using it along with simpletest may actually alleviate a lot of the short-comings of simpletest. I don't fully understand how it works yet, but I will play around with it.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: New unit testing framework?

Post by Chris Corbyn »

The Ninja Space Goat wrote:Actually I haven't looked at Yay! Mock in quite some time. I think using it along with simpletest may actually alleviate a lot of the short-comings of simpletest. I don't fully understand how it works yet, but I will play around with it.
I haven't pushed any changes live for while so there's not much to see online. I thought it was wise to get iron out the annoyances (not bugs, just long-winded-ness) before promoting it heavily. There are little things that bug me about the interface that are easily resolved. For example, why this:

Code: Select all

$context->checking(Expectations::create()
  -> one($mockA)->someMethod($arg1, any(), optional())
  -> exactly(3)->of($mockB)->otherMethod()
);
When I could simplify it to this?

Code: Select all

$context->checking()
  -> one($mockA)->someMethod($arg1, '*', '?')
  -> exactly(3)->of($mockB)->otherMethod()
  ;
 
I effectively cloned the jMock API as a base, and now I'm working from that towards a simpler solution that uses a PHP interface.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: New unit testing framework?

Post by Luke »

I was actually wondering the same thing. I haven't done much Java development, but I do kind of know what you mean. I have ported a few things from python, and sometimes the interface just doesn't make sense in PHP.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Re: New unit testing framework?

Post by Ambush Commander »

We (as in Marcus and Perrick) are currently working on getting the documentation up to speed with the latest release, after which 1.1beta will be released (and in SimpleTest tradition, be as stable as betas come.)

Ninja, I'm curious to know what you find "out-of-date" with SimpleTest and PHPUnit.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: New unit testing framework?

Post by Luke »

Hmm... I was under the impression that simpletest didn't get that much attention but I guess that's not the case.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: New unit testing framework?

Post by Christopher »

Ambush Commander wrote: I'm curious to know what you find "out-of-date" with SimpleTest and PHPUnit.
I think Mocks and Specs are two areas were a number of projects have moved past SimpleTest in thinking about how tools can support TDD. My impression of those projects was that they were built because the person couldn't get SimpleTest to do what they wanted it to do.
(#10850)
Post Reply