Complicated Environments and associated testing

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Complicated Environments and associated testing

Post by Todd_Z »

Using functions such as assertEqual or is_numeric are all well and good when testing individual functions, even classes, but what about testing full categories of a site, where there are $_GET vars, $_POST vars, database information, you get the idea. As I have written a custom framework, I'm looking to create unit testing tailored to my system, however how do you make sure that all 50 variables involved have appropriate values?

I know i should plead the fifth and walk away, but to be fair, I simply use the fact that certain code, for example my DB abstraction layer is used in every one of my pages to assure myself that it works... well enough :-\

It's driving me nuts that I can't prove that my code is... well... perfect. I know that's obviously an impossibility, but certain code, such as the DB abstraction layer should be absolutely flawless.

Well, thanks for listening to me rant. :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Two words: mock objects.
Post Reply