Your SlideShare is downloading. ×
0
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Arquillian: Effective tests from the client to the server

1,738

Published on

Tools like Selenium, an outstanding tool for UI test automation, and Arquillian, an award-winning integration testing framework, offer a base for high-quality tests which are crucial for a web app …

Tools like Selenium, an outstanding tool for UI test automation, and Arquillian, an award-winning integration testing framework, offer a base for high-quality tests which are crucial for a web app development. However writing UI tests and covering server-side logic leaves many questions open:

* Does Selenium cover everything? Page transitions, simple JavaScript interaction and a portion of DOM. Is it really enough?
* Mocking requests for testing server-side code is pain. Is it necessary?
* Are you able to detect that your component’s visual representation changes?
* Does investigating these changes involve a disproportionate amount of effort?
* Isn’t manual test development too expensive?

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

No Downloads
Views
Total Views
1,738
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
30
Comments
0
Likes
2
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. Arquillian: Effective TestsFROM THE CLIENT TO THE SERVER Lukas Fryc
  • 2. Testing Testing Testing Testing #Agile Testing Testing#TDD Testing Testing Testing Testing “You can hear about testing Testing from everywhere!”
  • 3. “But image testing oflarge enterpriseapplication.” Enterprise Java Web Application
  • 4. “In such case, its noteasy to define how thetests should look like.” Testing...
  • 5. “How would you completeequation?What word do youimagine when someonesays testing?” Testing = ?
  • 6. “My favorite is...” Testing = Pain
  • 7. “Its even possible tochange equation andmake the testingenjoyable?” Testing = Enjoyable!
  • 8. No one saves the World?
  • 9. “There is one: he is braveand comes from far deepspace...”
  • 10. “And brings heavy gearfor fighting with alienbugs...”
  • 11. “...and he is proud toshare his powerful gearwith us!”
  • 12. “At first, he comes with Ability to split one big deployment into manysmall, testing as little ascomponents as possible in separation.”
  • 13. “And he makes surethese deployments work on various of earth application servers.”
  • 14. “...and once he deploys the deployment into container, he makes sureyou have all the goodness from inside available using dependency injection.”
  • 15. “...and thats all backedwith strong development tools.”
  • 16. “That all, and you can run it just from your IDE, re- using what you already now.”JUnit TestNG
  • 17. Testing Revolution
  • 18. Ike brings tests to the Server
  • 19. But what about the Client?
  • 20. The little bit of Theory...
  • 21. “Lets have ideal testingpyramid in mind,otherwise...”
  • 22. Enough Theory!
  • 23. Lets bring tests to the Client
  • 24. “But it isnt as simple asin Java - many differentenvironments.”
  • 25. “Fortunately there is toolwhich allows you to writetests in unified API for allthose browsers.”
  • 26. “And the even supportsmocked browsers withsame API.”
  • 27. Oh, such a great tool!
  • 28. Lets invade client!
  • 29. “Ouch, we need some abstraction!”
  • 30. “Even if we use favoriteprogrammatic approach,we can end up with manytests which takes days topass and quickly turnsout into maintananceburden!” Java C# Python Ruby PHP Perl
  • 31. At least, the app is covered...
  • 32. “But this is what actuallySelenium see.”
  • 33. Black Box
  • 34. “Selenium is able to testtransitions betweenpages.” Page Transitions
  • 35. “...and a portion of all thepage source code –JavaScript handlers,selected CSS and DOMchanges as reaction touser interaction.” A little bit of... DOM / JavaScript / CSS
  • 36. Lets change the game...
  • 37. Right tool for the Job
  • 38. “Lets take the anoutstanding UIautomation tool...”
  • 39. “And add your favoritelanguage.”
  • 40. “And little bit of Alientechnology.”
  • 41. “His name is Drone andhe is proud member ofArquillian crew!” Arquillian Drone
  • 42. “He is basically ...” Hard-Worker
  • 43. “Drone comes to bringthe browser to your test.”
  • 44. Let Ike invade the Client
  • 45. “But something else isneeded to make yourtests green.”
  • 46. “Something enoughstrong to handle all theinconsistencies.”
  • 47. “Lets deploy that to thebrowser page and seewhat happens!”
  • 48. Strong type-safe API
  • 49. Proven to handle AJAX
  • 50. Invades the Client
  • 51. Cross-Cutting Concerns
  • 52. Arquillian Graphene
  • 53. “We are still writing low-level interactioncommands, right?” Isnt that too low-level?
  • 54. “Lets look for somethingon higher level.” Reusable Abstractions
  • 55. “Introducing well-knownSelenium pattern:” Page Objects
  • 56. “Lets imagine youhave page with all theelements and youexpress them asfields in the class.”
  • 57. “You can even usefluent API for pagetransitions, sinceeach method canreturn next page asthe result.”
  • 58. “But for modern AJAX-based application, itssimply not enough.”
  • 59. “Lets think a littleabout that:In enterpriseapplications, yourather reuse UIcomponents.”
  • 60. “What about creatingthe model of thesecomponents fromtheir users point ofview?”
  • 61. Component Objects
  • 62. Arquillian Graphene Component Objects
  • 63. Review what we have
  • 64. “Now, we can simplywrite tests on properlevel of abstractionwith minimumefforts.”
  • 65. 3 Missing Pieces
  • 66. “What is missing here?” JUnitTestNG
  • 67. How to avoid manual...?
  • 68. “We can automatically snap screen-shots of the whole pages and compare them with historical data – its proven that rendering on one particular browser and platform, images will be binary same.”Screen-shot Comparison
  • 69. Automated Visual Verification
  • 70. The Music of the Future?
  • 71. “It is music of thefuture, but there isproject which alreadyfocuses efforts there.” Arquillian RushEye
  • 72. “2 parts are missing now: server is already covered with unit and integration tests, but what about the same tests for client?” JUnitTestNG
  • 73. “Unit testing of clientis even moreimportant than unittesting of server,since it suffers fromenvironmentdiversity.” Unit Testing Client
  • 74. “But once those unittests are written, howto automate them?Without automation,they are not tests.” Yet another tool to configure?
  • 75. “Lets use theconfiguration what wehave for Drone – lethim instantiate abrowser, which willrun the unit tests.” Reuse the Automation Setup
  • 76. “For writing actualtests, you can useyour favorite JS clienttesting tool.We are actuallyworking onintegration withQUnit.” QUnit
  • 77. “And once the client is covered too, only integration tests for client are missing.” JUnitTestNG
  • 78. “The integrationtesting of client isactually making sureit communicates withserver as expected.” Client / Server Round-Trip
  • 79. Take client on the Tour to Server!
  • 80. “We have browser and test on one side andserver on opposite side.”
  • 81. “With UI automation, weare sending request from client to the server.”
  • 82. “And server generates response.”
  • 83. Black Box!
  • 84. “On the other hand, when we are testing server from its JVM, we are mocking requests, which invokes verification code.”
  • 85. Dont mock me!
  • 86. “Lets make theconnection between client and server live.”
  • 87. “Once the requests goes to the server, the test code is serialized and sent as part of the request.”
  • 88. “Server de-serializes thetesting code from requestand uses it for verification of the server state inseveral lifecycle phases.”
  • 89. “And then is the testing object sent back to theclient, which can validate it.”
  • 90. “Client can verify the response and send another request.”
  • 91. Crazy idea?
  • 92. “But it already works!” JSFUnit
  • 93. “Now, we are covered!” JUnitTestNG
  • 94. Client Invasion
  • 95. Its all?
  • 96. It cant be without some buzz....
  • 97. Lets go Mobile!
  • 98. “Drone can actuallyreplace all the browsers.”
  • 99. “And use Android driverfor connecting to mobile device.”
  • 100. “Additionally, Androidextension can start theemulator or connect to real device, which is perfect addition for running in continuous integration systems.”
  • 101. Arquillian Android
  • 102. “Drone brings yourAndroid browser just into your test.”
  • 103. Arquillian
  • 104. Experience the future now
  • 105. But I must to know more...
  • 106. http://bit.ly/arq-preview
  • 107. http://bit.ly/arq-users
  • 108. Join us...
  • 109. http://github.com/arquillian
  • 110. http://bit.ly/arq-devs
  • 111. http://bit.ly/jboss-testing
  • 112. #jbosstesting @ irc.freenode.net
  • 113. #Arquillian
  • 114. Enjoy the Testing!
  • 115. @LFryc Lukas Frychttp://bit.ly/lfryc
  • 116. Photographs and pictures used in this presentation are authored by various authors and released under the Creative Commons licensehttp://www.flickr.com/photos/nickrussill/150410613/http://www.flickr.com/photos/audreyjm529/1240909256/http://www.flickr.com/photos/jo-h/6200225665/http://www.flickr.com/photos/stevendepolo/3796415185/http://www.flickr.com/photos/ucdaviscoe/6303100423/http://www.flickr.com/photos/sportbusiness/3542445412/http://watirmelon.com/2012/01/31/introducing-the-software-testing-ice-cream-cone/

×