Semantic Test Objects  in  Ruby  and  Watir Human Readable Machine Executable Test Case Design  for Web Applications
How Does Traditional Testing Work? Let’s make some assertions =>
Traditional Test Cases Written in Language processed and executed by Human Beings who require specialized knowledge.
Traditional Test Case Notation Documents as Pages of Text bound to specialized Formatting. Presentation and data glued tog...
Costly to Write. Slow to Execute Requires Live Performance of a Skilled Tester. Each Replay is Another Live Performance! L...
TADA! Just Automate! Record and Play it Back It seems so easy, right? (maintenance nightmare)
The Silver Bullet What do you get when you automate Manual, Natural Language Step By Step Procedural Tests that only a mac...
Yes, Let’s Automate.  With Human Readable  and Machine Executable Notation Semantic Functional Test Object Model
TestObject.message(subject) Semantic Test Objects Notation Human Readable Machine Executable
Unnecessary Text Out <ul><li>“ By relieving the brain of all unnecessary work, a good notation sets it free to concentrate...
OO dot Notation <ul><li>Human Readable </li></ul><ul><ul><li>Billy.clean(your_room)  said Mom to her Child </li></ul></ul>...
Request, Response <ul><li>Object Oriented Notation captures the Interaction between Objects. </li></ul><ul><ul><li>Every r...
Understanding TestObject <ul><li>All ‘things’ in a TestCase are TestObjects. </li></ul><ul><li>All ‘steps’ in a TestCase a...
Separate Design from Implementation <ul><li>You’ve heard this before, right? </li></ul><ul><ul><li>TestCases talk to TestO...
TestCase Definition <ul><li>TestCase is an inventory of  tests </li></ul><ul><li>Executed in  context  (TestScope) </li></...
Ruby High Productivity. Object Oriented. No compile. Interpreted. Dynamically Typed. Widely used
Watir WebAppTestingInRuby Pronounced [water] Ruby Library. Talks to IE DOM at runtime. Browser Automation Interface.
Document Object Model Tests talk to DOM in memory. HTML + CSS + JavaScript + Ajax + UserInteraction + ??? Tests speak sema...
App Test Model Interface Construct new TestObject from API or build new ones Abstract Business Domain Model
Tests > API > Browser Semantic separation.   Tests talk to API Test Objects which are wired to speak to the DOM
‘ manual’ vs ‘model’ <ul><li>Process Based Testing </li></ul><ul><li>Linear step by step snapshot based testing </li></ul>...
Thank You Questions?
Upcoming SlideShare
Loading in...5
×

Semantic Test Object in Ruby and Watir

1,889

Published on

constructing oo test cases for web applications

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

  • Be the first to like this

No Downloads
Views
Total Views
1,889
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
56
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Semantic Test Object in Ruby and Watir"

  1. 1. Semantic Test Objects in Ruby and Watir Human Readable Machine Executable Test Case Design for Web Applications
  2. 2. How Does Traditional Testing Work? Let’s make some assertions =>
  3. 3. Traditional Test Cases Written in Language processed and executed by Human Beings who require specialized knowledge.
  4. 4. Traditional Test Case Notation Documents as Pages of Text bound to specialized Formatting. Presentation and data glued together.
  5. 5. Costly to Write. Slow to Execute Requires Live Performance of a Skilled Tester. Each Replay is Another Live Performance! Long Cycle Time$
  6. 6. TADA! Just Automate! Record and Play it Back It seems so easy, right? (maintenance nightmare)
  7. 7. The Silver Bullet What do you get when you automate Manual, Natural Language Step By Step Procedural Tests that only a machine can read?
  8. 8. Yes, Let’s Automate. With Human Readable and Machine Executable Notation Semantic Functional Test Object Model
  9. 9. TestObject.message(subject) Semantic Test Objects Notation Human Readable Machine Executable
  10. 10. Unnecessary Text Out <ul><li>“ By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems” – Alfred North Whitehead </li></ul><ul><li>“ While what is being discussed here is software development not notation sets, the same principle is operative if one thinks of a notation set as the ability to represent a problem to one's self .” – Dr. Pam Lawhead </li></ul><ul><li>http://john.cs.olemiss.edu/~lawhead/summary.html </li></ul>
  11. 11. OO dot Notation <ul><li>Human Readable </li></ul><ul><ul><li>Billy.clean(your_room) said Mom to her Child </li></ul></ul><ul><ul><li>Room.clean_up() said Billy to his Room </li></ul></ul><ul><ul><li>Object.message(subject) said Object to Another </li></ul></ul><ul><li>Machine Executable </li></ul><ul><ul><li>Can be written in any OO Language. </li></ul></ul>
  12. 12. Request, Response <ul><li>Object Oriented Notation captures the Interaction between Objects. </li></ul><ul><ul><li>Every request gets a reponse </li></ul></ul><ul><li>When Mom sends a message to Billy does she get an answer? </li></ul><ul><ul><li>Yes – but not what does the call to Billy return? </li></ul></ul><ul><li>Tests as Concrete Examples rather than Abstract Description </li></ul>
  13. 13. Understanding TestObject <ul><li>All ‘things’ in a TestCase are TestObjects. </li></ul><ul><li>All ‘steps’ in a TestCase are about sending messages to TestObjects </li></ul><ul><li>All ‘things’ are derived from Domain Model, UseCase Model, User Inteface Model </li></ul><ul><li>All ‘things’ live in Application Test Map, a kind of Semantic Test Objects API for testing. </li></ul>
  14. 14. Separate Design from Implementation <ul><li>You’ve heard this before, right? </li></ul><ul><ul><li>TestCases talk to TestObjects </li></ul></ul><ul><ul><li>TestObjects talk to the Browser </li></ul></ul><ul><ul><li>Abstraction Layer built from Business Domain Model </li></ul></ul><ul><li>Decouple and Glue instead </li></ul><ul><li>TestCases speak the language of the Test Domain. </li></ul><ul><li>TestObjects speak the language of the browser, IE, FireFox, Safari, Mobile, whichever…. </li></ul>
  15. 15. TestCase Definition <ul><li>TestCase is an inventory of tests </li></ul><ul><li>Executed in context (TestScope) </li></ul><ul><li>Validating expected existence and expected behavior of the System </li></ul><ul><li>Agreed by Customer </li></ul><ul><li>Resulting in pass or failure </li></ul>
  16. 16. Ruby High Productivity. Object Oriented. No compile. Interpreted. Dynamically Typed. Widely used
  17. 17. Watir WebAppTestingInRuby Pronounced [water] Ruby Library. Talks to IE DOM at runtime. Browser Automation Interface.
  18. 18. Document Object Model Tests talk to DOM in memory. HTML + CSS + JavaScript + Ajax + UserInteraction + ??? Tests speak semantic structural DOM
  19. 19. App Test Model Interface Construct new TestObject from API or build new ones Abstract Business Domain Model
  20. 20. Tests > API > Browser Semantic separation. Tests talk to API Test Objects which are wired to speak to the DOM
  21. 21. ‘ manual’ vs ‘model’ <ul><li>Process Based Testing </li></ul><ul><li>Linear step by step snapshot based testing </li></ul><ul><li>Dependent on previous run and individual implicit knowledge of the tester. </li></ul><ul><li>Many lines of text written in author’s style. </li></ul><ul><li>Deciphering meaning. </li></ul><ul><li>Abstract Description </li></ul><ul><li>Object Based Testing </li></ul><ul><li>Non linear behavior and state based. </li></ul><ul><li>Holographic view of system. Context and Perspective </li></ul><ul><li>Shared vocabulary. Standard Notation. </li></ul><ul><li>Explicit expectations </li></ul><ul><li>Concrete Examples </li></ul>
  22. 22. Thank You Questions?
  1. A particular slide catching your eye?

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

×