Testing

  • 864 views
Uploaded on

Talk for undergraduates on why they should embrace testing

Talk for undergraduates on why they should embrace testing

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
864
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
27
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Testing Steve Loughran HP Laboratories June 9th, 2008
  • 2. About me
    • I break things for a living
    • this is because I am clumsy
    • breaking other people’s code is fun
    • sometimes it is really hard
  • 3. Ant in Action
    • the problems of complex builds in big teams
    • not for this course
    • stay in the IDE
    • testing is key to getting big projects out the door
    • automation comes next
  • 4. your code doesn't work
  • 5. I know this because...
  • 6. my code doesn't work
  • 7. it's OK to write code that doesn’t work
  • 8. but not to ship it
  • 9. especially when it matters
  • 10. how do you get from "broken" to "shipping"?
  • 11. Device Drivers ship and see test it! Test-Driven  x:  y : f ( y , x) > 0 Formal Methods prove it works
  • 12. proofs of correctness
    • shows an algorithm really works
    • good for concurrency
    • and other things you can’t test
    • makes assumptions about system
    • needs lots of maths/CS skills (Pi-Calculus, The HOL System)
    • how do you do regression proofs?
  • 13. Testing: code that breaks
    • unit test: test classes, libraries
    • functional test: test the application
    • system test: test a deployed system
    • performance test: simulate load.
    • acceptance tests: is it ready for use?
    • a good test breaks the build!
  • 14. Test Driven Development any feature without a test doesn’t exist
  • 15. Lots of unit test frameworks
    • Java: JUnit, TestNG
    • Python: PyUnit
    • Ruby: Test:: Unit
    • .NET: NUnit
    • PHP: PHPUnit
    • C++ (CppUnit)
  • 16. JUnit
    • main unit test framework in Java (see also TestNG)
    • simple to learn
    • good tool support
    • somewhat low-level
    • extensions for system testing
  • 17.  
  • 18. public class LessSimpleTest extends TestCase { public LessSimpleTest (String s) { super(s); } public void testAssignment() { final Date date = new Date(); Event event = new Event(UUID.randomUUID(), date, "now", "Text"); assertEquals("self equality failed", event, event); assertEquals(date, event.getDate()); assertNotNull(date.getID()); } }
  • 19. swing GUI TestRunner
  • 20. Ant-generated report scales better; reports published
  • 21. Continuous Integration see: CruiseControl, Hudson, LuntBuild
  • 22. ==> blame assignment whose change broke the build?
  • 23. System Testing
    • deploy, then: HtmlUnit, XmlUnit, Cactus, Selenium
    • needs automated deployment, database setup, teardown
    • performance testing by comparing timings w.r.t. old runs
    • simulate entire behaviour of the client user/application
  • 24. Distributed Systems
    • testing is still a research topic
    • set up complex configurations
    • run tests on remote machines
    • collect results and log data
    • post-mortem analysis
    • virtualization can help
    • see http://tinyurl.com/y99tez
  • 25. limitations of testing
    • good tests are hard to write
    • distributed tests very hard
    • different system configurations are still a problem
    • status of "tester" below "coder"
    • A good test breaks the application
  • 26. politics: resistance to change
  • 27. developers: ignorance, fear
    • E.E.E. Educate, Evangelise, Encourage
    • gently show benefits
    • use testing to track down a bug
    • retain test for regression testing
    • add tests for new code and old problems, not existing codebase
    • adopt cruise control, reporting
  • 28. management: ignorance
    • "too much time spent on testing"
    • out of date with modern processes
    • belief that testing slows the schedule (it does on the ship-and-see process)
    • E.E.E., then D.D.D: Distract, Dissemble, Defeat
  • 29. call to action
    • write tests
    • use a CI tool: Hudson, Luntbuild, Cruise Control