Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Let's try for a better CPAN experience

by Anonymous Monk
on Jun 01, 2021 at 20:41 UTC ( #11133387=note: print w/replies, xml ) Need Help??


in reply to Let's try for a better CPAN experience

Base your tests exactly on what you wrote. Your tests should match what your module expects to be able to do, and how it expects to do it, and should exercise every one of those things. It should test for every library that it depends on, and exercise (only, but every one of) the calls that it expects to make against those libraries. It doesn't need to test the Perl interpreter itself. It doesn't need to test that math works.
  • Comment on Re: Let's try for a better CPAN experience

Replies are listed 'Best First'.
Re^2: Let's try for a better CPAN experience
by Your Mother (Archbishop) on Jun 01, 2021 at 21:57 UTC

    The reason why it is potentially a good idea to test that math works is human beings and computers donít conceptualize math the same way and the line between known solid ground and buggy assumptions can be wide.

    Meaning: Math != what your code is doing. There is an example of anti-intuitive testing and why a simplistic test that passes 99.9% of the time can lead to an exercise in hair pulling; Re: why Test::More?

    And with regards to the original thesis: 20 extra seconds, nay, minutes!, of a test run is a *gift* if it prevents a single shipped bug. I have never once spent less than that, probably not less than an hour, diagnosing and fixing a bug in someone elseís distribution. Final note: adding tests itself is a form of thinking about the code concretely and not as a conception. That alone is frequently extremely helpful and extra tests can always be removed or factored into bigger tests as subtests.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2021-08-05 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (44 votes). Check out past polls.

    Notices?