Re: Re: Testing

From: Date: Tue, 23 Nov 2004 19:15:37 +0000
Subject: Re: Re: Testing
References: 1 2  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-2019@lists.php.net to get a copy of this message
Greg Beaver wrote:
this division is not accurate. I would put it 1) PHPUnit and Simpletest can only be used to test classes and functions
I agree, no public method should be released without couple unit testing
2) .phpt can be used to test anything that PHP can be used for.
What I like too. This way coding the test enable any test you like to do and repeat.
These 2 steps should be required for any first acceptance of a release. and augmented for any further extensions.
Some packages simply can't be easily regression-tested by all users.
Could never be required
Generally, apps that absolutely require complex external interfaces like DB or MDB will always require some external setup by the tester. Packages like Net_Curl, for instance, require that an external server be set up over the internet -
Indeed they need to be tired and hazarded.
it's literally impossible to test its functionality without this step.
Again, I'm ok, better shock your app on your own
I hope it's no offense if I point out that: (1) I need to edit all of it to build unit or test scripts, I want my box to learn as I'm testing and generate some canvas scripts! Some kind of learning break-points, at begin of scripts or methods, what should be removed by the developer when ok (as debugger) So I can choose afterward what and what tests where meaningfull. (and adapt them by edit for unit or test) I aim to be a good developer, so I must be lazy.
I agree with the "I aim" part, but have no idea what you are talking about in the rest of the paragraph, could you rephrase?
Let have a script.php, requiring some variables, say in $_POST for this script.php, I can build some real value tests unit or whole apps with PHPUnit and Simpletest But I need to build it. I would like to turn a key as I am testing this script.php (perhaps then over HTTP) what would then record the testing (recording the $_POST in the session) Someway, somehow that recording will stop I like to have this record generating me some PHPUnit or .phpt scripts So puting the $_POST recorded as php script initializing variables.
(2) The dynamic in the script is not included there What is with two clients asking that stuff tested single in the .phpt script ? Some funny situations can occur. I would believe it's missing some more step, what is related to benchmark (performance oriented) but more to some simulation environment.
again, what are you trying to say?
A lot is server/client what is all cases server/clientS and at most serverS/clientS PHPUnit and .phpt have no 'S' and no 'S''S' (one to one) It's due to test with, let say, "overcrossing clients"... then best simulate less or more stochastic requests When testing a pckg, some third party exists, what pear not necessarly controls, but interaction is dynamic, so we need to test it (so as no control from pear, simulate)
SIMULATION is the only way to tire the service or to provoke hazard. A third step or layer is missing.
Are you talking about mock objects? If you want to use mock objects, it's no harder to do this with PHPUnit2, Simpletest, or simply by writing them yourself. I wrote several mock objects for PEAR's unit tests, including an object that literally simulates the entire PEARweb without using the internet. It didn't take long, but it did take work. Greg Sure these mock objects are good to use.
But they transform the script, don't they? Where is the definition for mock objects, or some examples ? From my point of view, simulation should come from outer, as far as possible script not knowing it's simulation. à+ bertrand Gugger (toggg)

« previous php.pear.qa (#2019) next »