7 Best Tools in Drupal Development

Drupal development is like cooking. Usually, we use main ingredients like Drupal core and contributed modules. And, after that, there are an ordinary recipe: make content types, write custom modules, create views. Anyway result will mostly depend on the techniques, tools and your own secrets. Version Control with SVN There are one strong need in the coding process – it is the ability to revert and selectively save your work. SVN version control allows to involve exterior developers into client process and to provide projects with multiple developers. That’s why it is great to use it. Nevertheless, keep in mind, that there are other version control systems like Bazaar and Git, which include much more features. Drush Drush is very helpful in updating and installing all of the 30 modules, which are included in average site. A symlinked wrapper is deployed around Drush with every rollout of numerous sites. That moves to the top any changes to SVN, identifies the project that needs updating and switches context to the developers sandbox. So updating of modules on a Drupal site becomes as easy as update code of drush. Furthermore, Drush is a great tool of Drupal functionality. It allows a developer to log right into the MySQL database with the rights to run any pending database updates (drush updatedb), to run cron (drush cron) and much much more. To expand Drush’s functionality is really easy. This is very useful in working with exports or imports of extensive data. In general, such kind of centeralization is indespensible and very powerful to process of development. Trac for Bug Tracking and Code History To complete SVN with each site we roll, separate installation of Trac should be included. This open source package provides an opportunity to get visual differents between changes and see a timeline of SVN commits. This allows to get help in monitoring problems that might appear and it is useful in auditing unique parts of code. Drupal is frequently used, for example, to control the Trac’s HTTP authentication. Drupal Development Modules A lot of helpful developer modules are written for Drupal development platform. Almost every project have a few modules installed in the end up. Here is the list: Devel Module – is the actual Drupal development module’s standard. It includes general functionality for examining SQL queries, generating test content, developing forms, doing performance testing, identifying theme functions, switching user accounts and much more. Drupal for Firebug – This a kind of module, that provides a splendid Drupal developer experience for those people who use Firebug in everyday work. Drupal for Firebug adds a new tab for “Drupal” and hooks into the Firebug tabs. All of the nodes, views, users, forms used in each page load are slowed down. In addition, it provides some coloring to highlight what elements have been deleted, added or changed. Custom debugging messages can be easily outputted, using the firep() function and have it show up in the general messages in order of execution. Coder – This module helps to improve your code style, and in addition it is also useful while enforcing Drupal best practices in code writing. It helps to enforce comment completeness, quickly find obvious security issues and identify PHP warnings. Automatic Testing: Selenium and Simpletest Deployment of automatic testing on functional (via Simpletest) and user experience level (via Selenium) is a part of our solution. A lot of functionality is affordable in Drupal 6’s Simpletest contributed module, but there are a lot of great things was made in Drupal 7 core. We use the Simpletest framework to ensure critical functionality throughout each stage of project. Identifying the critical paths and functionality for each project quickly, and baking in the tests nessesary to support them is an important part of web development process. To make sure, that critical PHP and SQL functionality is working at the code level, the Simpletest functionality is just a great tool. The Selenium testing package is used to make sure things work at the browser level, because a web application is more than just PHP and SQL. Errors (like broken Javascript or forms hidden due to CSS issues), which can’t be detected by a Simpletest framework, definitely will be found during this testing. The easiest way to program Selenium tests is to use the Selenium Firefox Plugin to record a user’s activity macro. This is a great way to automatically play it back across a variety of browsers. This is the way to guarantee critical site functionality: we can test each “user scenario” regularly and under various conditions. Xdebug PHP errors can be identified easily by the Xdebug debugging package. The package provides function and stack traces for developers. Due to complexity of Drupal customization, it often has errors that occur many layers deep in the Drupal architecture. Xdebug provides functionality, that is particularly important. Like in the case when the technical error that PHP gives is in a common function. Performance Testing with Kcachegrind, jMeter and Apache Bench There are a lot of work on huge sites. Such sites await to receive a lot of web traffic (either on a burst or continual basis). To make sure that sites and supporting server architecture can succesfully handle the high load, several tools are used. We use the Apache Bench tool to get an initial idea of the kind of load our server can handle. This tool tests Apache to see how many requests per second it can handle. This can test the theoretical limits of the server setupand can help identify immediate improvements with the server stack. We use a tool called jMeter to provide a more real world testing situation. jMeter works in that way: it records click-paths of user scenarios, and after that simulates the actual activity of thousands (or tens of thousands) of concurrent users. Code is refined and server architecture is increased after running of our test. The KCachegrind tool profiles individual libraries and functions for memory and CPU usage. After all the improvements is done, one more testing is needed to be sure, that everything works in the right, excellent way and all the goals are reached.