Prev | Current Page 96 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

We are going to use unit tests to ensure that the code works the way we
intend it to. Unit testing is the process of testing individual functionality separately from the rest of the code.
The tests are designed to be run very regularly and so have to be fast as we want to run them whenever we
make changes to the code. Whenever you run the tests you can be sure that your code functions correctly. This
gives you a safety net to make changes to improve your program because if the tests still work, then the
changes were good. If the tests no longer work, then the changes can be backed out.
The process of changing already working code to make it better and easier to understand is known as
refactoring. This is the single most important skill required for maintaining an application over a long period of
time. Refactoring without tests to check that the changes haven??™t broken anything is an extremely risky
business and so doesn??™t get done. With tests though, refactoring is easy and possibly even fun; everything
changes because of confidence.
As we are going to write tests for the majority of our code, we need a system to run them. PHPUnit
(http://www.phpunit.de) is a testing framework for PHP that runs each test in isolation and provides
functionality to allow us to organize the test code.


Pages:
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
pleiades.binto.pl zamykanie naczynek bielsko Marcin Wróbel mallow.histod.pl projektowanie stron gdynia