Drupal automated test suite

Last updated on
24 April 2025

Introduction

The Drupal development team is fond of refactoring its code in order to maintain a clean and elegant design. Unfortunately, these changes are highly risky, and minor bugs are a likely byproduct. These minor bugs are then discovered and fixed in the following weeks after the refactoring is complete.

Automated testing of pages and functions would be a huge boost for the development team. We could refactor with fewer bugs, and greater confidence. Automated testing is one of the great software development innovations in recent years. This is an exciting and important area, and a young programmer would be wise to investigate it. So lets do so with Drupal!

You will not be working from scratch. A prototype exists in the simpletest module which in turn is based on the SimpleTest project at Sourceforge.net. Simpletest offers this great introduction into the world of unit testing. Be sure to read it if you are interested in this project.

Deliverables

  • Build a few tests which exercise Drupal's access control mechanism. In particular,
    the user_access() function. Assure that the right page is shown when denied
    access.
  • Build a larger scale test which tests Drupal's user login process. Try
    to register a new user and assure all the profile and authorization bits
    are setup properly
  • Build a test which exercises the node authoring system. Assure that compose
    form works as designed, and that the node is properly validated and saved

 

Help improve this page

Page status: Not set

You can: