Automated
       Testing
            John Paulett
             jhcore.com
4.17.2009
testing sucks
buggy code sucks more
being an example on
thedailywtf.com sucks the most
types of testing
types of testing


           unit
functional

        types of testing


                   unit
security
            usability
                                 scaling
                   load
                          ...
security
            usability
                                   scaling
                   load
                        ...
security
            usability
                                   scaling
                   load
                        ...
security
            usability
                                   scaling
                   load
                        ...
unit testing
smallest testable part

  method / function level
       assertions
junit test case
import junit.framework.TestCase;
public class TestMath extends TestCase
{
    public void testSquare() {
 ...
test drive development
public class Math {
    public static int square(int x) {
        return x;
    }
}
failure
fix the bug
public class Math {
    public static int square(int x) {
        return x * x;
    }
}
w00t!
forces better design
separate presentation from business logic
from data access!


“mock” out what your not testing
    fa...
every language has a unit
   testing framework

        even php
regression testing
know when things break
a test for every build
(and a build for every commit)
automate your build
hudson




hudson.dev.java.net
functional testing
selenium




seleniumhq.org
load testing
jmeter




jakarta.apache.org/jmeter/
requirements testing
fitnesse




fitnesse.org
test coverage
how much code is tested




       eclemma.org
wuss excuses
wuss: i'm the only one on the
      project
winner: i'll be ready for when
        more people join

winner: i want my code to work
wuss: just for my research, not
      production code
winner: i don't want to look like
        a fool publishing buggy
        results
wuss: i test it by using it
winner: i realize i never even
        get close to testing all
        of it after every change
wuss: it is already 1M LOC,
      with no tests, it's too late
winner: i'll add a couple tests
        when i fix a bug
key steps to start
1) unit test
      on all new code
  ●


      when you find a bug in existing code
  ●


      work to...
est finis

slides at jhcore.com


write at least 1 unit test next time you code


get your test on!
Upcoming SlideShare
Loading in...5
×

Automated Testing

4,180

Published on

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

No Downloads
Views
Total Views
4,180
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
169
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Automated Testing

  1. 1. Automated Testing John Paulett jhcore.com 4.17.2009
  2. 2. testing sucks
  3. 3. buggy code sucks more
  4. 4. being an example on thedailywtf.com sucks the most
  5. 5. types of testing
  6. 6. types of testing unit
  7. 7. functional types of testing unit
  8. 8. security usability scaling load regression functional types of testing smoke accessibility requirement unit acceptance touch recovery
  9. 9. security usability scaling load regression functional types of testing smoke and more ... accessibility requirement unit acceptance touch recovery
  10. 10. security usability scaling load regression functional types of testing smoke and more ... accessibility requirement unit acceptance touch recovery
  11. 11. security usability scaling load regression functional types of testing smoke and more ... accessibility requirement unit acceptance touch recovery
  12. 12. unit testing
  13. 13. smallest testable part method / function level assertions
  14. 14. junit test case import junit.framework.TestCase; public class TestMath extends TestCase { public void testSquare() { assertEquals(16, Math.square(4)); } }
  15. 15. test drive development public class Math { public static int square(int x) { return x; } }
  16. 16. failure
  17. 17. fix the bug public class Math { public static int square(int x) { return x * x; } }
  18. 18. w00t!
  19. 19. forces better design separate presentation from business logic from data access! “mock” out what your not testing fake data access class when testing business logic
  20. 20. every language has a unit testing framework even php
  21. 21. regression testing
  22. 22. know when things break
  23. 23. a test for every build (and a build for every commit)
  24. 24. automate your build
  25. 25. hudson hudson.dev.java.net
  26. 26. functional testing
  27. 27. selenium seleniumhq.org
  28. 28. load testing
  29. 29. jmeter jakarta.apache.org/jmeter/
  30. 30. requirements testing
  31. 31. fitnesse fitnesse.org
  32. 32. test coverage
  33. 33. how much code is tested eclemma.org
  34. 34. wuss excuses
  35. 35. wuss: i'm the only one on the project
  36. 36. winner: i'll be ready for when more people join winner: i want my code to work
  37. 37. wuss: just for my research, not production code
  38. 38. winner: i don't want to look like a fool publishing buggy results
  39. 39. wuss: i test it by using it
  40. 40. winner: i realize i never even get close to testing all of it after every change
  41. 41. wuss: it is already 1M LOC, with no tests, it's too late
  42. 42. winner: i'll add a couple tests when i fix a bug
  43. 43. key steps to start 1) unit test on all new code ● when you find a bug in existing code ● work towards 100% branch coverage ● 2) automate your build, test every commit
  44. 44. est finis slides at jhcore.com write at least 1 unit test next time you code get your test on!
  1. A particular slide catching your eye?

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

×