Posts

Introduction to TDD

Image
1.  What is TDD ? The steps of test first development (TFD) are overviewed in the  UML activity diagram  of  Figure 1 .  The first step is to quickly add a test, basically just enough code to fail.  Next you run your tests, often the complete test suite although for sake of speed you may decide to run only a subset, to ensure that the new test does in fact fail.  You then update your functional code to make it pass the new tests.  The fourth step is to run your tests again.  If they fail you need to update your functional code and retest.  Once the tests pass the next step is to start over (you may first need to refactor any duplication out of your design as needed, turning TFD into TDD). Figure 1. The Steps of test-first development (TFD) . I like to describe TDD with this simple formula:    TDD = Refactoring + TFD. TDD completely turns traditional development around. When you first go to implement a ne...

Why Hiring a Slapper works

http://hackthesystem.com/blog/why-i-hired-a-girl-on-craigslist-to-slap-me-in-the-face-and-why-it-quadrupled-my-productivity/

Dev owns testing, Dev owns quality, really?

http://blogs.msdn.com/b/billliu/archive/2012/09/03/dev-owns-testing-dev-owns-quality-really.aspx

Treb - A simple framework for PHP

Introducing: Treb – A simple framework for PHP http://eliw.wordpress.com/2012/08/31/introducing-treb-a-simple-framework-for-php/

Object Scoping

http://blog.ircmaxell.com/2012/08/object-scoping-triste-against-service.html

Validating Emails in PHP

A very quick snippet today because I've told two people to use this approach in the last few days and both of them told me they didn't know about it. How to check if an email address is valid in PHP: use one of the  Filter functions , like this:   $email1 = "nonsense.something@dottiness" ; // not a valid email $email2 = "dotty@something.whatever" ; // valid email   $clean_email1 = filter_var ( $email1 , FILTER_VALIDATE_EMAIL ) ; // $clean_email1 = false $clean_email2 = filter_var ( $email2 , FILTER_VALIDATE_EMAIL ) ; // $clean_email2 = dotty@something.whatever The Filter extension was new in PHP 5.2, but is one of the unsung heroes of the language. It's rare for me to ever describe one approach as the "right" way to do something - but for validating data, Filter really is excellent, offering both validating and sanitising filters and generally making it super-easy to clean up incoming variables. Many of the framework...

Are PHP Developers functophobic?

I do feel this is the way things are going, although it seems they may already be this way!.. http://nikic.github.com/2012/08/10/Are-PHP-developers-functophobic.html