Test-Driven Development for Web Applications
This is a session in the Technical: Propeller Hats Required Track at HighEdWeb, presented by Brett Bieber at the University of Nebraska-Lincoln.
Unit testing framework benefits over home brew: testing infrastructure is already built. Example: PHPUnit
Downsides: easy tests, easy input methods. Testing the right things at the right level? Hard to pinpoint causes of error.
Test small pieces, not applications. Don’t test against live data. If your test are PASS/FAIL, code appropriately. Benefits of unit testing: Ensure new features don’t break expected behavior. Code coverage analysis: graphical representation of where we need unit tests. Downsides: It’s possible to run tests that test incorrect logic.
Browser based testing with Selenium. From OpenQA: http://www.openqa.org . Easily record and playback actions. Automate acessiblity checks — cynthiasays.com .
Need continuous integration, not just tests. But: tests can be the foundation for CI. Tests can serve as secondary documentation. Ensure that all developers are working with the latest code, adn everyone can see that progress is being made.
Cruise Control: cruisecontrol.sourceforge.net . A framework for continuous build/integration process.
Joel Spolsky: 12 Steps to Better code.
On the Effectiveness of Test-first Approach to Programming: Improves poductivity.