Debugging and Testing
    the Web Tier
      Muness Alrubaie
     muness@gmail.com
     muness.blogspot.com

        Thoug...
?
Ask!
What are we going to
   talk about?
C:Program FilesMozillafirefox.exe -profilemanager

/Applications/Firefox.app/Contents/MacOS/firefox -profilemanager

/usr/...
What you want in a test
    environment

• Isolated
• Customized
• Manageable
• Shared
Debugging is twice as hard as
writing the code in the first place.

Therefore, if you write the code as
cleverly as possibl...
Web Developer Toolbar

• CSS
• Browser features
• Outline elements
• Manage cookies
• Validate
Don’t Panic
Firebug



• Debugger
• Profiler
alert('width: ' + width + ' height: ' + height);



console.log('width: %d height: %d', width, height);
console.debug('I am debug');
  console.info('I am info');
console.warn('I am a warning');
console.error('I am an error');
Inline Debugging

• debugger keyword
• All the usual capabilities
  • Step Over
  • Step Into
  • Step Out
What else?
What about
Internet Explorer?
We know about as much about
software quality problems as they
knew about the Black Plague in the
1600s.
We've seen the vic...
JsUnit



• Unit testing
• xUnit for Javascript
Concepts

• Test Functions
• Test Page
• include jsUnitCore.js
• setUp and tearDown
• Test Suite
• testRunner.html
Tracing


• A way to view output
• There are 3 trace levels
• Configurable per test run
Automate your tests

• net.jsunit.StandaloneTest
• Browsers
• Test Pages
• JsUnitServer
• net.jsunit.DistributedTest
One test is worth
  a thousand
   opinions.
Crosscheck


• Unit testing
• Simulator
• Fast!
What does it provide?


• global variables
• functions
• document
Optimism is an
occupational hazard
of programming:

       feedback is the
           treatment.


          Kent Beck
Selenium


• Acceptance testing
• Standard browser technology
• Simulates the user
• Java, Ruby, Perl, Python, .Net, Oh my!
?
                  session
                evaluations

              Muness Alrubaie
             muness@gmail.com
     ...
Os Alrubaie
Upcoming SlideShare
Loading in...5
×

Os Alrubaie

837

Published on

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

No Downloads
Views
Total Views
837
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Os Alrubaie"

  1. 1. Debugging and Testing the Web Tier Muness Alrubaie muness@gmail.com muness.blogspot.com ThoughtWorks www.thoughtworks.com
  2. 2. ? Ask!
  3. 3. What are we going to talk about?
  4. 4. C:Program FilesMozillafirefox.exe -profilemanager /Applications/Firefox.app/Contents/MacOS/firefox -profilemanager /usr/local/mozilla/bin/firefox -profilemanager .../firefox -P <profile>
  5. 5. What you want in a test environment • Isolated • Customized • Manageable • Shared
  6. 6. Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. Brian Kernighan
  7. 7. Web Developer Toolbar • CSS • Browser features • Outline elements • Manage cookies • Validate
  8. 8. Don’t Panic
  9. 9. Firebug • Debugger • Profiler
  10. 10. alert('width: ' + width + ' height: ' + height); console.log('width: %d height: %d', width, height);
  11. 11. console.debug('I am debug'); console.info('I am info'); console.warn('I am a warning'); console.error('I am an error');
  12. 12. Inline Debugging • debugger keyword • All the usual capabilities • Step Over • Step Into • Step Out
  13. 13. What else?
  14. 14. What about Internet Explorer?
  15. 15. We know about as much about software quality problems as they knew about the Black Plague in the 1600s. We've seen the victims' agonies and helped burn the corpses. We don't know what causes it; we don't really know if there is only one disease. We just suffer -- and keep pouring our sewage into our water supply. Tom Van Vleck
  16. 16. JsUnit • Unit testing • xUnit for Javascript
  17. 17. Concepts • Test Functions • Test Page • include jsUnitCore.js • setUp and tearDown • Test Suite • testRunner.html
  18. 18. Tracing • A way to view output • There are 3 trace levels • Configurable per test run
  19. 19. Automate your tests • net.jsunit.StandaloneTest • Browsers • Test Pages • JsUnitServer • net.jsunit.DistributedTest
  20. 20. One test is worth a thousand opinions.
  21. 21. Crosscheck • Unit testing • Simulator • Fast!
  22. 22. What does it provide? • global variables • functions • document
  23. 23. Optimism is an occupational hazard of programming: feedback is the treatment. Kent Beck
  24. 24. Selenium • Acceptance testing • Standard browser technology • Simulates the user • Java, Ruby, Perl, Python, .Net, Oh my!
  25. 25. ? session evaluations Muness Alrubaie muness@gmail.com muness.blogspot.com This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 License. http://creativecommons.org/licenses/by-nc-sa/2.5/

×