Page 1 of 1
simpletest vs Selenium
Posted: Mon Aug 28, 2006 6:13 am
by jmut
http://www.lastcraft.com/simple_test.php
http://www.openqa.org/selenium-core/
Anybody who has experience with both dare to make a comparison?

Are they used for same purpose. Pro/cons of each.
Posted: Mon Aug 28, 2006 6:29 am
by Ambush Commander
I don't believe Selenium is a unit tester, so the two aren't mutually exclusive.
Posted: Mon Aug 28, 2006 10:23 am
by Weirdan
Selenium is a tool for
integration testing (excellent tool, btw), SimpleTest is unit tester. It's good to use both.
Posted: Mon Aug 28, 2006 8:17 pm
by wei
Posted: Tue Aug 29, 2006 2:17 am
by jmut
well, after reading through wiki and links you provided I came to the following conclusions:
1. Functional test is a synonym for intergration tests.
2. Unit tests are more or less used as regression tests. Meaning on each change in functionality in the code you run them to see nothing broke before. And of course used for refactoring (not adding new functionality). It is just that the term "regression tests" could be used for more than finding if old code is not broken. (like performance on compiling and stff)
3. Integration tests in web development is testing if components work as whole(as modules). So for example...if able to order a product (several steps perhaps), or if some dropdown is what you expect to be, text is correct here and there. Actually prooving/testing that through the View/Interface you could achieve what your software is supposed to do.
4. Simpletests is used for unit test cases and intergration/functional tests. Selenium does not (maybe it does, didn't see it) do unit test cases but better do intergration/funcitonal tests than simpletest as it supports javascript and probably more stuff
5. So ultimately I would rather use PHPUnit2 for the unit test part and Selenium for the integration/functional tests.
6. Are intergration/functional tests supposed to include human interaction? Or they should/could be used as unit test cases.
Am I on the right track here?
Posted: Tue Aug 29, 2006 2:39 am
by wei
to be a little more picky, functional tests using selenium is more like acceptance testing, as it is block box testing (i.e., it doesn't know the internals of the system under test). Integration testing is not necessarily black box, as it often tests the correctness of a subsystem.
SimpleTest contains a web tester that can be used to do web testing, but lacks ability to act like a browser with javascript.
Posted: Tue Aug 29, 2006 4:50 am
by jmut
wei wrote:to be a little more picky, functional tests using selenium is more like acceptance testing, as it is block box testing (i.e., it doesn't know the internals of the system under test). Integration testing is not necessarily black box, as it often tests the correctness of a subsystem.
SimpleTest contains a web tester that can be used to do web testing, but lacks ability to act like a browser with javascript.
ok, import thing is I caught the main idea

.... to catch "picky" stuff I will definitelly need more time practice/reading.

Posted: Tue Aug 29, 2006 6:31 am
by wei
another very important advantage of testing (unit tests and integration tests) is the confidence boost during refactoring. It means that if all the tests pass after you have change some code (make small changes) you can be confident that at least the correctness covered by the tests are indeeded correct. Once your code base gets bigger, you will fear changing the code without any test to back them up. One way to write tests other than writing the expected behaviour is to create conditions to break your existing code.
refactoring the actual test code is sometimes useful, e.g. create custom asserts, such as assertIsCustomerAccount($account) if used repeatedly.