Loading ...
Sorry, an error occurred while loading the content.

Re: [extremeperl] unit tester

Expand Messages
  • Rob Kinyon
    ... That is a personal preference. I prefer mocks, because it allows me to test in isolation. My theory is that perfect components will work together
    Message 1 of 33 , Aug 29 6:57 PM
    • 0 Attachment
      On 8/29/05, Rob Nagler <nagler@...> wrote:
      > Rob Kinyon writes:
      > > Please explain more about what you mean "weak on the deviance side". I
      > > tend to test my failure cases using mocked objects and subroutines,
      > > which means the tests are positive tests, not negative ones.
      >
      > I'm not a big fan of Mock objects. I only use them when it's
      > absolutely necessary. I like end-to-end tests, even our unit tests
      > hit the database.

      That is a personal preference. I prefer mocks, because it allows me to
      test in isolation. My theory is that perfect components will work
      together perfectly. It also forces me to work out my APIs a lot
      sooner. This means that I can refactor with confidence.

      > > As for the repetitive nature ... I look at it as the difference
      > > between ASM and Perl. Test::* is ASM, but ASM is very simple to prove
      > > correctness for.
      >
      > I assume you mean Assembler by ASM. I hypothesize the shorter the
      > theory, the easier the proof.

      Unfortunately, that doesn't work out in real life. I have only to
      point to the Riemann Hypothesis. (There is no X^n + Y^n = Z^n, X, Y,
      Z, and n being integers where n > 2.) The proof took 400 years, 300M
      IQ points, and about 200 pages to accomplish.

      > The danger of simple -- as in repetitive -- is that there are more
      > components for the human eye to validate. By programming
      > declaratively, I create complex infrastructure for repetitive tasks,
      > and use them repetitively. If testing were a "one off", I wouldn't do
      > this. However, the Rule of Three applies in spades when it comes to
      > testing, and Perl gives you some extremely powerful tools to eliminate
      > repetition.

      Absolutely. And, I do refactor my tests. However, I focus primarily on
      refactoring my code so that I need fewer tests overall. If I can test
      the same functionality with fewer tests by using cleaner APIs and mock
      objects, isn't that also good?

      Rob
    • Dave Cross
      ... You didn t get a reply to this. I hope this isn t too late to be useful. prove is a command line test runner. It s included with recent versions of
      Message 33 of 33 , Sep 14, 2005
      • 0 Attachment
        Terrence Brannon wrote:
        > Adam Sroka <adam.s@...> writes:
        >
        >
        >>I just use Test::More and prove.
        >
        >
        > what is prove? I could not find it in the main Test::More docs:
        >
        > http://search.cpan.org/~mschwern/Test-Simple-0.60/lib/Test/More.pm

        You didn't get a reply to this. I hope this isn't too late to be useful.

        prove is a command line test runner. It's included with recent versions
        of Test::Harness.

        http://search.cpan.org/dist/Test-Harness/

        Dave...
      Your message has been successfully submitted and would be delivered to recipients shortly.