SitePoint Sponsor

User Tag List

Page 4 of 5 FirstFirst 12345 LastLast
Results 76 to 100 of 109
  1. #76
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by been
    ceefour, there really isn't any alternative, you just have to try it to see what all the fuss is about.

    It took me about a weekend (around 20 hours if I remember correctly); I downloaded SimpleTest, went through the excellent online tutorial and then started writing tests for my own classes. I assure you, once you start seeing the green bar popping up, you do not want to go back.

    As for the "I don't have time to write tests"-excuse, well, don't even bother, I have found that my productivity has gone up (after it initially went down for a short while) since I started unit testing.

    Consider both the unit test and the unit being tested as 1 whole component, writing tests is about 50% of the job and writing the unit being tested also takes around 50%. When you look at it that way, it just isn't extra time is it, I mean you'll have to test at one point or the other, why not do it while you're developing instead of trying to cram it into the last week of a project's schedule (if you're lucky)
    I agree completely - I've been playing with it for about a month, and I'm in love. You productivity goes down at first, but it goes way up. You try to pass specifric tasks at once, and not design the whole object. I havent had to debug va fiddling since I started using them - if I want to stimulate user input, I just set up Mocks for my Request class. It really helps with object design, and keeps you aware of coupling. I'm waiting for the time when I can use webtester to test the app as a whole unit - I fiddled with it (in vain, for the wrong reason ) this weekend and have decided it's a super-tool.

  2. #77
    SitePoint Addict pachanga's Avatar
    Join Date
    Mar 2004
    Location
    Russia, Penza
    Posts
    265
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    You could try running it through Cygwin or the ActiveState Perl distribution. I would be curious to seeif you get it working. Use the version in CVS as it gets updated constantly at the moment.
    Thanks, i'll give it a try for sure, i'll post the results in the SimpleTest mailing list...

  3. #78
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dependent test cases?

    Is it "allowable". TDDBE book says that each test case method (not a unit test case class, which is even more) should be independent, i.e. ordering isn't relevant, and failing one test case doesn't mean other test cases won't be executed. If "Dependent methods like testNG. If methodB depends on methodA and methodA fails methodB is Skipped." isn't this against the "rule"?

    In my expectation there may be some [wide] uses that dependent test cases is not necessarily a bad thing, and even it's a powerful tool (if done correctly).

    Anyone?

  4. #79
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ceefour
    If "Dependent methods like testNG. If methodB depends on methodA and methodA fails methodB is Skipped." isn't this against the "rule"?
    You might have a whole set of intergration tests. If for some reason you are unable to get a database connection, is it more useful to get a single error message:

    Code:
    Unable to establish database connection, test case aborted
    or have hundreds or perhaps thousands of error which say the same thing?

    In both cases when you resolve the problem you will continue on with running the full suite of tests.

  5. #80
    SitePoint Addict
    Join Date
    May 2003
    Location
    Calgary, Alberta, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ive got to admit, Ive never used testNG but reading about some of its features, I could definatly see how it would make testing an easier job.

    Quote Originally Posted by lastcraft
    I am going to add an abandon() method which bails out of the entire test case. Would this be sufficient?
    Yup. Not quite as nice as TestNG but to get as fine grained as testNG you also have to have much more tedious meta data. Trade-off I suppose.

    The situation arises where a test case depends on another test case or an entire group depends on another group.

    It wouldnt have to be a method dependent on another method.

  6. #81
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think whatever testing tool you create should be able to integrate into cruisecontrol.
    FASTTIE.com The fastest way to get around the Internet.

  7. #82
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bbscan
    I think whatever testing tool you create should be able to integrate into cruisecontrol.
    Well I don't know about cruisecontrol, but Harry was able to integrated SimpleTest with Rephlux for WACT by using the CommandLine Reporter and the return code.

  8. #83
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    has anyone used cruisecontrol before? For team development it is one of the best tools i have seen
    FASTTIE.com The fastest way to get around the Internet.

  9. #84
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by bbscan
    has anyone used cruisecontrol before? For team development it is one of the best tools i have seen
    We tend to run all the tests as part of check-in and the tests run as part of roll-out anyway (failures cause a rollback). We are however deploying Rephux in case we have missed anything. From what I have heard, Cruise Control is a pain to set up. Is this true?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  10. #85
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Marcus - All I have set up is cruisecontrol.net but it was pretty straight forward. In fact it was probably one of the easier implementations I have done and it worked great for us. Martin Fowler who I think is one of the best writers out there is a big proponent of cc as well.
    FASTTIE.com The fastest way to get around the Internet.

  11. #86
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by bbscan
    Martin Fowler who I think is one of the best writers out there is a big proponent of cc as well.
    Is that because he wrote it ?

    Anyone tried DamageControl, the Ruby implementation? Anyone else tried Rephlux? Perhaps we should start another thread for this?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  12. #87
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would be interesting to mix SimpleTest(2), Phing and Rephlux. Could probably do documenting too, but that could be left up to Phing. Would be good for small-medium public projects.

    I think another thread might be a good idea.

  13. #88
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dylanegan
    Would be interesting to mix SimpleTest(2), Phing and Rephlux. Could probably do documenting too, but that could be left up to Phing. Would be good for small-medium public projects.

    I think another thread might be a good idea.
    There is SimpleTest version 2 ?!?!?!? Hey, my version 1.0 I downloaded two weeks ago is already outdated!

    Hmm I guess somebody should rename this thread to "SimpleTest..." and not just generic "testing tool..."

    BTW is there a way for SimpleTest to have sequential/ordering of tests in a test case? I posted a similar question a week ago but seems to not having a good response, even the abandon() function that is definitely required wasn't even there.

    What I mean is something like a UserTestCase which contains:

    1. testSignupForm
    2. testSignupSubmit
    3. testCheckActivationEmail
    4. testActivateMembership
    5. testLogin
    6. testLogout
    7. testLogin
    8. testDeleteMembershipForm
    9. testDeleteMembershipSubmit
    10. testLoginForm
    11. testLoginUserDoesNotExist

    All these tests are run sequentially, where ordering is critically important. When one test fails, the other (rest) tests in this test case class (or group?!?) won't be executed. Note that these are NOT unit tests, these are application tests (e.g. tests using actual presentation+application+backend etc.) But using mock objects might be possible too.

  14. #89
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I don't think there is a SimpleTest 2 available yet (Marcus?) and that's why I had it in parentheses, so it could support version 1 for PHP4 code and version 2 for PHP5.

    Although im currently not using SimpleTest for UnitTesting I might switch over to it when a more PHP5 compatible version is available.

  15. #90
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use SimpleTest with PHP5 every day at work

  16. #91
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been having some weird issues with PHP5 + simpletest + cookies (headers already sent when they arent with exact same script in PHP4). I'm thinking its something with buffers; they seem to have been slightly tweaked in 5. Not really sure though.

  17. #92
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Today I first experimented using SimpleTest. Getting it running was the easiest, although SimpleTest's tests didn't all pass on my computer (Marcus, what's wrong?)

    Fail: simple_mock_test.php -> TestOfMockReturns -> testNoUnitTesterSetThrowsError -> Expected error not found at line [359]
    Fail: simple_mock_test.php -> TestOfMockExpectations -> testSettingExpectationOnNonMethodThrowsError -> Expected error not found at line [450]
    Fail: simple_mock_test.php -> TestOfMockExpectations -> testBadArgParameter -> Expected error not found at line [573]
    Fail: simple_mock_test.php -> TestOfPartialMocks -> testSettingExpectationOnMissingMethodThrowsError -> Expected error not found at line [645]
    86/86 test cases complete: 1831 passes, 4 fails and 0 exceptions.

    Anyways... During the first 15 minutes, I'M *INSTANTLY* ADDICTED! ;-)
    Somebody sometime ago said "the first time you saw the green bar, most likely you won't want to live again without it". I guess that's true. ;-)

    But again, I have a feature request. I wish there's a setting/property in HtmlReporter that will also display passed tests as green bars. Of course this will clutter the test page results but sometimes I want it, especially for smaller tests. These are just eye candy, but me want candy... :-)

    Also it'll be great if the "passed test displayer" can display it according to several detail levels:
    - grouping only
    - grouping & test cases
    - grouping, test cases, and test methods
    - all details (grouping, test cases, test methods, & asserts)

    Thanks Marcus... Come on! Work it out!!! :-D

  18. #93
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    About the Web Tester...

    I have to say that this is one of the most (and probably most complicated) powerful feature of SimpleTest. While it's powerful, I think it'll be quite tiresome to maintain this subfunctionality.

    Just imagine: A full-featured scriptable browser inside a testing library?? Have you ever heard of Snoopy (snoopy.sourceforge.net)? SimpleTest makes Snoopy just like its little child...

    I'm not sure, SimpleTest as it is now is already the most complete tester library implementation for PHP... If we're going to add more typical uses for it, I'm afraid that the library will grow quite bigly... I'm suggesting there should be some kind of "layers", the core SimpleTest, the typical SimpleTest modules (such as web tester), and extensions (which may or may not be part of official SimpleTest distribution). SimpleTest's future is [very] bright... that is, if the maintainer is active enough in it.

  19. #94
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by ceefour
    Today I first experimented using SimpleTest. Getting it running was the easiest, although SimpleTest's tests didn't all pass on my computer (Marcus, what's wrong?)
    Basically the error trapping has failed. It looks like something else has grabbed the PHP error handler. My bet would be some kind of debugger. Could you try running the tests with XDebug or similar disabled? Also are you using PHP 5.0.3? There seem sto be something very specific to this version taht is causing problems.

    Quote Originally Posted by ceefour
    Anyways... During the first 15 minutes, I'M *INSTANTLY* ADDICTED! ;-)
    I did say you had to try it .

    Quote Originally Posted by ceefour
    But again, I have a feature request. I wish there's a setting/property in HtmlReporter that will also display passed tests as green bars. Of course this will clutter the test page results but sometimes I want it, especially for smaller tests. These are just eye candy, but me want candy... :-)
    See http://www.lastcraft.com/display_subclass_tutorial.php

    Quote Originally Posted by ceefour
    - grouping only
    - grouping & test cases
    - grouping, test cases, and test methods
    - all details (grouping, test cases, test methods, & asserts)
    I am afraid that is down to you...

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  20. #95
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by ceefour
    I have to say that this is one of the most (and probably most complicated) powerful feature of SimpleTest. While it's powerful, I think it'll be quite tiresome to maintain this subfunctionality.
    90% at least of the effort of SimpleTest has been in the web tester. That said, once written it should settle down.

    Quote Originally Posted by ceefour
    Just imagine: A full-featured scriptable browser inside a testing library?? Have you ever heard of Snoopy (snoopy.sourceforge.net)? SimpleTest makes Snoopy just like its little child...
    I hadn't heard of Snoopy. Oh well, it only took two years to write . There are some differences though. SimpleTest actually parses the HTML so as to allow methods like clickLink() and so on. It also does authentication. That said, it seems that Snoopy handles the referrer properly.

    Probably a better way to handle the web testing though is in the browser itself as you get the parser and JavaScript engines for free.

    Quote Originally Posted by ceefour
    I'm suggesting there should be some kind of "layers", the core SimpleTest, the typical SimpleTest modules (such as web tester), and extensions (which may or may not be part of official SimpleTest distribution).
    That is indeed the structure. I am about to move more stuff out of the core and into the reporters as well, so the core should get shorter.

    Quote Originally Posted by ceefour
    SimpleTest's future is [very] bright... that is, if the maintainer is active enough in it.
    ...and has enough time .

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  21. #96
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    I hadn't heard of Snoopy. Oh well, it only took two years to write . There are some differences though. SimpleTest actually parses the HTML so as to allow methods like clickLink() and so on. It also does authentication. That said, it seems that Snoopy handles the referrer properly.
    My bad..I should have at least mentioned it. It was written by the same folks who wrote Smarty, so I encountered it years ago when I followed the Smarty list closely. IIRC, it shells out to a binary curl to get SSL traffic (perhaps has been updated in the interveaning years though).

  22. #97
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    Hi...



    Basically the error trapping has failed. It looks like something else has grabbed the PHP error handler. My bet would be some kind of debugger. Could you try running the tests with XDebug or similar disabled? Also are you using PHP 5.0.3? There seem sto be something very specific to this version taht is causing problems.



    I did say you had to try it .



    See http://www.lastcraft.com/display_subclass_tutorial.php



    I am afraid that is down to you...

    yours, Marcus
    If I posted a subclass, or a patch to HtmlReporter, would you mind including it to official SimpleTest distribution? I know it will be quite trivial, but I think some other people will want such functionality.

    I mean, it's actually more like copying whatever code is to display the fail bar and change the color...

    The multi-level/grouped display would be a bit more complicated, but if SimpleTest's Html Reporter architecture is good enough then it shouldn't be a big problem.

    About Snoopy, I guess it's still quite maintained. The last release is December 2004, not bad at all. It may not have all the features in SimpleTest's browser, but if you considering outsourcing some parts of your code, then Snoopy is definitely on the list. At least you won't have to delve into very low level details.

    Anyways, some people would also want XML parsed tests. And SOAP tests. And such stuff... Phew! Distributed (i.e. web services) stuff would be one of the hardest parts of application to test... (since they require remote connection to some server, duh... we can use mock objects anyway, but not always)

  23. #98
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy assertException ??

    Hey... where is assertException() ?

    One of my most hated things when working with a library/software is to have to modify its source code or extend something from it on the FIRST day I'm using it.

    I would accept gladly if I've been toying with something for sometime, about a week or a month, then find that I need something that isn't already there. But ON THE FIRST DAY?

    If I need something on the first day I'm using something, and it isn't there, probably is more people out there are experiencing almost the same thing as me.

    On the first day, I have to:
    - subclass HtmlReporter
    - create assertException()

    I wish somebody would be generous enough to "fix" these in SimpleTest so fewer people would experience these "first day syndrome" from SimpleTest.

    Actually I experienced the same with PHP 5. The first day (even the first hour) I installed PHP 5 from the source I had to actually modify its source, renaming PHPRC to PHP5RC. The reason is because I had two installations of PHP, one PHP 4 and one PHP 5. And I want to separate the configuration files for the two PHP versions (even, separate configuration for each subdomain, that's why there's that PHPRC env), but, alas, both versions are using the exact same env variable, and unfortunately PHPRC is the highest priority in loading of PHP configuration file.

    Have you ever had your own first-day syndrome? Tell me.

  24. #99
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ceefour
    - subclass HtmlReporter
    Seeing passes is a fixation you only have for the first week Actually "green bar" is a bit of a misnomer for me lately as I tend to run my test from the CLI reporter, not through a web page Maybe I will have to spend a little time looking up the codes to change colors in a bash shell so I can get my green bar back

    Quote Originally Posted by ceefour
    - create assertException()
    SimpleTest is a php4 framework. Now that 1.0 has been released, this opens up the opportunity for a SimpleTest2 which nativly supports PHP5, including Mocks with interfaces, exceptions, etc.

  25. #100
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sweatje
    Seeing passes is a fixation you only have for the first week Actually "green bar" is a bit of a misnomer for me lately as I tend to run my test from the CLI reporter, not through a web page Maybe I will have to spend a little time looking up the codes to change colors in a bash shell so I can get my green bar back



    SimpleTest is a php4 framework. Now that 1.0 has been released, this opens up the opportunity for a SimpleTest2 which nativly supports PHP5, including Mocks with interfaces, exceptions, etc.
    About the green bar in passes, it's not just eye candy. It's actually useful for tracking the progress of our tests (especially in large, long tests). When running the SimpleTest tests, it'll be more entertaining to see each test group pass to be displayed as a green bar, rather than waiting a white blank screen with only the title displayed.

    In small tests, we may want to see each assert passes. In larger tests, we may only want to filter the display so it'll only display the test groups or test files, not the test cases/methods/asserts. This level of grain should be configurable easily, and NOT by forcing the users to develop their own subclass.

    About the PHP 4 framework, I agree. But I can live without all other PHP 5 stuff (including interfaces, but...) but I can't live with assert[No]Exception!!! It's just so unfair!

    For now I use this (very ugly, eh?)

    PHP Code:
        public function testUnhandledUrl() {
            try {
                
    $this->Browser->fetch('http://www.microsoft.com');
                
    $this->assertTrue(false);
            } catch(
    Exception $e) {
                
    $this->assertTrue(true);
            }
        } 
    Damn... SimpleTest is *very* addictive. I am not only using tests but actually I've moved to the side of Test-driven development, really. My final project was planned to be developed using RUP (Rational Unified Process) but I'll revise it to using TDD. I'm not sure if I'm gonna use eXtreme Programming but I'll definitely use TDD.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •