Menu Home

Perl CPAN month.

So this month I was allocated Test::Simple as part of the CPAN pull request challenge.

As the sneaky devil I am; I thought I’d pull a fast one on the development team I work in and suggested we have a evening event to learn about the CPAN Pull Request Challenge (and do my pull request in the process).

The evening was a success, we all enjoyed some Pizza and I went through the background of the challenge and the steps involved in participating. Including showing people the relationship between MetaCpan and Cpan. Also MetaCpan <-> Pause and of course GitHub and how pull request work.

We have a team of mixed experience, so it was good to show some of them just how easy it is to solve your own bug in a module if you find one. The evening resulted in several pull requests I am pleased to say!

Unfortunately not on Test::Simple.

This month my excuse is that I started “Scientist” a Perl5 module that is a Perl implementation of the ideas in the Scientist Ruby code GitHub released.

Scientist, is a case of things coming together in just the wrong order. 😉
I have recently been in the situation in my $DayJob where I had to refactor some older code as part of a process of adding more to the feature. To give some sense of security I wanted to test the old code against the new; but there was no tool to do it. So I actually started by using is_deeply from Test::More in a copy of the original code. Which worked in terms of giving me faith in the code at least.

I have since written the Scientist module which uses Test::Deep::NoTest’s  eq_deeply() command to do the same trick. Better yet it has the timing of both code paths.

Further I have written our DayJob::Scientist module; this has our specific publish() method and uses the Scientist code to push to out private monitoring servers. So now all our experiments results are automatically pushed to monitoring servers. On our dev machines we also warn to the app server logs some statistics.

This is the first “real” module I have done on Cpan and the experience is a good one. I have been a good lad and written the module in a TDD methodology (fairly) strictly. Being that I wrote tests that failed; then wrote the code that made them pass; then refactored. I started with stubbed methods that made the test go form red to green. Then wrote the real code. I used my regular nerd tool of watch prove -lv t/* to have the tests running over and over as I went.

Since publishing Scientist, I have updated it several times and even accepted a pull request.

This week, I went one step sillier and started writing a Perl6 implementation as I want to learn Perl6 and I am all very excited about the Scientist ideas. This has been interesting as I have not written any real Perl6. It has been challenging as you’d expect; I was close to releasing a alpha version to modules.perl6.org untill I spotted Test-Lab which is already up online. I don’t think I will continue with my Perl6 implementation; but we shall see.

So all in all, I have been busy and got lots of Perl written. But still not got that darn pull request done.

Categories: Uncategorized

Lance