Intro to SimpleTest

Testing saves time, allows you to provide code-level checking for your clients' crazy requirements, documents how your code is supposed to work, frees you to refactor your code without fear of breaking things, and ensures you never get the same bug twice. Sounds great! But how do you get started? This first session will introduce the concepts and basic knowledge required to write tests for Drupal.

Automated testing has been an established best practice in software development for many years, which lets developers spend more time doing fun stuff like writing code and designing applications by automating the testing process. This concept has been implemented for Drupal with the SimpleTest module, which has been integrated into core in Drupal 7. The use of automated tests makes it easy to clearly define the expected behavior of a piece of code; not only does it reduce the need for manual testing but it also results in higher code quality and security.

In this session we will walk you through the process of writing tests for new functionality as well as writing tests to send along with your bug reports. After a brief presentation of the concepts, we will work on real-life examples and write our tests from scratch to show you how easy it is. When using the API provided by SimpleTest, writing tests requires very little PHP programming knowledge so it is accessible even to people who do not describe themselves as developers.

For the examples in this presentation we will use the latest Drupal 7 code, since the primary goal is to get more people writing tests for Drupal core before its release in a few months. However, the API hasn't changed much compared to the contributed SimpleTest module available for Drupal 6, so you will be able to use what you learn during this session and apply it to existing modules. By coming to this session, you will have all the prerequisites to participate in the "awesome testing party".

(description adapted from our presentation in Szeged: http://szeged2008.drupalcon.org/program/sessions/testing-part-1-intro-te...)

Co-presenters: 
18 score

Testing is tedious. There's

Testing is tedious. There's never enough. I'm often left worried that I broke something. If many other programmers are like me, there's a lot of testing to be done and it's growing exponentially.... look at micro$soft window$ ... any help would be greatly appreciated.