0
<ul>Automated testing in Python and beyond </ul><ul>Brenda Wallace <li>Production Engineer, Weta Digital </li></ul>
Unit Tests <ul><li>Unit Testing is testing of individual program &quot;units&quot; in relative isolation </li></ul>
Wah? <ul><li>What they are
Input -> expected output
That's a test </li></ul>
Glorified If/Else statements if (stuff happens as expected): OK! else: Fail.
Python unit  tests <ul><li>class testMyCode(unittest.TestCase): </li></ul>def test_Stuff(self): a = MyDataProcessingThing(...
Python <ul><li>Pass, fail, coverage </li></ul>
Super Powers <ul><li>Massive refactors, and know they worked </li></ul>
Wanna try something wickedly clever?  <ul><li>Do code change quickly
instantly see if it works for all 1,000 of your use cases </li></ul>
Confidence <ul><li>Debugging is fast
Find bugs elsewhere
Blame.
You look GOOD. </li></ul>
More Python <ul><li>Nose!
Logging capture
STDOUT capture
Running single tests </li></ul>
Disney <ul><li>pythoscope </li></ul>
Upcoming SlideShare
Loading in...5
×

Automated testing in Python and beyond

1,701

Published on

KiwiPyCon2011, Wellington, Sunday, Track 1, Automated testing in Python and beyond by Brenda Wallace, Open source hacker @ Weta Digital. Python libraries and extensions. A short intro to unitest and why they are so good for you.
Overview of python unittests and nose, and comparison to popular unittesting frame works in other languages, including perl, php, ruby, java, scala, erlang.

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
1,701
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Automated testing in Python and beyond"

  1. 1. <ul>Automated testing in Python and beyond </ul><ul>Brenda Wallace <li>Production Engineer, Weta Digital </li></ul>
  2. 2. Unit Tests <ul><li>Unit Testing is testing of individual program &quot;units&quot; in relative isolation </li></ul>
  3. 3. Wah? <ul><li>What they are
  4. 4. Input -> expected output
  5. 5. That's a test </li></ul>
  6. 6. Glorified If/Else statements if (stuff happens as expected): OK! else: Fail.
  7. 7. Python unit tests <ul><li>class testMyCode(unittest.TestCase): </li></ul>def test_Stuff(self): a = MyDataProcessingThing(5) self.assertEqual(a.blah, 9)
  8. 8. Python <ul><li>Pass, fail, coverage </li></ul>
  9. 9. Super Powers <ul><li>Massive refactors, and know they worked </li></ul>
  10. 10. Wanna try something wickedly clever? <ul><li>Do code change quickly
  11. 11. instantly see if it works for all 1,000 of your use cases </li></ul>
  12. 12. Confidence <ul><li>Debugging is fast
  13. 13. Find bugs elsewhere
  14. 14. Blame.
  15. 15. You look GOOD. </li></ul>
  16. 16. More Python <ul><li>Nose!
  17. 17. Logging capture
  18. 18. STDOUT capture
  19. 19. Running single tests </li></ul>
  20. 20. Disney <ul><li>pythoscope </li></ul>
  21. 21. Where ? <ul><li>Check them into a folder called tests
  22. 22. Keep in git/whatever </li></ul>
  23. 23. The Theme <ul><ul><li>There were shortcomings in the other frame work so instead of helping fixing those, we started a new one. </li></ul></ul>
  24. 24. Java <ul><li>JUnit </li><ul><li>What everyone uses </li></ul><li>JTiger </li><ul><li>There were shortcomings, so instead of fixing those, we started a new one. </li></ul><li>TestNG </li><ul><li>Our new one fixes different short comings </li></ul><li>Looks like python, but with less words
  25. 25. But life is too short </li></ul>
  26. 26. Perl <ul><li>Perl Unit
  27. 27. +60 more on cpan
  28. 28. Pod::Coverage </li></ul>
  29. 29. PHP <ul><li>PhpUnit
  30. 30. SimpleTest </li><ul><li>Web </li></ul></ul>
  31. 31. Erlang <ul><li>EUnit
  32. 32. Best intro to testing ever. </li></ul>
  33. 33. Write tests <ul><li>Write tests before you write code </li></ul>
  34. 34. Re-run <ul><li>Hudson/Jenkins
  35. 35. On cron e.g. every hour
  36. 36. On commit, poll git for changes
  37. 37. Email everyone when it breaks
  38. 38. Email only the person who broke it. </li></ul>
  39. 39. Thank You
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×