<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Testing</title>
    <description>Dries Buytaert on Testing.</description>
    <link>https://dri.es/tag/testing</link>
    <atom:link href="https://dri.es/tag/testing/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>When backward compatibility became an advantage</title>
      <link>https://dri.es/when-backward-compatibility-became-an-advantage</link>
      <guid>https://dri.es/when-backward-compatibility-became-an-advantage</guid>
      <pubDate>Mon, 12 Jan 2026 12:07:49 -0500</pubDate>
      <description>&lt;p&gt;Twenty years ago, I argued passionately that &lt;a href=&quot;https://dri.es/backward-compatibility&quot;&gt;breaking backward compatibility&lt;/a&gt; was one of Drupal&#039;s core values:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The only viable long-term strategy is to focus exclusively on getting the technology right. The only way to stay competitive is to have the best product. [...] If you start dragging baggage along, your product will, eventually, be replaced by something that offers the same functionality but without the baggage.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I warned that preserving backward compatibility would be the beginning of the end:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I fear that this will be the end of Drupal as we have come to know it. Probably not immediately, maybe not even for several years, but eventually Drupal will be surpassed by technology that can respond more quickly to change.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Twenty years later, I have to admit I was wrong.&lt;/p&gt;
&lt;p&gt;So what changed?&lt;/p&gt;
&lt;p&gt;In 2006, &lt;a href=&quot;https://www.drupal.org/&quot;&gt;Drupal&lt;/a&gt; had almost no automated tests. We couldn&#039;t commit to backward compatibility because we had no way to know when we broke it. Two years later in 2008, &lt;a href=&quot;https://dri.es/embracing-test-driven-development&quot;&gt;we embraced test-driven development&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;large&quot;&gt;
&lt;figure&gt;&lt;img src=&quot;https://dri.es/files/images/drupal/test-coverage-2026.png&quot; alt=&quot;Line chart showing Drupal&amp;amp;#039;s production code and test code from 2012 to 2026. Test code grows from near zero to over 650,000 lines; production code grows from 90,000 to 300,000 lines.&quot; width=&quot;1840&quot; height=&quot;650&quot; /&gt;
&lt;figcaption&gt;&lt;em&gt;Drupal&#039;s test code now exceeds production code by more than two to one. Source: &lt;a href=&quot;https://dbuytaert.github.io/drupal-core-metrics/&quot;&gt;Drupal Core Metrics&lt;/a&gt;.&lt;/em&gt;&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;/div&gt;
&lt;p&gt;By 2013, we had built up some test coverage, and with that foundation we &lt;a href=&quot;https://www.drupal.org/node/2135189&quot;&gt;adopted semantic versioning&lt;/a&gt; and committed to backward compatibility. It transformed &lt;a href=&quot;https://dri.es/the-transformation-of-drupal-8-for-continuous-innovation&quot;&gt;how we innovate in Drupal&lt;/a&gt;. We can mark old code for removal and clear it out every two years with each major release. The baggage I feared never really accumulated.&lt;/p&gt;
&lt;p&gt;Today, according to the &lt;a href=&quot;https://dbuytaert.github.io/drupal-core-metrics/&quot;&gt;Drupal Core Metrics dashboard&lt;/a&gt;, Drupal Core has more than twice as much test code as production code. I didn&#039;t fully appreciate how much that would change things. You can&#039;t promise backward compatibility at Drupal&#039;s scale without extensive automated testing.&lt;/p&gt;
&lt;p&gt;Our upgrades are now &lt;a href=&quot;https://dri.es/making-drupal-upgrades-easy-forever&quot;&gt;the smoothest in the project&#039;s history&lt;/a&gt;. And best of all, Drupal didn&#039;t end. It&#039;s still a top choice for organizations that need flexibility, security, and scale.&lt;/p&gt;
&lt;p&gt;I recently came across &lt;a href=&quot;https://sigmodrecord.org/publications/sigmodRecord/1906/pdfs/06_Profiles_Hipp.pdf&quot;&gt;an interview with Richard Hipp&lt;/a&gt;, SQLite&#039;s creator. SQLite has 90 million lines of tests for 150,000 lines of production code. That is a whopping 600-to-1 ratio. Hipp calls it &amp;quot;aviation-grade testing&amp;quot; and says it&#039;s what lets a team of three maintain billions of installations.&lt;/p&gt;
&lt;p&gt;I suspect our test coverage will continue to grow over time. But Drupal can&#039;t match SQLite&#039;s ratio, and it doesn&#039;t need to. What matters is that we built the habits and discipline that work for us.&lt;/p&gt;
&lt;p&gt;In 2006, I thought backward compatibility would be the end of Drupal. In 2026, I think it might be what keeps us here for another twenty years.&lt;/p&gt;
&lt;p&gt;Thank you to everyone who wrote those tests.&lt;/p&gt;
&lt;p&gt;It does make me wonder: what are we wrong about now? What should we be investing in today that will slowly reshape how we work and become an obvious advantage twenty years from now? And who is already saying it while the rest of us aren&#039;t listening?&lt;/p&gt;
</description>
    </item>
    <item>
      <title>PHPUnit tests for Drupal</title>
      <link>https://dri.es/phpunit-tests-for-drupal</link>
      <guid>https://dri.es/phpunit-tests-for-drupal</guid>
      <pubDate>Mon, 31 Oct 2022 09:15:23 -0400</pubDate>
      <description>&lt;p&gt;Writing tests can be hard, but the key is to get started and take that first step. When I start a new Drupal module, I begin with a simple test and make sure it passes. Once I have one simple test passing, it becomes easy to add more.&lt;/p&gt;
