NYCPHP Meetup

NYPHP.org

[nycphp-talk] Unit Testing with PHP: PHPUnit and Selenium

David Krings ramons at gmx.net
Wed Dec 28 08:45:38 EST 2011


On 12/27/2011 1:38 PM, Nelly Yusupova wrote:
> Hello Everyone,
>
> We are setting up an environment for running unit tests for our PHP application.
>
> We installed PHPUnit testing framework and were thinking of using it with
> Selenium.

Hi!

While I have no experience with these two test frameworks, I did use automated 
test tools and test frameworks before and my experience so far is that you 
just end up with more code that contains bugs, the ones in your code and the 
ones in the test tool. Nevertheless, I see a place for automated testing, but 
that is not in new development. Write detailed test plans for all new 
development and run the first few rounds of testing manually, from unit test 
for functional tests to whatever else someone came up with a name for test. 
Once you have documented evidence that the code is fine and fulfills all the 
requirements, then use the test plans to write the automated tests. Once the 
automation is in place, run it and test the results it produces against the 
test plan. Only after the manual and automatic text results match you can 
continue using exclusively the automated tests, which are then only running 
against established code and are used to make sure that any new development 
doesn't break any existing functionality. And those tests are then done in a 
matter of minutes saving time.
Maybe this is the approach you already take, but many consider automated 
testing a 1:1 replacement for manual testing and writing test plans. While 
there may be some amount of problems detected that way, you will miss a lot. 
In either case, which procedure is to be used to test the test scripts? 
Automated testing? You need to put in a lot of effort up front to get reliable 
results from automated testing. The question is then if there is a point to 
that when products have a live span of a year, like most of the hot new web 
apps. There is no point in extensive testing when the whole thing is outdated 
shortly after, which is the reason why many (not all) of the Google and FB 
products (to just name a few) are of mediocre quality. It is a business decision.

Just my 2 cents from over a decade of QA work....

David



More information about the talk mailing list