Drupal 7 timeline

A while ago, I wrote about Drupal and testing. Along with other people in the community, I argued that we need to put more emphasis on testing. Not because Drupal is buggy, but because it makes release management easier, because it leads to better APIs, and because it encourages change and experimentation -- something the Drupal community really takes pride in and which is critical to our long term success.

In an attempt to turn words into action, and to encourage you, the Drupal community, to fully embrace testing, I've decided to allow for a change in the development timeline of Drupal 7 ...

First, let us look back at the Drupal 6 timeline. As depicted below, we roughly spent 5 months developing and 7 months fixing bugs (and improving usability). The first couple of months were slow, because most of you still had to catch up on Drupal 5 and upgrade your modules -- it wasn't much different from today's situation. The last months of the development cycle were incredibly intense because you all wanted to get your last minute changes in. It was stressful, but good fun.

Timeline drupal

The actual Drupal 6 timeline.

Through a survey that collected more than 1000 responses, the community has expressed its preference for a one year release cycle. So when asked, most of us want one major Drupal release a year. Now, the Drupal 6 cycle happened to take one year so if we use that as a model for Drupal 7, and given the fact that Drupal 6 was released in February, the Drupal 7 code freeze date will be July 15, 2008.

Timeline drupal

The projected Drupal 7 timeline based on the actual Drupal 6 timeline.

Help, July 15 is only 4 months from now!? Yes, that is right, and clearly that wouldn't give us nearly enough time to work on some of the bigger tasks that we'd love to see become part of Drupal 7.

So how does this relate to testing? Well, I've decided that if we embrace testing, I'm happy to extend the Drupal 7 development cycle. There is no magic to this -- that is exactly what testing buys us and why we should adopt it as soon as possible. The better we get at testing, the shorter the code freeze can become, and the more development time that buys us. It is that simple.

Specifically, if we fully embrace testing, I'm willing to stretch the development cycle to 9 months instead of 5 months. However, if we don't embrace testing, the code freeze is tentatively scheduled to be on July 15 -- four months from now. In practice, the code freeze date might be somewhere in between, but we'll need at least a 3 month code freeze to give module maintainers time to upgrade their modules. As always, the exact dates are subject to change.

Timeline drupal testing

The Drupal 7 timeline assuming that we fully embrace testing.

So what needs to happen? First, we need to get a good but lightweight test framework in Drupal core. For optimal bang, I want to ship Drupal 7 with the test framework and the actual tests. We have no time to lose so let's start cranking on this.

Greg Holsclaw:

In your keynote at DrupalCon Boston, you said you were not sure that Simpletest was not the right Framework. What are the other options you are considering, or is a custom framework desirable?

The main reason I am asking is that some people see creating tests as a meaningful way to contribute to the Drupal project, but we don't want to make them in SimpleTest, if it is not the long term choice. Thanks.

March 19, 2008 - 17:25
Steven Jones:

Yeah, we really need to know which testing framework to write tests for. Otherwise people aren't going to write tests.

March 19, 2008 - 17:53
dlhubler:

"Xunit as a framework", meaning, use a variety of unit testing tools to test.

In java, this is a common set of frameworks
JUnit
DBUnit
XMLUnit
WebUnit
Watir (firefox, IE web browser automation)

And transcending utilities
EasyMock

A common occurance is unit tests originally written to framework changed to use another framework or split into 2 tests, as a technology was introduced into a module. For example changing a test written using JUnit might have been ported to use XMLUnit as XML was introduced into a module. It's a natural progression. Or having tests at multiple levels
UserTest
UserDbTest
UserUiTest
Is normal too.

So responsibilty fell on the more senior folks to look at when tests became to cumbersome to write, maintain or debug because they dealt more with setup and technology and not with actually testing the business logic. Convienience methods (plethora of methods on DrupalTestCase) are not a solution, but a stop-gap measure.

I mentioned this to folks the idea of using a "best of breed" set of frameworks at Drupalcon and response was that it was fragment and confuse folks. This is a valid concern, "competeing" frameworks like PHPUnit and Simpletest would cause confusion. Simpletest is a decent lowest comment denominator and if some folks never leave there, that's ok. It's important not to shackle folks from leveraging useful frameworks.

