Magento-logo

Magento TDD Webinar Report

On Friday, Jan 27, 2012 I attended the free webinar provided by Ivan Chepurnyi from ecomdev.org. The subject of webinar was using Test Driven Development (TDD) approach while customizing Magento functionality.

First Ivan outlined what is TDD in general, its upsides and pitfalls. The rest of the webinar was dedicated to the development of the sample Magento extension (the guestbook application) using TDD approach. Ivan was using PHPUnit as the platform along with EcomDev_PHPUnit application which is available for download at github.

First he showed an example of how to test a Magento extension config.xml file, then he added a setup script and some resources. Each of these structures had its own function inside of the test script in order to check functionality. A bit tricky was instances called data providers and expectations which allows to test different functionality (in our case it was a validation function) using different input cases. Then a controller was added but unfortunately at this point the webinar was already running for 2 hours (30 minutes more than initially planned) and Ivan had to finish promising to continue next time.

In conclusion I first have to admit that even having a theoretical knowledge what TDD is, this was the first time I saw it in action. So I have to say that this technology as it is and in combination with Magento in particular is rather impressive especially taking into consideration that large share of Magento functionality (such as controllers, configs and setups) is mostly processing behind the stage and is rather hard to be traced and debugged.

The downside is that it significantly increases the development time and one can benefit from using TDD only in case of developing complex extensions and most likely from scratch. Another important downside is that the TDD approach can’t be used right away by the developer that has no experience with it.

The webinar video can be found here and the extension code here.

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert