Login   Register  
PHP Classes
elePHPant
Icontem

Test Driven Development brings Stability to Zurmo Open Source CRM - PHP Classes blog

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Test Driven Developme...   Post a comment Post a comment   See comments See comments (2)   Trackbacks (0)  
<< Previous: The Urge to Kill Olde...>> Next: Zend Optimizer+ Cach...

Author: Ray Stoeckicht

Posted on:

Categories: PHP community

Employing a Test Driven Development (TDD) methodology when building a complex application may be tedious and take twice as much time, but the upshot is scalable stability as the tortoise beats the hare.

As lead developers of Zurmo, an Open Source Customer Relationship Management (CRM) application, we are driven by the need to build rock solid, reliable software, something that is hard to come by in our field.

In order to accomplish our goal, we decided to bite the bullet and sweat it out with Test Driven Development - TDD.

Zurmo is written in PHP and utilizes jQuery, the Yii Framework, and RedBeanPHP. With 1700+ unit tests running across eight server configurations, Zurmo is built with a passion for software engineering best practices.

Read the article to find out why it is beneficial to be in the habit of testing, testing, and more testing.




Picture of Ray Stoeckicht
By Ray Stoeckicht United States
zurmo.org
<email contact>

Contents

Background

Test Driven Development

Why Yii Framework?

How a Developer Benefits?

Developing Your Applications on top of Zurmo

Downloading and Learning more about Zurmo

Background

When PHP developers think about Customer Relationship Management (CRM), you could sense bottled up frustration about to burst. And then it happens. Reason being, CRM's are not particularly perceived as interesting and usually thought of as a boring and dull application to build.

They also have a bad reputation for being buggy. This does not exactly encourage developers to deploy or build a custom CRM application.

In 2010, we, the founders of Zurmo, saw an opportunity to build a better open source CRM application based on better technology and best practice software engineering.

Homepage UI

Test Driven Development

Test Driven Development, or just TDD, sits at the core of our entire engineering ethos. Zurmo is developed using an agile method, so tests play a very important role in development.

Without tests it would be very difficult to develop an application of this complexity and be sure that everything works correctly. We have unit tests (with code coverage of about 85%), functional tests, and walk-through tests, a mix between unit and functional tests, used to test if controller actions are executed correctly.

We developed our custom continuous integration environment, which covers unit tests, functional tests, code violation, checking for missing translation messages, performance, and more.

Prior to creating our own CI, we explored using Jenkins and Hudson. Since Zurmo is written in PHP and our developers are well versed in PHP, we wanted to make sure the tools we were using were easy for everyone to utilize. In the beginning, our CI evolved naturally.

We developed a few scripts and then a few more. Before we knew it, we were pretty far down the road and we did not want to expend the energy switching to something else when what we had fulfilled our requirements.

It might have taken more effort to rewrite everything to work with Jenkins or Hudson. In the future, we may consider switching to a new CI server, but for the time being, everything is working very well.

With an almost religious zeal for testing, you will find that our obsession with TDD means a more stable application. Gone are the days of upgrade and pray. Now it is upgrade and test. With the testing infrastructure in place, you can create and maintain a custom-built CRM system with the assurance that future updates are not going to break your installation.

Why Yii Framework?

The Yii Framework was chosen as a base framework because its components tie tightly together. It is very fast, clean, and has a strong community.

Before we started building Zurmo, we looked at Yii, Cakephp, Zend, and Codeigniter. Yii had a full set of functionality and matched up well with the other frameworks. We also liked the event driven architecture. Overall, we are delighted with the decision.

Why RedBeanPHP for ORM?

Although Yii is a solid PHP framework and fit the best to our requirements, we still have had to modify it heavily. Yii Active Record did not satisfy our database abstraction plan, so we decided to use the RedBeanPHP ORM system, which is a lightweight system.

It is not as popular as Doctrine or Propel, but it satisfies our needs. RedbeanPHP can work in two modes: unfrozen, where the database structure is not fixed, and frozen where the database structure cannot be changed.

During development, unfrozen mode should be used, and once the database development is done, the frozen model should be used. Frozen mode is much faster than unfrozen, so it should be used on production servers. With this approach, we just define the model's metadata and the table is created automatically.

How a Developer Benefits?

Zurmo can be used by anyone from a 1-person freelancer to a 100 user sales organization. As we build the feature set, it will become more and more geared towards larger, complex use cases, with many moving parts.

The more integrations, high volumes of data, and customizations, the better Zurmo is positioned to handle the use case. We aspire to be the first open source CRM that can scale to the enterprise.

Currently, we have a customer that uses Zurmo as the core system for centralizing millions of data points and running the company's entire operations. We also have a rugby team in the UK that uses Zurmo for activity management and sales force automation.

Gamification and social collaboration works better for larger user deployments, but individuals who simply need to manage their customer data and sales, marketing, and support processes can still benefit from the application.

My Profile UI

Developing Your Applications on top of Zurmo

When it comes to developing an application, Zurmo can be used as a baseline platform, especially when needing to build a multi-relational database app. Many times a CRM system can be used as a starting point for building a custom app because the objects and relationships are already there.

For example, a non-profit organization that has 4,000 employees might use a CRM application to manage the health benefits for all workers. This is not a traditional CRM use case, but with some ingenuity, this application can be customized to fit the requirements.

The “contacts” module is re-purposed for internal “employees”. The “opportunities” module is re-used for the different “benefit plans”. Instead of building an application from scratch, a CRM can save time by simply re-purposing and customizing the existing out-of-box functionality.

With the testing infrastructure and software architecture of Zurmo, a developer can build a custom application that allows them to refactor and perform upgrades knowing there is a safety net in place. Less bugs. Less surprises. When developing on top of Zurmo, there is peace of mind.

Downloading and Learning more about Zurmo

If you liked this open source PHP application, go ahead and visit the Zurmo site to download it or obtain more information.

If you have other questions or comments to make, please feel free to post a comment to this article here.


You need to be a registered user or login to post a comment

Login Immediately with your account on:

Facebook ConnectGmail or other Google Account
Hotmail or Microsoft Windows LiveStackOverflow
GitHubYahoo


Comments:

1. i dont like use yii - José Filipe Lopes Santos (2013-03-15 16:29)
i dont like use yii... - 0 replies
Read the whole comment and replies

2. Beautiful and highly informative article - Yogi Yang (2013-01-18 07:37)
Beautiful and highly informative article... - 0 replies
Read the whole comment and replies


<< Previous: The Urge to Kill Olde...>> Next: Zend Optimizer+ Cach...

  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Test Driven Developme...   Post a comment Post a comment   See comments See comments (2)   Trackbacks (0)