Joomla Forms – Preview – Unit Testing and Quality Code

May 21st, 2008

[Thanks to ex-employee Greg Wright for getting me in the spirit of Test Driven Development]

While developing Joomla Forms over the last 1+ years many changes to Joomla 1.5 have taken place.  Infact when we started development on Joomla Forms, Joomla 1.5 was still very much in development with huge changes being made daily.

Keeping on top of what worked and what didn’t was a huge job – so much so that I gave up :-)

A lot has been said about Unit Testing in recent months by Joomla Core Developers and even custom developers.  However we have been employing unit testing heavily for Joomla Forms, and have been employing (mainly in the later stages) the principles of test-driven development to ensure that our code for Joomla Forms is reusable, free of silly mistakes and more importantly WORKS!

The screenshot that you can see here is the 359 Assertions we are making of the Form Field Plugins in Joomla Forms.  We have many more unit tests covering 89% of the component and bfFramework – thats pretty good.

What does this mean for you?

  • Cleaner, more reliable code
  • Mistakes are caught early in the development process
  • Code is clearly documented in tests
  • Refactoring/Changes can be tested quickly to see if it impacts elsewhere
  • Quality code is tested code :-)

Just a small insight on what we do behind the scenes – further reading:

Leave a Reply