Some early thoughts on web application testing
posted under category: ColdFusion on September 12, 2007 by Nathan
Recently I decided to become interested in software quality. Let me assure you, it's not something you gravitate to when you're cowboy coding for thrills or something you decide to pick up because the cool kids are doing it. No, this is something you have to decide to like.
I said I decided this recently, so here are a couple of my early thoughts on the subject.
Web application testing tends to focus on the front-end. If you can see it in a browser, that's what you need to test. Or at least that's what I hear a lot of. Of course this testing is great at revealing missing requirements and catching exceptions, but that's the same testing we used when we tested our HTML pages in the 90's.
Come on now, is this a web site or a web application? Am I making a script or a system? Do I serve pages or programs? I certainly like to charge my clients based on the latter.
So how does testing change when you consider applications opposed to pages? This is the question I've been pondering, and I am still working on my conclusions. One partial answer is the unit test.
A unit test is an automated script that calls methods on an object. It helps to have a unit test framework that can run the tests and tell you the results in a pass/fail style (there are a couple for CF). The framework can run a number of unit tests all at once to give you a view on your overall system.
Something notable from The Pragmatic Programmer, tip # 66, "Find Bugs Once," meaning once a bug makes it past you, the developer, and appears for someone in QA or, worse, a customer, add that bug to your unit test to make sure it never slips by again.
The bright red glaring issue in this space is the lack of testable software. How do you make ColdFusion applications that can be driven by TDD? Is OO the only answer? Can you unit test a .cfm file? How can I unit test a legacy (CFMX6.0) application?
I'd like to hear what people are doing. Comment below or blog your own experiences in reply. Thanks!
More later, like I said, I am now interested in the subject :)