Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Similarities and Differences Between PHPUnit and PHPSpec

I am currently doing research into which test framework I should be using for php. The two choices I have are PHPUnit and PHPSpec. I know that PHPUnit is TDD(Test driven development) and PHPSpec is BDD(Behavior driven development). However due to the lack of any real PHPSpec tutorial and limited documentation on the PHPSpec site I am unable to come to a full conclusion. My question to everyone is what are some addition similarities and differences between the two frameworks? Yes BDD and TDD are big ones but are there others? And they seem similar but no one talks about their similarities in great detail. Thank you.

like image 616
applecrusher Avatar asked Jun 19 '13 15:06

applecrusher


1 Answers

PHPSpec is a SpecBDD tool more dedicated to guide you in code design rather than a testing framework. It depends what you expect from tool and if you want to make a proper TDD/SpecBDD it's easier to use PHPSpec because it was created to help developers write readable and well designed code.

Remember that TDD/SpecBDD is not about testing all edge cases or doing whole-application-integration testing. It's about writing specifications for small units of code.

Few days ago I gave a talk on it, here you can find slides: http://www.slideshare.net/cakper/2013-0613-spug-spec-bdd-in-php I hope it will be useful to make a decision.

like image 93
Kacper Gunia Avatar answered Sep 21 '22 05:09

Kacper Gunia