Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Test::Kantan - Perl and Testing

4,011 views

Published on

YAPC::Asia 2014 Slde.

Published in: Engineering
  • Be the first to comment

Test::Kantan - Perl and Testing

  1. 1. Perl and testing libraries…! tokuhirom YAPC::Asia 2014
  2. 2. Conclusion
  3. 3. You should try Test::Kantan
  4. 4. Self introduction
  5. 5. Server side Web engineer
  6. 6. Localizer Amon2 MadEye Archer Caroline Furl Difflet Docopt SQL::Maker HTTP::Session2 FormValidator::Lite mobirc
  7. 7. Test::SharedFork Test::Pretty Test::TCP
  8. 8. If you have any questions around the modules, you can ask me after this talk.
  9. 9. Do you like testing?
  10. 10. Do you like TDD?
  11. 11. Then…
  12. 12. History of Perl testing libraries…!
  13. 13. Test::More, Test::Class
  14. 14. Test::More use Test::More tests => 1; ok(“dan” eq “kogai”);
  15. 15. Test::Class
  16. 16. Architecture Test::Builder Test::More Test::Class Test::Excepti ons etc…
  17. 17. Test::Builder • Counts number of tests • Counts number of Failures • Counts number of Succeeded.
  18. 18. TAP!
  19. 19. Test Anything Protocol
  20. 20. Latest enhancements • subtest • done_testing
  21. 21. subtest 'feature2', sub { ok 1, 'it works'; ok 0, 'it looks great'; }; done_testing;
  22. 22. TAP with prove
  23. 23. prove eats TAP
  24. 24. Test::Builder is evolving…
  25. 25. Test::Builder2 • It may started at 2011. • With dreams…
  26. 26. TB2 • Custom output • Full rewrite • OO-ish APIs
  27. 27. But…
  28. 28. We need workaround for now…!
  29. 29. Test::Pretty 爆誕
  30. 30. Pretty output without code modifications!
  31. 31. めっちゃ見やすい!!
  32. 32. How it works?
  33. 33. Monkey patching…
  34. 34. But it works. Maybe.
  35. 35. It’s not a big problem. Because this is a workaround for now.
  36. 36. Test::Ika
  37. 37. RSpec like testing framework for Perl5
  38. 38. Ika?
  39. 39. Ika =
  40. 40. Please check it, if you love RSpec.
  41. 41. Test::More の停滞 Development has stagnated
  42. 42. Test::Builder2 • It may started at 2011. • With dreams… • It was gone. ← NEW!
  43. 43. Test::More x.xx was released.
  44. 44. Then…
  45. 45. I can’t wait evolution.
  46. 46. Test::Kantan 爆誕
  47. 47. Yet another testing framework
  48. 48. Test::Kantan is not based on Test::Builder
  49. 49. What’s new?
  50. 50. subtests with hooks
  51. 51. before_each after_each
  52. 52. IIRC jasmine inspired interfaces.
  53. 53. BDD Style
  54. 54. Given-When-Then
  55. 55. Plain old Test::More style
  56. 56. Assertions
  57. 57. ok { $foo->bar() eq ‘baz’ };
  58. 58. Power Assert hooks B optree.
  59. 59. ok { x(x($foo)->bar()) eq ‘baz’ };
  60. 60. expect($x)->to_be_true;
  61. 61. Shows testing details if it’s failed.
  62. 62. All or nothing. pass or die;
  63. 63. Conclusion
  64. 64. Conclusion • Test::SharedFork • Test::TCP • Test::Pretty • Test::Ika • Test::Kantan ← NEW!
  65. 65. Enjoy testing!
  66. 66. Thanks

×