Testing Insights from B::DeparseTree
rockyb’s recent post about B::DeparseTree contained several insights on testability and writing good tests. Here are my takeaways.
rockyb’s recent post about B::DeparseTree contained several insights on testability and writing good tests. Here are my takeaways.
Its back to the API day here in the Moose-pen
As my practical tests against a real DB are humming along I noticed that I was missing some-thing quick basic on my API namely retrieving more that just a array-ref of data from the DB. Reading some of my earlier posts I did leave this part to latter so I better do it now before I get too close to my first release.
Now in the present Data::Accessor that Database::Accessor is based off of I noticed that I could pass in an optional $container on the 'retrieve' method and depending on the nature or the 'container' it would handle the results in different ways.
If it was not present that it just did as I do now return and array-ref of results. If a hash-ref was passed in then the the underlying DB would try to do a fetch for each key on the hash and the return an array-ref of hash-refs of the matched keys.
After TPC join me for The Hitch-Hiker's Guide to Perl 6 at The Little America in Salt Lake City.
Today is GDPR Day, and to celebrate that, the PAUSE admins have added a Privacy Policy to PAUSE. This tells you:
The policy is linked off the sidebar in PAUSE, and the source is a markdown document in PAUSE's github repo.
It still expand Test day here in the Moose-Pen.
Carrying on with my extended 'xt' tests or as I like to call them practical test. I wanted to make sure that I can change the conditions on my Database::Accessor and and check that all the DB is correct in the 'person' table.
To accomplish this I added in the following;
$test_data = $user_db->people_data;
$da->reset_conditions();
$da->add_sort({name=>'id'});
$da->retrieve($dbh);
cmp_deeply( $da->result()->set, $test_data,
"All Persons result correct");
Test::Class
is particularly good at testing object-oriented code, or so it is said. You can create a hierarchy of test classes that mirrors the hierarchy of classes under test. But this pattern, common in Perl projects, is conspicuously missing from the rest of the xUnit world, and with good reason.
Quite some time back I was anxious to find a Perl module or two to work on and gain some experience in the process of releasing modules to the CPAN. Like I'm sure many of you do, I looked through the ADOPTME list to see what looked simple and or fun to work on.
WWW::Shorten and friends came on my radar and I started there. I reached out to the authors of many modules in the WWW::Shorten to see if they wouldn't mind joining me in the effort to bring them all to a similar point. I seem to recall everyone being happy and eager to work together, so this part went well. We created a GitHub organization to house the various modules.
Inevitably, though, I began working on other things and unfortunately have let WWW::Shorten and friends languish. This, however, opens the opportunity for you to take on the task of maintaining a family of modules and bring their test coverage up to date and add in modules for the new shortening services that are available now.
Please let me know if you're interested and I'll happily pass off some commit and PAUSE permissions!
David Precious has just released a new trial version of Dancer. There are some rather significant changes under the hood, and community testing and feedback is welcomed and encouraged.
Please find us here, Github, Twitter, or on irc.perl.org#dancer with any questions, problems, or feedback.
Thanks! Keep dancing!
Its Just a quick post-ette day here in the Moose-Pen
When we last met our hero she had gotten though most of the perils of the ever-changing API and the ever-increasing code base but found one other problem when working on the test in test case '10_crud_basic.t'
$da = $person->da();
$da->add_condition({
left => {
name => 'user_id',
},
right => { value => $new_person->{user_id }},
operator => '=',
});
$da->retrieve($dbh);
Simple desktop applications are generally not what one considers a Perl specialization. Its expertise lies in generating processing and transforming textual data, hence its use in the web, and in tools like GUIDeFATE. This 'duct tape' manages to parse text, extracting relevant data, and absorbing information and producing a meaningful output efficiently. Displaying this output in a desktop application shouldn't be too difficult.
Luckily for us the JavaScript language is constantly evolving towards being a better Perl 6 target (this is a general case of the world in general evolving in this direction).
The next Chrome release will support bigints natively in a matter of days.
Node.js is expected to upgrade the V8 soon too.
The major browsers are expected to follow suite.
Rakudo.js is already ready to use that new functionality.
As part of working on making Rakudo.js run in the browser I'm replacing all the node.js dependent stuff.
For some bignum operations we use a node.js binding to OpenSSL, after the pure js alternatives proved incomplete and/or buggy I have decided that it's not worth to spend the effort towards supporting stuff that will be obsolete soon and use the new features.
My current philosophy towards running on legacy JavaScripts is that with the velocity of the JS ecosystem by the time Rakudo.js is production ready the current once will be widespread.
Obviously if someone needs legacy support he is welcome to work on that (and I'll try my best to help him).
For me, at least, a sad moment. But you can read the details at log.perl.org and make up your own mind.
Get back on track day here in the Moose-Pen
Well after mulling things over last night I think I will just have to make a note in my API that the 'view' fix will only work for the first layer of 'Link' and I will give a few examples of bets to use this feature and how to avoid problems.
Today I started on practical testing again with the plan being add in a new person/address record and then see if I get the correct values out.
Now to start I created two new Xtest::DA classes 'Address' and 'PeopleAddress' to work with and I instantiate all of these classes using the first record from some tests data I have in utils class;This document is the May, 2018 progress report for The Perl Foundation's Perl 6 Constant and Rationals Grant.
This month I was working in docs and roast repos, in separate
car-grant-midrat
branches. So far, they contain 29 documentation commits and 11 spec commits adding about 5,824 words of documentation and 152 tests.
The tests specced the MidRat
type. The documentation, along with
documenting MidRat
/MidRatStr
types, centered largely around new
Language/Numerics
page that describes all of the available Perl 6 numeric types—including native
and atomic numerics—their purpose, properties, and hierarchy. This guide was
not on the list of deliverables of the Grant and has been produced as a bonus
item.
I started the grant by working on adding the proposed MidRat
/MidRatStr
type
pair. This was the most contentious part of the Rationals Work Proposal that before the grant underwent three revisions,
settling on solving the problem by adding the MidRat
type.
We are very happy to announce Curtis "Ovid" Poe as Keynote Speaker for the Swiss Perl Workshop this September in Bern. Join us and learn from his experience as a developer, and maybe also on his journey as a space traveler; take off to Tau Station with Perl!
We encourage you to submit talks and we welcome a broad range of subjects, your talk does not have to be specifically Perl related. Share your experience with others, be it your daily messing around with bugs or rocket science!
We look forward to seeing you in Bern this September.
Great thanks go to our sponsors, who have already commited to the event:
I have posted a new entry on the Ocean of Awareness blog: "Parsers and useful power". I look at what parser users want and what makes a parser successful, in light of the 1960s contest between the Irons parser, the first ever published, and recursive descent. One of those is very much with us today, and one survives only in the literature.
For more about Marpa, my own parsing project, there is the semi-official web site, maintained by Ron Savage. The official, but more limited, Marpa website is my personal one. Comments on this post can be made in Marpa's Google group, or on our IRC channel: #marpa at freenode.net.
Back to the API day again here in the Moose-pen
To be extra diligent I decided to play about with some of the tests in '40_joins.t' to see if my API was working as I expected. Namly I took this link;I made a lot of progress on CPAN Testers at this year's Perl Toolchain Summit (PTS). The PTS is an annual event devoted to maintaining and improving the Perl toolchain. The Perl toolchain includes things like:
This release contains a lot of little bug fixes, so I thought I'd blog about it. I hope I didn't break anything but you should be aware that chances are a bit higher than usual. Please test!
At the Perl Toolchain Summit I decided to work on trailing comments for YAML.pm, and then I felt like digging a bit deeper into other bugs.
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.