Test Continuous

3,429 views
3,314 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,429
On SlideShare
0
From Embeds
0
Number of Embeds
48
Actions
Shares
0
Downloads
44
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Test Continuous

  1. 1. Test Continuous Kang-min Liu <gugod@gugod.org>
  2. 2. Continuous Testing http://groups.csail.mit.edu/pag/continuoustesting/
  3. 3. Eclipse Plugin For Java
  4. 4. JUnit
  5. 5. Foo.java FooTest.java
  6. 6. Changed Foo.java FooTest.java
  7. 7. Changed Foo.java FooTest.java auto run
  8. 8. HEY
  9. 9. We Perl
  10. 10. Test::Continuous http://search.cpan.org/dist/Test-Continuous
  11. 11. DEMO
  12. 12. perl -MTest::Continuous -e runtests' murmur: There should be a better way...
  13. 13. --------------------------------------------- /Users/gugod/dev/Acme-Greeting/t/01.english.t (Wstat: 65280 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 255 Parse errors: Bad plan. You planned 4 tests but ran 5. Files=1, Tests=5, 0 wallclock secs ( 0.00 usr 0.01 sys + 0.05 cusr 0.01 csys = 0.07 CPU) Result: FAIL [MSG]: /Users/gugod/Acme-Greeting/t/01.english.t was changed. /Users/gugod/dev/Acme-Greeting/t/01.english......ok --------------------------------------------- Result: PASS [MSG]: /Users/gugod/dev/Acme-Greeting/t/01.english.t was changed. /Users/gugod/dev/Acme-Greeting/t/01.english......ok ---------------------------------------------
  14. 14. What It Does... 1. Scan modified files 2. Find all tests requiring a re-run. 3. Run those tests 4. Report PASS / FAIL 5. GOTO 1
  15. 15. How it’s done 1. Scan modified files. File::Modified 2. Find all tests requiring a re-run. Module::ExtractUse 3. Run those tests. App::Prove 4. Report PASS / FAIL. Log::Dispatch 5. GOTO 1. while(1)
  16. 16. CPANFTW CPAN For The Win
  17. 17. Good For...
  18. 18. Test Driven Development
  19. 19. Test Driven Refactoring
  20. 20. <CODE>
  21. 21. What It Does (1st day) 1. Wait until any file is modified 2. Run all tests 3. Report PASS / FAIL 4. GOTO 1
  22. 22. Run ALL tests
  23. 23. Wasting Time
  24. 24. Write less test
  25. 25. bad software
  26. 26. hate software
  27. 27. Run as few tests as possible Module::ExtractUse
  28. 28. Only run .t if that’s modified
  29. 29. dependency of .t
  30. 30. Moose.pm moose.t Cow.pm cow.t OX.pm fight.t
  31. 31. Moose.pm moose.t Cow.pm cow.t OX.pm fight.t
  32. 32. Moose.pm moose.t Cow.pm cow.t OX.pm fight.t
  33. 33. Moose.pm moose.t Cow.pm cow.t OX.pm fight.t
  34. 34. Moose.pm moose.t Cow.pm cow.t OX.pm fight.t
  35. 35. Log::Dispatch based notification Should be easy extend
  36. 36. Log::Dispatch::Screen
  37. 37. --------------------------------------------- /Users/gugod/dev/Acme-Greeting/t/01.english.t (Wstat: 65280 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 255 Parse errors: Bad plan. You planned 4 tests but ran 5. Files=1, Tests=5, 0 wallclock secs ( 0.00 usr 0.01 sys + 0.05 cusr 0.01 csys = 0.07 CPU) Result: FAIL [MSG]: /Users/gugod/Acme-Greeting/t/01.english.t was changed. /Users/gugod/dev/Acme-Greeting/t/01.english......ok --------------------------------------------- Result: PASS [MSG]: /Users/gugod/dev/Acme-Greeting/t/01.english.t was changed. /Users/gugod/dev/Acme-Greeting/t/01.english......ok ---------------------------------------------
  38. 38. /me Mac
  39. 39. Good developing platform and macbook air is so shiny
  40. 40. Growl Universal Reminder http://growl.info
  41. 41. Growl Universal Reminder http://growl.info
  42. 42. Log::Disptach::MacGrowl auto-used if installed
  43. 43. Log::Disptach::MacGrowl auto-used if installed
  44. 44. Not good enough...
  45. 45. Only check .pm dependency .pm → .t .c → .t .conf → .t .yaml → .t
  46. 46. Shallow Dependency
  47. 47. Animal.pm Moose.pm Cow.pm cow.t moose.t
  48. 48. isa Animal.pm Moose.pm Cow.pm cow.t moose.t
  49. 49. isa Animal.pm Moose.pm isa Cow.pm cow.t moose.t
  50. 50. isa Animal.pm Moose.pm isa tested by Cow.pm cow.t moose.t
  51. 51. isa Animal.pm Moose.pm isa tested by tested by Cow.pm cow.t moose.t
  52. 52. isa Animal.pm Moose.pm isa tested by tested by Cow.pm cow.t moose.t
  53. 53. isa Animal.pm Moose.pm tested by isa tested by animal.t tested by Cow.pm cow.t moose.t
  54. 54. Should clearly notified what’s failed
  55. 55. No High-Def cute looking icon ICON DESIGNER WANTED
  56. 56. Future • Better Dependency Detection • Convention based (For Catalyst / Jifty / Others) • Configuration based • Support other Universal Reminder on other platform. (Twitter!)
  57. 57. END
  58. 58. Happy Testing

×