&lt;p&gt;This page documents how I use &lt;a href=&quot;https://phpunit.de/&quot;&gt;PHPUnit&lt;/a&gt; with Drupal. Since I sometimes take breaks from working on my Drupal site, I&#039;ve documented the process of installing, configuring, running and debugging tests as a quick reference. I often return to this guide to refresh my memory.&lt;/p&gt;
&lt;h3&gt;The most basic PHPUnit test for Drupal&lt;/h3&gt;
&lt;p&gt;The most basic &lt;a href=&quot;https://phpunit.de/&quot;&gt;PHPUnit&lt;/a&gt; test for Drupal looks something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-php&quot;&gt;&amp;lt;?php
namespace Drupal\Tests\my_module\Functional;

use Drupal\Tests\BrowserTestBase;

class MyModuleTest extends BrowserTestBase {

  /**
  * Modules to enable.
  *
  * @var array&amp;lt;string&amp;gt;
  */
  protected static $modules = [&#039;my_module&#039;];

  /**
  * Theme to enable. This field is mandatory.
  *
  * @var string
  */
  protected $defaultTheme = &#039;stark&#039;;

  /**
  * The simplest assert possible.
  */
  public function testOne() {
   $this-&amp;gt;assertTrue(TRUE);
  }
}

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The test lives in &lt;code&gt;docroot/modules/custom/my_module/tests/src/Functional/MyModuleTest.php&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Installing PHPUnit for Drupal&lt;/h3&gt;
&lt;p&gt;Drupal does &lt;em&gt;not&lt;/em&gt; ship with PHPUnit out-of-the-box, so it needs to be installed.&lt;/p&gt;
&lt;p&gt;The best way to install PHPUnit on a Drupal site is by installing the 1 package. It can be installed using &lt;a href=&quot;https://getcomposer.org/&quot;&gt;Composer&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ composer require drupal/core-dev --dev --update-with-all-dependencies
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The command above will download and install PHPUnit, along with other development dependencies that are considered a best-practice for Drupal development (e.g. &lt;a href=&quot;https://phpstan.org/&quot;&gt;PHPStan&lt;/a&gt;).&lt;/p&gt;
&lt;h3&gt;Configuring PHPUnit for Drupal&lt;/h3&gt;
&lt;p&gt;Once installed, you still have to configure PHPUnit. All you need to do is set two variables in your shell:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SIMPLETEST_BASE_URL&lt;/code&gt; should be the URL of your site (e.g. &lt;code&gt;http://localhost/&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SIMPLETEST_DB&lt;/code&gt; should be your database settings (e.g. &lt;code&gt;mysql://username:password@localhost/database&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I use &lt;a href=&quot;https://ddev.com/&quot;&gt;DDEV&lt;/a&gt; for my local development environment and follow these steps to log into DDEV&#039;s web server and configure the PHPUnit testing variables:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ ddev ssh
$ export SIMPLETEST_BASE_URL=&amp;quot;https://dri.es.ddev.site/&amp;quot;
$ export SIMPLETEST_DB=&amp;quot;mysql://db:db@db/db&amp;quot;

&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Running PHPUnit test for Drupal&lt;/h3&gt;
&lt;p&gt;To run all PHPUnit tests in the &lt;code&gt;./docroot/modules/custom&lt;/code&gt; directory, run the following command from your web server&#039;s container:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ ./vendor/bin/phpunit docroot/modules/custom
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To run all tests from a specific class, use the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ ./vendor/bin/phpunit --filter MyModuleTest
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To run a single test method from a specific class, use this command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ ./vendor/bin/phpunit --filter MyModuleTest::testOne
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Debugging PHPUnit tests in Drupal&lt;/h3&gt;
&lt;p&gt;When tests fail, the default PHPUnit output can make it hard to debug the problem. A good first step is to enable the &lt;code&gt;--debug&lt;/code&gt; flag:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;$ ./vendor/bin/phpunit --filter MyModuleTest::testOne --debug
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This shows all the steps your test goes through, including setup, data preparation, and each assertion. Often, this extra detail is enough to identify the problem.&lt;/p&gt;
&lt;p&gt;If you still encounter unclear errors, like a &amp;quot;500 Internal Server Error&amp;quot;, inspecting the response from your application can help. You can temporarily modify your test to print the response body or headers by adding this code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-php&quot;&gt;$content = $this-&amp;gt;getSession()-&amp;gt;getPage()-&amp;gt;getContent(); 
var_dump($content);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If PHP is configured to display a stack trace (by setting &lt;code&gt;display_errors = On&lt;/code&gt; and &lt;code&gt;error_reporting = E_ALL&lt;/code&gt; in &lt;code&gt;php.ini&lt;/code&gt;), it will also appear in your terminal.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Drupal 7 testing: status update and next steps</title>
      <link>https://dri.es/drupal-7-testing-status-update-and-next-steps</link>
      <guid>https://dri.es/drupal-7-testing-status-update-and-next-steps</guid>
      <pubDate>Tue, 16 Jun 2009 15:07:57 -0400</pubDate>
      <description>&lt;p&gt;The &lt;a href=&quot;https://cvs.drupal.org/viewvc.py/drupal/contributions/modules/simpletest/simpletest.module?revision=1.1&amp;amp;view=markup&quot;&gt;first version of Drupal&#039;s automated test framework&lt;/a&gt; was developed in 2004 by &lt;a href=&quot;http://www.tejasa.com&quot;&gt;Moshe Weitzman&lt;/a&gt;. It started as a simple wrapper around the &lt;a href=&quot;http://www.simpletest.org/&quot;&gt;SimpleTest unit testing framework&lt;/a&gt;. Later, &lt;a href=&quot;https://www.drupal.org/user/26486&quot;&gt;Thomas Ilsche&lt;/a&gt; and &lt;a href=&quot;https://www.drupal.org/user/61873&quot;&gt;Rok Zlender&lt;/a&gt; extended it as part of the &lt;a href=&quot;https://dri.es/google-to-invest-70000-usd-in-drupal&quot;&gt;Google Summer of Code projects&lt;/a&gt; of 2005 and 2006. &lt;a href=&quot;http://www.nowpublic.com&quot;&gt;NowPublic&lt;/a&gt; and others continued to sponsor Rok&#039;s work into 2008. Today, &lt;a href=&quot;http://www.boombatower.com/&quot;&gt;Jimmy Berry&lt;/a&gt; is the principal contributor of the Drupal test framework, as well as the main developer and maintainer of Drupal.org&#039;s automated test infrastructure. Behind the scenes, &lt;a href=&quot;https://www.drupal.org/user/18703&quot;&gt;Kieran Lal&lt;/a&gt; was instrumental in helping to ensure our test framework received financial support, project management, hardware resources, and server administrators.&lt;/p&gt;
&lt;p&gt;In the February 2008, I declared that &lt;a href=&quot;https://dri.es/embracing-test-driven-development&quot;&gt;Drupal should embrace test-driven development&lt;/a&gt;, and shortly thereafter, &lt;a href=&quot;https://dri.es/we-have-a-test-framework-in-drupal-7&quot;&gt;we added the test framework to Drupal 7 core&lt;/a&gt;. In addition to a test framework for core, &lt;a href=&quot;http://www.boombatower.com/&quot;&gt;Jimmy Berry&lt;/a&gt; and &lt;a href=&quot;https://www.drupal.org/user/22079&quot;&gt;Chad Phillips&lt;/a&gt; developed a second generation automated testing framework for drupal.org – so far, &lt;a href=&quot;https://testing.drupal.org/pifr/stats&quot;&gt;it has tested over 8500 unique patches&lt;/a&gt; on Drupal.org.&lt;/p&gt;
&lt;p&gt;Yesterday, &lt;a href=&quot;http://blog.boombatower.com/acquia-internship&quot;&gt;Jimmy announced that he will be working part-time as an intern for Acquia&lt;/a&gt; this summer. At &lt;a href=&quot;https://www.acquia.com&quot;&gt;Acquia&lt;/a&gt;, we like what Jimmy is doing, and because he has been looking for a financial sponsor for a while now, I decided Acquia should step up and help Jimmy for part of the summer. Frankly put, Jimmy&#039;s work has the potential of doubling the velocity of our developer community, and that is well worth sponsoring. Jimmy will spend his time with Acquia to continue his work on Drupal 7&#039;s test framework and the automated test infrastructure for drupal.org.&lt;/p&gt;
&lt;p&gt;For well over a year now, core development has used a test-driven development strategy combined with automated testing. I think all core developers working on Drupal 7 will unanimously agree when I say that our test infrastructure has drastically improved our velocity and effectiveness. Overall, patches get accepted faster. The automated tests allow us to focus on the architectural and the algorithmic changes introduced by a patch, rather than having to worry about unexpected side-effects. This helps both patch reviewers and core developers contributing patches. Furthermore, thanks to the tests, we have a much better feel about the stability and the health of Drupal 7. I am optimistic that our code freeze period for Drupal 7 could be shorter than prior releases. As the project lead, our test framework helps me sleep better at night. The stability and health of our code base is important to me, but frankly, it is at least as important for the many Drupal users, or for those people and organizations looking to adopt Drupal.&lt;/p&gt;
&lt;p&gt;By adopting a test-driven development strategy we raised the bar for core development, and I strongly believe we have to do the same for contributed modules. While the community cannot force module maintainers to write tests for their modules, I do want to support those that do write tests. The best way to support them, is to provide them the same tools and infrastructure that we use for core development. And as the maintainer of a contributed module myself (i.e. the &lt;a href=&quot;https://www.drupal.org/project/mollom&quot;&gt;Mollom module&lt;/a&gt;), I can&#039;t wait to have the same tools available that I have available when working on Drupal core.&lt;/p&gt;
&lt;p&gt;Jimmy is working on making drupal.org&#039;s automated test infrastructure available to contributed modules, integrating the test results in the project pages as an incentive tool, improving the documentation to help people get started, and closing some functional gaps such as the ability to test Drupal&#039;s installer and upgrade system. We&#039;re also working on deploying the third generation of the automated testing framework. This new version will make it easier to add testing servers so we can triple the number of servers needed to run tests, and start testing the non-MySQL backends that are supported by Drupal 7.&lt;/p&gt;
&lt;p&gt;All in all, I&#039;m very optimistic that we&#039;ll succeed in &lt;a href=&quot;https://dri.es/embracing-test-driven-development&quot;&gt;our goal to adopt a test-driven development strategy&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Usability work at DrupalCon DC</title>
      <link>https://dri.es/usability-work-at-drupalcon-dc</link>
      <guid>https://dri.es/usability-work-at-drupalcon-dc</guid>
      <pubDate>Tue, 03 Mar 2009 23:12:54 -0500</pubDate>
      <description>&lt;p&gt;I recently &lt;a href=&quot;https://dri.es/mark-boulton-to-help-with-drupal-7&quot;&gt;announced&lt;/a&gt; that one of the ways in which &lt;a href=&quot;https://www.acquia.com&quot;&gt;Acquia&lt;/a&gt; is contributing to Drupal is by providing funds for Mark Boulton and Leisa Reichelt to help the Drupal community improve usability in Drupal 7. Mark and Leisa are beginning their work at DCDC this week!&lt;/p&gt;
&lt;p&gt;One of the things they&#039;re hosting, with the help of Jeff Noyes, are &amp;quot;Blue Sky Design Workshops&amp;quot;. The workshops are &lt;a href=&quot;http://drupalredesign.eventwax.com/drupal7-redesign-workshop-i/register&quot;&gt;Wednesday 3-4pm&lt;/a&gt; and &lt;a href=&quot;http://drupalredesign.eventwax.com/drupal7-redesign-workshop-ii/register&quot;&gt;Thursday 9-10am&lt;/a&gt; and &lt;a href=&quot;http://drupalredesign.eventwax.com/drupal7-redesign-workshop-iii/register&quot;&gt;11:30-12:30am&lt;/a&gt;. The &amp;quot;Blue Sky&amp;quot; part of the title notes that these sessions are designed to push the boundaries of usability in Drupal, to get the community together, to brainstorm about new possibilities and to dream up solutions.&lt;/p&gt;
&lt;p&gt;Furthermore, the Drupal usability team has just completed a second round of formal usability testing at the University of Baltimore and I&#039;m really looking forward to learn more about the results of their work.&lt;/p&gt;
&lt;p&gt;To keep up the involvement after DCDC, or if you&#039;re following along from home, consider joining this &lt;a href=&quot;https://groups.drupal.org/mark-boulton-design-drupal-7-project&quot;&gt;Mark Boulton D7 UX group&lt;/a&gt; as well as the regular &lt;a href=&quot;https://groups.drupal.org/usability&quot;&gt;usability group&lt;/a&gt; on groups.drupal.org for updates. &lt;em&gt;Make sure to tune in!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Usability is one of those areas where we can really break new ground with our next release. We&#039;ve already done much work, but have more to do. Through activities like this, and with the feedback from some &amp;quot;fresh eyes&amp;quot; through research and user testing, I&#039;m very hopeful and excited about where we&#039;re headed.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>We have a test framework in Drupal 7</title>
      <link>https://dri.es/we-have-a-test-framework-in-drupal-7</link>
      <guid>https://dri.es/we-have-a-test-framework-in-drupal-7</guid>
      <pubDate>Mon, 21 Apr 2008 11:10:13 -0400</pubDate>
      <description>&lt;p&gt;Every major Drupal release we should ask ourselves what steps we can take to double the capacity of our community.&lt;/p&gt;
&lt;p&gt;I spent the weekend in Paris where we had a two day code sprint. Our main accomplishment was getting Drupal&#039;s test framework into Drupal core – the culmination of three years of hard work carried out by many people and companies in the Drupal community.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src=&quot;https://dri.es/files/cache/drupalcamp-paris-2008/writing-tests-for-drupal-1280w.jpg&quot; alt=&quot;A whiteboard displays &amp;amp;quot;Writing Tests for Drupal!&amp;amp;quot; in red marker, scheduled for 16:30 at DrupalCamp Paris 2008.&quot; width=&quot;1280&quot; height=&quot;857&quot; /&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;Here is why a strong investment in testing will help double the capacity of our community:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;For developers&lt;/strong&gt;, upgrading, maintaining and releasing your modules becomes easier. The combination of test results and code coverage reports makes it easier to determine the release readiness of your code. This translates to fewer betas, shorter code freeze periods and more frequent releases. Furthermore, &lt;em&gt;design for testability&lt;/em&gt; leads to easier to use and more complete APIs. It is guaranteed to make Drupal a better development platform.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For end users&lt;/strong&gt;, it is important that we provide quantifiable reporting on the health of Drupal core and the many contributed modules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For patch reviewers&lt;/strong&gt;, tests are great because it allows them to focus on the architectural and the algorithmic changes that the patch introduces. With good test coverage, we can rely on the tests to discover any unwanted side-effects. Patches can be committed faster.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For people new to Drupal&lt;/strong&gt;, tests lower the barrier to entry and encourage collaboration and innovation, two of Drupal&#039;s core values. With good test coverage, you don&#039;t necessarily have to understand the entire code base before you can comfortably propose changes or help maintain a module.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;For me&lt;/strong&gt;, it means I&#039;ll sleep better at night. ;-) With hundreds of thousands of people using Drupal, the availability of a test framework takes some pressure of my shoulders.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As of today, it is expected that you submit test cases with your patches for Drupal 7. Writing good tests takes time: it is not unlikely that you&#039;ll spent twice as long working on a patch. This might take some time getting used to but you&#039;ll find that it pays off and that it is actually very rewarding.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href=&quot;http://dev.af83.com/&quot;&gt;Ori Pekelman of AF83&lt;/a&gt; for being such a great host when in Paris. And a special thanks to everyone who helped get the test framework in Drupal 7.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>First results from usability testing</title>
      <link>https://dri.es/first-results-from-usability-testing</link>
      <guid>https://dri.es/first-results-from-usability-testing</guid>
      <pubDate>Mon, 10 Mar 2008 05:48:25 -0400</pubDate>
      <description>&lt;video width=&quot;640&quot; controls&gt;
  &lt;source src=&quot;https://dri.es/files/usability-testing-minnesota-1.mov&quot;&gt;
&lt;/source&gt;
&lt;/video&gt;
&lt;p&gt;Two weeks ago, we conducted &lt;a href=&quot;https://en.wikipedia.org/wiki/Usability_testing&quot;&gt;formal usability testing&lt;/a&gt; for &lt;a href=&quot;https://www.drupal.org&quot;&gt;Drupal&lt;/a&gt; at the &lt;a href=&quot;http://1help.umn.edu/usability/lab.html&quot;&gt;University of Minnesota Office for Information Technology&#039;s usability lab&lt;/a&gt;. As &lt;a href=&quot;https://dri.es/drupal-usability-testing&quot;&gt;I wrote earlier&lt;/a&gt;, the university has a professional usability lab that allowed us to &lt;a href=&quot;http://1help.umn.edu/usability/gallery.html#gazeplot&quot;&gt;record eye-tracking data and video&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;&lt;img src=&quot;https://dri.es/files/images/drupal/eye-tracking-hot-spot-map.jpg&quot; alt=&quot;A heat map of Drupal&amp;amp;#039;s admin page shows where users looked and clicked within the first five seconds.&quot; width=&quot;998&quot; height=&quot;1493&quot; /&gt;
&lt;figcaption&gt;&lt;em&gt;The heat map shows where the users look the first 5 seconds after landing on Drupal&#039;s main administration page.  The red X&#039;s show where the users clicked.&lt;/em&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;video width=&quot;640&quot; controls&gt;
  &lt;source src=&quot;https://dri.es/files/usability-testing-minnesota-2.mov&quot;&gt;
&lt;/source&gt;
&lt;/video&gt;
&lt;p&gt;The blue dot in the video shows what the user is looking at on Drupal&#039;s user account creation page. Several users backed out in a panic because they thought they caused an error condition due to the red text.&lt;/p&gt;
&lt;p&gt;Seeing users consistently fail at what we consider to be &lt;em&gt;basic tasks&lt;/em&gt; (e.g. creating a new content type or adding a new user account) is a true eye opener. Let&#039;s be clear about this: this is Drupal&#039;s fault, not the users&#039; fault. The good news is that we came out of this with a long list of usability problems that we can fix.&lt;/p&gt;
&lt;p&gt;In fact, the Drupal team that participated in Minnesota tried to process much of the data prior to our DrupalCon Boston presentation on usability testing: check out &lt;a href=&quot;https://dri.es/files/usability-testing-minnesota.pdf&quot;&gt;our preliminary report from the usability testing&lt;/a&gt; (PDF, 6MB) or participate in the &lt;a href=&quot;https://groups.drupal.org/usability&quot;&gt;Drupal usability group&lt;/a&gt; where more information and results will be made available.&lt;/p&gt;
&lt;p&gt;Massive thanks to Chad and Cody of the University of Minnesota for making this possible, and a big thumbs up for all the Drupal participants that are committed to making Drupal easier to use. &lt;em&gt;Let&#039;s start addressing those problems!&lt;/em&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Embracing test-driven development</title>
      <link>https://dri.es/embracing-test-driven-development</link>
      <guid>https://dri.es/embracing-test-driven-development</guid>
      <pubDate>Fri, 15 Feb 2008 02:37:31 -0500</pubDate>
      <description>&lt;p&gt;At &lt;a href=&quot;https://dri.es/drupalcon-barcelona-wrapup&quot;&gt;DrupalCon Barcelona&lt;/a&gt; about 20 people gathered together for the Quality Assurance Birds of a Feather session. This led to the development of a &lt;a href=&quot;http://testing.drupal.org&quot;&gt;continuous testing infrastructure for Drupal&lt;/a&gt;. People that want to write tests for Drupal can, but don&#039;t have to.&lt;/p&gt;
&lt;p&gt;Second, in my &lt;a href=&quot;https://dri.es/state-of-drupal-presentation-september-2007&quot;&gt;State of Drupal presentation at DrupalCon Barcelona&lt;/a&gt;, I shared a list of the top-10 most requested Drupal improvements. On spot 9 we had &amp;quot;better internal APIs&amp;quot; and on spot 10 we had &amp;quot;better external APIs (import/export, web services)&amp;quot;. APIs that are designed for testability, are often better APIs. This comes from the fact that testability leads to more cohesive code with loose coupling. Important for readable, agile code.&lt;/p&gt;
&lt;p&gt;Third, Drupal 6 has been in a code freeze for 6 month. Often times, the behavior introduced by one patch inadvertently breaks the behavior of existing functionality. In absence of tests, it takes a while to shake out all the bugs and before you&#039;re actually confident to roll a new major Drupal release.&lt;/p&gt;
&lt;p&gt;As a result, people in the community have suggested to put more emphasis on testing in Drupal. Writing tests is expensive so it is hard to model the cost and benefits. However, the only way to past the costs and to experience the true benefits, is to take testing to the extreme. There is no middle ground. If we want to be serious about testing, we need to enforce, not just encourage, testing in the Drupal 7 development cycle and beyond. (And maybe we should consider introducing tests for Drupal 5 and Drupal 6 maintenance releases.)&lt;/p&gt;
&lt;p&gt;In such a world, patches that fix bugs should come with a test case that demonstrates the behavior being fixed. That patch would then be added to the regression test suite and run continuously to avoid that the bug gets re-introduced. In addition, patches that add new features or enhancements should come with test cases for this new functionality. Everything should be tested.&lt;/p&gt;
&lt;p&gt;Of course, this would require a significant commitment from the whole Drupal developer community. There is bound to be some controversy about the need to learn how to use &lt;a href=&quot;https://www.drupal.org/project/simpletest&quot;&gt;Drupal&#039;s test framework&lt;/a&gt; and the overhead and complications of having to write and submit a test. But over time, fewer people will be frustrated by bugs, the burden on patch reviewers will go down, code freezes will become shorter, APIs will continuously improve, and we would have more confidence in the stability of our releases. Last but not least, it actually improves overal productivity and encourages change and experimentation – something the Drupal community really takes pride in.&lt;/p&gt;
&lt;p&gt;As &lt;a href=&quot;https://dri.es/the-pain-before-the-payoff&quot;&gt;we learned before&lt;/a&gt;: sweeping changes are required to make major advances in technology, and often times there is a lot of pain before the pay-off. Are we willing to take some pain? Are we willing to enforce tests to be written as part of the Drupal 7 development process? I&#039;m willing to fully embrace testing, but only if you are willing to write tests ...&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Drupal usability testing</title>
      <link>https://dri.es/drupal-usability-testing</link>
      <guid>https://dri.es/drupal-usability-testing</guid>
      <pubDate>Sun, 03 Feb 2008 07:58:09 -0500</pubDate>
      <description>&lt;p&gt;When &lt;a href=&quot;https://dri.es/drupal-predictions-for-2008&quot;&gt;I predicted&lt;/a&gt; that there would be a big and concentrated effort to further improve Drupal&#039;s ease of use in 2008, I was cheating a bit ... The past months we&#039;ve been preparing some &lt;a href=&quot;https://en.wikipedia.org/wiki/Usability_testing&quot;&gt;formal usability testing&lt;/a&gt; for Drupal that will be conducted at the &lt;a href=&quot;http://1help.umn.edu/usability/lab.html&quot;&gt;University of Minnesota Office for Information Technology&#039;s usability lab&lt;/a&gt;. The university has a professional usability lab that will allow us to &lt;a href=&quot;http://1help.umn.edu/usability/gallery.html#gazeplot&quot;&gt;record eye-tracking data and video&lt;/a&gt; which will be provided to the &lt;a href=&quot;https://www.drupal.org&quot;&gt;Drupal community&lt;/a&gt;. &lt;em&gt;Très cool!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Chad Fennel and Cody Hanson of the &lt;a href=&quot;https://www.lib.umn.edu/&quot;&gt;University of Minnesota Libraries&lt;/a&gt; have taken an incredible lead in this; they secured the lab, they prepared test scenarios, they recruited test users, they are coaching us how to do usability research, and last but not least, they are footing part of the bills. Needless to say, this is a significant contribution to the Drupal project – and hopefully one that will have big impact on Drupal 7.&lt;/p&gt;
&lt;p&gt;Needless to say, formal usability testing is only one way to make Drupal easier of use. There are a lot of usability findings out there already (&lt;a href=&quot;http://factoryjoe.pbworks.com/FeedbackForDrupal6&quot;&gt;example&lt;/a&gt;), and many of us know first-hand which changes need to occur to improve Drupal&#039;s usability. All it takes is a knack for usability, some development skills and a lot of time and effort. Ultimately, everyone can help – with or without a professional usability lab.&lt;/p&gt;
&lt;p&gt;The past years, I&#039;ve pushed hard to make usability reviews part of the development and patch review process. I strongly believe that usability reviews should be tightly integrated with the software development process; rapid usability feedback and incremental usability improvements allows us to build better software faster. And it is working – every major Drupal release has become significantly easier to use.&lt;/p&gt;
&lt;p&gt;Nonetheless, there is a lot of work left to be done. I hope that the formal usability testing at the &lt;a href=&quot;https://www.lib.umn.edu/&quot;&gt;University of Minnesota Libraries&lt;/a&gt; will provide us with a fresh perspective and that it helps train the Drupal community&#039;s eye for usability. Because more than anything else, I want to us to flatten the &lt;a href=&quot;https://dri.es/drupal-learning-curve&quot;&gt;Drupal learning curve&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;More information about the usability testing will be made available shortly. The goal is to share some first results at &lt;a href=&quot;http://boston2008.drupalcon.org/&quot;&gt;DrupalCon Boston&lt;/a&gt; next month.&lt;/p&gt;
</description>
    </item>
  </channel>
</rss>
