Javascript testing IAD2010

1,295 views

Published on

Italian Agile Day 2010 Presentation about Javascript testing

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

No Downloads
Views
Total views
1,295
On SlideShare
0
From Embeds
0
Number of Embeds
53
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Javascript testing IAD2010

  1. 1. The secret art of Agile Javascripting Luca Grulla Italian Agile Day, Genova, 19/11/10
  2. 2. Our background Large public facing websites Significant javascript codebase with complex DOM interaction Heavy use of Ajax Large amount of business logic Long life expectancy
  3. 3. Disclaimer This presentation is technology agnostic Each tool used is replaceable It is not about how to use jQuery
  4. 4. Technology Stack • JQuery • JSTestDriver • Ewloe • JavascriptLint
  5. 5. It used to be so simple…
  6. 6. Rich clients
  7. 7. We want unit tests
  8. 8. Scenario Login form Need to validate user credentials Need to execute a server call via ajax POST Based on the result we need to show a welcome or an error message
  9. 9. So what is wrong with this code ?
  10. 10. We want to test it!
  11. 11. Domain abstraction
  12. 12. Abstraction around integration points
  13. 13. HTTP DOM Presentation Logic Business Logic
  14. 14. Our approach Javascript is a first class language create abstractions: business logic presentation logic integrations …but not limited to a specific pattern !! Keep your presentation logic class as skinny as possible in order to express intents Favour interaction tests over integration tests
  15. 15. Tools Considerations ….whatever you like but has to be pluggable in your Continuous Integration !!
  16. 16. Questions ?
  17. 17. Thank You ! Luca Grulla luca.grulla@thoughtworks.com http://www.lucagrulla.it/blog http://www.github.com/lucagrulla
  18. 18. References Ewloe http://github.com/gurrie/ewloe

×