I realize PHP doesn't have as many "XUnit" packages, but there may be more than you think. On that note, "This is DBUnit for PHP" sometimes doesn't always translate well. In particular, static typed languages like java lead to heavier frameworks and do not leverage the dynamic nature of scripting languages, but I digress.

March 19, 2008 - 18:01
Likes SimpleTest:

I missed the keynote. Why not use SimpleTest? Is this debated somewhere?

March 19, 2008 - 18:20
Dries:

We've a lot to learn about testing and test frameworks so we're likely going to want to make some changes down the road. At the same time, it is important that we pick the right tools so we don't waste people's time and code. If can happen, but we should try to avoid it.

As a first step, I'd like to invite you to take a closer look at the SimpleTest framework for Drupal and to share your thoughts. But maybe there are some other frameworks out there that we can learn from, or get inspired by. Let's collect some recommendations.

I'm inclined to say that we should strip down SimpleTest and ship a minimalistic version of it with Drupal core. There are also some aspects of SimpleTest that are somewhat lacking such as its sandboxing functionality (it doesn't create a test database or a test directory for uploading files), the fact that it is difficult to run from the command line, etc.

I'm still learning SimpleTest myself and I'm not too worried about its shortcomings. In good Drupal tradition, we can incrementally improve the test framework over time. What is important is that we have a powerful yet lightweight base to that sets us of in the right direction.

I plan to play around with SimpleTest some more next week, but I'd recommend that someone creates a critical issue on drupal.org and actually starts working on a stripped down version of SimpleTest. By moving this to the drupal.org issue queue, we're more likely to make progress.

March 19, 2008 - 18:32
pwolanin:

I think ChX is already leading this effort to rework simpletest:

http://www.drupal4hu.com/node/133

March 19, 2008 - 19:12
Rob Loach:

For a live status report of the unit testing progress, have a look at the Functional SimpleTest Status page. It lists a bunch of tasks and issues, as well as how they're doing.

March 19, 2008 - 20:34
Andy Smith:

Django has a really great set of testing tools, fixtures, test.client, and a couple other things, I'd love to see those concepts worked into drupal somehow http://www.djangoproject.com/documentation/testing/

many of these things are not as easy in the php world (doctest specifically), but they've really nailed pretty much all the ways one wants to test a web framework quite well

March 20, 2008 - 07:14
Jose A Reyero:

I've been using Simpletest for a while and I think it's a reasonable good option. However I don't think we should just use Simpletest and then make Drupal development 100% dependant on it.

What I mean is that we need to define our own Drupal Test API (Like making all the test classes extending DrupalTestCase) so if at some point it's not working for us anymore we can just drop in a different test framework.

Also it may be good to have separated tests for pure Drupal API tests and for functional tests (the ones needing page loading and a browser like engine), which will allow us to use other tools for that ones, Maybe in the future we can even use some js capable testing engine ...

So, short summary, ok for simple test just but we better use our own testing api (and this will allow us to just start writing tests now, not waiting months for the perfect testing framework to be there..)

March 20, 2008 - 14:34
tjholowaychuk:

Sounds like a great step to take. In my opinion even longer than a year would not be an issue at all as we have not even begun adopting Drupal 6 due to many of our favorite modules not supporting it yet. Also I would like to have time to get some of my ideas ready for Drupal 7 as well.

March 20, 2008 - 17:04
Jeff Eaton:

The push to bring automated testing to Drupal is definitely exciting. After working on a couple of projects that took different routes to that goal, I think there are some important rules to remember that there's a big difference between a 'test script simulator' -- something that, say, uses the UI to create a node and publish it -- and API level unit tests. Both are needed if we're to have anything approaching complete coverage.

The 'test script' style unit tests are best at capturing the steps to reproduce a given defect, to ensure it doesn't reappear (I.E., the infamous unchechable checkbox issues with FAPI). The API-level unit tests are what can be used to ensure that things continue working the way we expect throughout Drupal's codebase when a change is made.

Most of the tests I see being written write now are the 'automated test script' variety, and they're testing positives ('can I create a node?') rather than negatives ('when I create a node with X options, using Y steps, does defect Z show up?'). These are useful as smoke tests for general functionality, but they'll really give us a false sense of security if we treat them as the be-all end-all.

March 23, 2008 - 16:54

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

© 1999-2007 Dries Buytaert Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.
Drupal is a Registered Trademark of Dries Buytaert.