SlideShare a Scribd company logo
Testing the User InterfaceCoded UI Tests with Visual Studio 2010Eric D. Boyd
IntroductionEric D. Boyd15 years in technology
I’m From Here
I Moved Here
I Work Herewww.centare.com
I Work On
I Blog Herewww.ericdboyd.com
I Tweet Herewww.twitter.com/EricDBoyd
Getting to Know YouPhoto by www.rebeccasandulak.com/
AgendaThe State of Software TestingManual TestingCoded UI TestsCoded UI Best PracticesWhat’s New Since RTM?Q&A
Northeast Blackout of 200310 million people in Ontario and 45 million people in eight US states were without powerRace condition in GE Energy’s Unix-based XA/21 energy management systemStalled FirstEnergy’s control room alarm system for over an hourHid audio and visual alerts of system state changes, unprocessed events queued, and the primary server failed within 30 minutesToronto on the evening of August 14http://en.wikipedia.org/wiki/Northeast_Blackout_of_2003
Therac-25Patients were given massive overdoses of radiation, 100 times the intended dose3 patients died from radiation poisoningRace conditions occurred when the operator changed the setup quicklyArithmetic overflow caused the software to bypass safety checkshttp://en.wikipedia.org/wiki/Therac-25
Ariane 5, Maiden VoyageJune 4, 1996, rocket explodes 39 seconds after take-offDecade of development and $7 billion dollars investedDestroyed rocket and cargo valued at $500 million64-bit float converted to 16-bit signed integer, larger than 32,767, failedhttp://en.wikipedia.org/wiki/Ariane_5_Flight_501
Software Quality Troubles“my testers are spending too long testing the same thing”“tooling is expensive (time, licenses, people)”“when is my software ready to ship?”“developers and testers work in silos and don’t communicate/speak the same language”“it will take weeks for regression testing”
What the Industry Sayssoftware bugs cost the US economy an estimated $59.5 billion every yearlast year, canceled projects cost firms $67 billion; overruns on the other projects racked up another $21billionon average professional coders make 100 to 150 errors in every 1000 lines of code they write
What If You Could…easily manage test plans and test casesenable developers to easily automate functional UI testsIntegrate functional UI testing into build automationparameterize playback of recorded testsfast forward through manual testing
Areas of the Project Lifecycle
Story Time – Testing Failures
Testing Cycle
Tester Life70% of testing happens hereMajority of test tools target hereBlack Box TestingWhite Box TestingAPI Testing
Visual Studio 2010GeneralistSpecialistCoded UI TestUnit TestingWeb TestTest RunnerLoad TestFF Manual TestTest Case ManagementVirtual Lab ManagementData Collectors (Intellitrace, System Info.) Team Foundation Server with Reporting
Challenges of UI Testing
What are Coded UI Tests?
Anatomy of Coded UI Tests
Demo – Create Coded UI Tests
Demo – Manual Testing
Demo – Automating the Manual Tests
Demo – Editing Existing Coded UI Test
Demo – Customizing Tests
Demo – Data-Driven Coded UI Tests
Coded UI Best PracticesUse the Coded UI Test BuilderDO NOT EVER edit the UIMap.designer.cs fileUse meaningful namesUse meaningful AssertionsLimit the number of actionsRe-record when the UI changesCreate separate UIMap files for each moduleAPI CodingUse the generated classes as much as possibleCreate a method for each custom assertion in UIMap.cs
Feature Pack 2
Demo – Feature Pack 2
Automation Platform Support
Demo – Build Automation
UITestArchitectureWrite a client that does something else!My UICoded UI TestTest RunnerInterpreterCode GenerationAction InvokerCustom properties & codeCustomize recordingAdd/Modify APIPlaybackRecorderFilter/ Aggregation RulesAPIProperty ProviderBrowser ServiceAdd another browserTechnology Abstraction LayerWrite technology adaptersWeb Plug-ins(MSHTML/DOM)Rich Client Plug-ins(UIA/MSAA)3rd Party Plug-ins
Coded UI is Only One of the ToolsTest Case Management1000 vUsersWeb TestLoad TestManual TestingFast Fwd for Manual TestingRich Actionable BugsVirtual Env. Setup/Tear DownEnvironment from TemplateCheckpoint EnvironmentTeam ExplorerAgents*Requires Visual Studio Test Professional 2010 for virtual lab management & configuration.
Improving Quality with VS 2010Better Tools for Manual TestingUI Test AutomationTester-Developer CollaborationBuild Integration
How to Get StartedVisual Studio 2010 Premium or UltimateTest Professional (optional)Team Foundation Server (optional)Play for FREE with VS 2010 and TFS 2010 VHDWindows Virtual PC (Windows 7)Microsoft Virtual PC 2007 SP 1Windows Server 2008 Hyper-V
Useful ResourcesVS 2010 Testinghttp://msdn.microsoft.com/en-us/library/ms182409.aspxVS 2010 Coded UIhttp://msdn.microsoft.com/en-us/library/dd286726.aspxVS 2010 Main Resource Pagehttp://msdn.microsoft.com/en-us/library/dd831853.aspxLocal Technology Eventshttp://twitter.com/MWD_DevEvents
Q&A
Thank You!

More Related Content

