Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

xsawyerx (8978)

xsawyerx
  (email not shown publicly)

Journal of xsawyerx (8978)

Wednesday April 29, 2009
06:00 PM

In Defense of Simple Stuff

[ #38893 ]

I've just released Test::Ping version 0.09 which has a fully ported version of the Net::Ping testing suite. Basically I took all the tests from it, rewrote them to use Test::More and Test::More's functions (SKIP, TODO, etc.) and Test::Ping instead of Net::Ping. I thought it might be a time to write some of the things I have on my mind right about now.

I started Test::Ping on Apr 22nd, exactly one week ago, and I think I've already reached the high point in the functionality of it, or at least what I imagine(d) it would be. I don't anticipate many (if at all) changes to Test::Ping at this point, since most changes to Net::Ping will continue to be transparently supported in Test::Ping.

The current most interesting discussion (to me) on the Perl front right now is specific Role usage situations. Ovid, Steven Little, Chris Prather, Shawn Moore and a lot of other prolific CPAN/Perl authors I admire quietly are openly discussing it and provide a lot of interesting insight into smart programming paradigms... and I'm sitting and writing a testing module that does pings that probably won't be used by many.

Here are a few reasons why I don't think this module was completely pointless:

  • It's easier to have functional programming for testing than object oriented, as long as it's not too complex. Andy Lester's Test::WWW::Mechanize is a prime example of when object oriented testing is preferred.
  • It's easier to write ping_ok( '127.0.0.1', 'testing localhost' ); than my $p = Net::Ping->new(); my $alive = $p->ping('127.0.0.1'); ok( $alive, 'testing localhost' ); $p->close;
  • It has a clean and updated version of the entire Net::Ping testing suite.
  • It provides another standardized test module using Test::Builder to Perl's repertoire.
  • Gave me my first taste of GitHub. I love it.
  • Gave me my first taste of Test::Builder. It's pretty cool.
  • It's well written, well tested and well documented. If anything, it might help even out the amount of bad code that exists on CPAN.

At least I didn't spend too much time over it.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Don't forget that you've wrapped up useful behavior in a package that's easy to understand and easier to use! That's good for everyone.

  • Right tool for the job

    Sometimes procedural is the way to go, there's nothing wrong with that

    my $p = Net::Ping->new(); my $alive = $p->ping('127.0.0.1'); ok( $alive, 'testing localhost' ); $p->close;

    ... screams Java to me... scary

  • The thing I liked that you mentioned is the way it's possible to learn about a bunch of stuff through actually tackling a relatively simple and small task. Here, you learned about Test::Builder, GitHub, and more.

    I'm doing the same at the moment. I have a large, popular piece of software to rewrite in Moose. First, I'll rewrite one of my small systems that no-one uses in Moose - I'm picking up lots on structuring Roles, etc, and what feels right. It's a great way to learn with relatively low risk.