Specifications
Testing
Reviewing and testing code is another basic point of software engineering that is often over-
looked in Web development. It’s easy enough to try running the system with two or three test
cases, and then say, “yup, it works fine.” This is a commonly made mistake. Ensure that you
have extensively tested and reviewed several scenarios before making the project production
ready.
We suggest two approaches you can use to reduce the bug level of your code. (You can never
eliminate bugs altogether; but you can certainly eliminate or minimize most of them.)
First, adopt a practice of code review. This is the process in which another programmer or team
of programmers look at your code and suggest improvements. This type of analysis will often
suggest:
• Errors you have missed
• Test cases you have not thought of
• Optimization
• Improvements in security
• Existing components you could use to improve a piece of code
• Additional functionality
Even if you work alone, it can be a good thing to find a “code buddy” who is in the same situ-
ation and review code for each other.
The second suggestion that we have is that you find testers for your Web applications who rep-
resent the end users of the product. The primary difference between Web applications and desk-
top applications is that anyone and everyone will use Web applications. You shouldn’t make
assumptions that users will be familiar with computers. You can’t supply them with a thick man-
ual or quick reference card. You have to instead make Web applications self-documenting and
self-evident. You must think about the ways in which users will want to use your application.
Usability is absolutely paramount.
It can be really difficult to understand the problems that naive end users will encounter if you
are an experienced programmer or Web surfer. One way to address this is to get testers who
represent the typical user.
One way we have done this in the past is to release Web applications on a beta-only basis.
When you think you have the majority of the bugs out, publicize the application to a small
group of test users and get a low volume of traffic through the site. Offer free services to the
first 100 users in return for feedback about the site. I guarantee you that they will come up
with some combination of data or usage you have not thought of. If you are building a Web
Building Practical PHP and MySQL Projects
P
ART V
474
28 7842 CH22 3/6/01 3:37 PM Page 474










