Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

What Is Automated Testing?

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:03
    What is Automated Testing?
  • 0:05
    with Joe Shindelar
  • 0:07
    Whether you take the time to retrofit all
  • 0:10
    of your existing code with tests, decide to make test automation
  • 0:14
    a requirement for future development,
  • 0:16
    or even just write a few tests for your application's critical paths,
  • 0:20
    automated testing is worth the investment.
  • 0:22
    It's far more efficient than paying someone to perform those same tests
  • 0:26
    over and over again, and also more likely reliable.
  • 0:30
    Humans have a tendency to get bored doing repetitive tasks,

What Is Automated Testing?

Loading...

Developers write tests for a variety of different reasons and understanding why, and how, writing tests can improve the quality of our code and our sanity helps motivate ourselves to write tests. The tests we write usually take one of two forms. Functional tests are used to test an applications behavior. When I click this link does it take me to the about page? Unit tests are used to verify the logic within a small segment, or unit, of code. When I call this function that is supposed to return a link with these specific parameters does it return the correct data? There are a ton of reasons that investing time and resources into writing automated tests is a big win in the long run and in this lesson we'll cover a bunch of them, including:

  • Eliminate repetitive tasks.
  • Improve overall stability of an application.
  • Ensure critical paths & edge cases function.
  • Reduce (not eliminate) the number of tests that need to be performed manually.

Types of Tests

There are are two main types of tests and we're going to be writing. Functional tests, and Unit tests.

Functional tests, also known as integration tests, test the functionality of a particular aspect of an application by simulating normal interaction with that system. In the case of web software this usually refers to simulating a user navigating and interacting with the website as if they where using their browser, keyboard, and mouse.

Unit testing is the art and practice of taking a small portion of code, a unit, and subjecting it to programmatic tests to prove its correctness. For example, testing a function that performs unit conversion by comparing a known input with an anticipated result.

UPDATE: This video references qa.drupal.org which is no longer in use. On Friday, October 23rd 2015 - qa.drupal.org received and processed it's last
test. The qa.drupal.org testbots have now been superseded by DrupalCI - and test results are now displayed directly on Drupal.org. While the mechanics are different now, the end result is still all patches to Drupal core are automatically tested.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.