Testing the User Interface - Coded UI Tests with Visual Studio 2010

  • 1. Testing the User InterfaceCoded UI Tests with Visual Studio 2010Eric D. Boyd
  • 2. IntroductionEric D. Boyd15 years in technology
  • 9. Getting to Know YouPhoto by www.rebeccasandulak.com/
  • 10. AgendaThe State of Software TestingManual TestingCoded UI TestsCoded UI Best PracticesWhat’s New Since RTM?Q&A
  • 11. Northeast Blackout of 200310 million people in Ontario and 45 million people in eight US states were without powerRace condition in GE Energy’s Unix-based XA/21 energy management systemStalled FirstEnergy’s control room alarm system for over an hourHid audio and visual alerts of system state changes, unprocessed events queued, and the primary server failed within 30 minutesToronto on the evening of August 14http://en.wikipedia.org/wiki/Northeast_Blackout_of_2003
  • 12. Therac-25Patients were given massive overdoses of radiation, 100 times the intended dose3 patients died from radiation poisoningRace conditions occurred when the operator changed the setup quicklyArithmetic overflow caused the software to bypass safety checkshttp://en.wikipedia.org/wiki/Therac-25
  • 13. Ariane 5, Maiden VoyageJune 4, 1996, rocket explodes 39 seconds after take-offDecade of development and $7 billion dollars investedDestroyed rocket and cargo valued at $500 million64-bit float converted to 16-bit signed integer, larger than 32,767, failedhttp://en.wikipedia.org/wiki/Ariane_5_Flight_501
  • 14. Software Quality Troubles“my testers are spending too long testing the same thing”“tooling is expensive (time, licenses, people)”“when is my software ready to ship?”“developers and testers work in silos and don’t communicate/speak the same language”“it will take weeks for regression testing”
  • 15. What the Industry Sayssoftware bugs cost the US economy an estimated $59.5 billion every yearlast year, canceled projects cost firms $67 billion; overruns on the other projects racked up another $21billionon average professional coders make 100 to 150 errors in every 1000 lines of code they write
  • 16. What If You Could…easily manage test plans and test casesenable developers to easily automate functional UI testsIntegrate functional UI testing into build automationparameterize playback of recorded testsfast forward through manual testing
  • 17. Areas of the Project Lifecycle
  • 18. Story Time – Testing Failures
  • 20. Tester Life70% of testing happens hereMajority of test tools target hereBlack Box TestingWhite Box TestingAPI Testing
  • 21. Visual Studio 2010GeneralistSpecialistCoded UI TestUnit TestingWeb TestTest RunnerLoad TestFF Manual TestTest Case ManagementVirtual Lab ManagementData Collectors (Intellitrace, System Info.) Team Foundation Server with Reporting
  • 23. What are Coded UI Tests?
  • 24. Anatomy of Coded UI Tests
  • 25. Demo – Create Coded UI Tests
  • 26. Demo – Manual Testing
  • 27. Demo – Automating the Manual Tests
  • 28. Demo – Editing Existing Coded UI Test
  • 30. Demo – Data-Driven Coded UI Tests
  • 31. Coded UI Best PracticesUse the Coded UI Test BuilderDO NOT EVER edit the UIMap.designer.cs fileUse meaningful namesUse meaningful AssertionsLimit the number of actionsRe-record when the UI changesCreate separate UIMap files for each moduleAPI CodingUse the generated classes as much as possibleCreate a method for each custom assertion in UIMap.cs
  • 35. Demo – Build Automation
  • 36. UITestArchitectureWrite a client that does something else!My UICoded UI TestTest RunnerInterpreterCode GenerationAction InvokerCustom properties & codeCustomize recordingAdd/Modify APIPlaybackRecorderFilter/ Aggregation RulesAPIProperty ProviderBrowser ServiceAdd another browserTechnology Abstraction LayerWrite technology adaptersWeb Plug-ins(MSHTML/DOM)Rich Client Plug-ins(UIA/MSAA)3rd Party Plug-ins
  • 37. Coded UI is Only One of the ToolsTest Case Management1000 vUsersWeb TestLoad TestManual TestingFast Fwd for Manual TestingRich Actionable BugsVirtual Env. Setup/Tear DownEnvironment from TemplateCheckpoint EnvironmentTeam ExplorerAgents*Requires Visual Studio Test Professional 2010 for virtual lab management & configuration.
  • 38. Improving Quality with VS 2010Better Tools for Manual TestingUI Test AutomationTester-Developer CollaborationBuild Integration
  • 39. How to Get StartedVisual Studio 2010 Premium or UltimateTest Professional (optional)Team Foundation Server (optional)Play for FREE with VS 2010 and TFS 2010 VHDWindows Virtual PC (Windows 7)Microsoft Virtual PC 2007 SP 1Windows Server 2008 Hyper-V
  • 40. Useful ResourcesVS 2010 Testinghttp://msdn.microsoft.com/en-us/library/ms182409.aspxVS 2010 Coded UIhttp://msdn.microsoft.com/en-us/library/dd286726.aspxVS 2010 Main Resource Pagehttp://msdn.microsoft.com/en-us/library/dd831853.aspxLocal Technology Eventshttp://twitter.com/MWD_DevEvents
  • 41. Q&A