Perl Testing Consideration (seen from other languages)
1. Perl Testing
Consideration
(seen from other languages)
Masaki Nakagawa
YAPC::Asia 2011 Tokyo (yapcasia.org/2011/talk/80)
2011 10 14
2. Profile
• Masaki Nakagawa
• @ikasam_a
• metacpan.org/author/MASAKI
• MC of Yokohama.pm (yokohama.pm.org)
• github.com/masaki
• socialbios.com/ikasam_a
• “Pushing the Team B”
2011 10 14
3. Thank you !
ameblo.jp/yuki-kashiwagi-we/image-11002817849-11452563522.html
2011 10 14
4. Works
• Embedded Development w/ C++
• WebApp. Development w/ Ruby
• Project Management (small)
• New Business Development
• www.ricoh.co.jp/ucs/
• www.ricoh.co.jp/ucs/P3000/
2011 10 14
5. Embedded Development
• “Hardware Driven”
• “The Waterfall”
• Development Process
• QA Process
• Systematic Testing
2011 10 14
18. TAP
• testanything.org
• “the Test Anything Protocol”
• “is a simple text-based interface”
1..4
ok 1 - Input file opened
not ok 2 - First line of the input valid
ok 3 - Read the rest of the file
not ok 4 - Summarized correctly # TODO Not written yet
testanything.org/wiki/index.php/Main_Page
2011 10 14
19. Perl <3 TAP
• From any test description
• e.g.) Test::Class, Test::Base, Test::Spec
• Convert results to non-TAP format
• e.g.) TAP::Formatter::JUnit
• Easy to write test helpers
• e.g.) Test::Exception, Test::Deep, ...
2011 10 14
29. Weakness
• Expectation and Verification
• vs. rr, rspec-mocks, mocha, ...
• Browser Integration API
• vs. Capybara, Webrat, ...
• Naming of Test Double modules
• Test::Mock::Guard is “Stub” module
2011 10 14
30. Comparision
• Pros
• TAP-based Test Description
• Many Helpful Modules
• Cons
• Non-Uniform Browser Integration
• Poor Expectation and Verification
2011 10 14
31. Conclusions
• About Testing
• 4 Classifications
• 3 Elements in Frameworks
• Perl and Ruby/Rails Testing Environments
• Perl has TAP and Many Great Modules
• Learn and Steal MORE from Ruby/Rails
• Write More Descriptively
2011 10 14