Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Context Driven Automation Gtac 2008


Published on

Slides from my presentation at the Google Test Automation Conference 2008

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Context Driven Automation Gtac 2008

  1. 1. Context-Driven Test Automation How to Build the System you Really Need Pete Schneider [email_address] F5 Networks
  2. 2. License <ul><li>The content of these slides is made available under the Create Commons Attribution Share-Alike 3.0 United States license. </li></ul>
  3. 3. Where this talk came from… <ul><li>F5 Networks has lots of product teams who have their own automation tools. </li></ul><ul><li>We were taking inventory of the tools and trying to see where we could share and eliminate duplication. </li></ul><ul><li>We looked at 11 different test automation tools. </li></ul>
  4. 4. We saw 6 common tasks… <ul><li>All the tools had ways of addressing common tasks: </li></ul><ul><ul><li>Test distribution and run control </li></ul></ul><ul><ul><li>Test case set up </li></ul></ul><ul><ul><li>Test case execution </li></ul></ul><ul><ul><li>Test case evaluation </li></ul></ul><ul><ul><li>Test case tear down </li></ul></ul><ul><ul><li>Results reporting </li></ul></ul>
  5. 5. We discussed the tasks… <ul><li>Test distribution and run-time control </li></ul><ul><ul><li>Some tools had sophisticated controls, some were rudimentary. </li></ul></ul><ul><ul><li>Some were automatic, some required manual effort. </li></ul></ul><ul><li>Set up / tear down </li></ul><ul><ul><li>Some tools took care of a lot of the work in setting up and tearing down a test, others left it all to the test case. </li></ul></ul><ul><li>Test execution and verification </li></ul><ul><ul><li>Except for data-driven tests, all tools left this entirely to the test case. </li></ul></ul><ul><ul><li>We saw huge variations in complexity of verification. </li></ul></ul><ul><li>Reporting </li></ul><ul><ul><li>All tools sent results via email. </li></ul></ul><ul><ul><li>Some had web GUIs, some didn’t. </li></ul></ul>
  6. 6. We argued… <ul><li>Everyone agreed that the six tasks existed and were important. </li></ul><ul><li>We did not agree on the relative importance of each task. </li></ul><ul><li>We did not agree on what was needed to meet requirements for each task. </li></ul>
  7. 7. The light bulb came on… <ul><li>We realized that we were approaching test automation from different directions, with different intentions. </li></ul><ul><li>In short, we had different contexts. </li></ul>
  8. 8. We looked at the tools again… <ul><li>We tried to figure out how to group the tools </li></ul><ul><li>The context of the tool was the key </li></ul><ul><li>Who writes the tests? </li></ul><ul><li>Who looks at the results? </li></ul><ul><li>What decisions do the results influence? </li></ul>
  9. 9. We came up with 4 contexts in our setting… Context Tests written by Results looked at by Decisions influenced by Individual Developer Developers Developers Code check-in Development Team Developers and/or testers Testers, developers, PM’s Branch merges, releases Project Testers Testers, PM’s Project milestones, releases Product Line Testers Testers, PM’s, senior management Updates and maintenance releases
  10. 10. Will the refactoring I just finished break anything?
  11. 11. Individual Developer context… <ul><li>A common example is Unit Tests. </li></ul><ul><li>These tests need to be very quick, duration measured in seconds. </li></ul><ul><li>They test very small pieces of functionality—e.g. a single procedure in an API. </li></ul><ul><li>Writing them requires deep knowledge of product code. </li></ul><ul><li>They should be considered part of the product code deliverable, i.e. the code isn’t finished if there are no unit tests </li></ul><ul><li>See xUnit Test Patterns, by Gerard Meszaro </li></ul>
  12. 12. If we merge our feature branch to main, will we break anything?
  13. 13. Development Team context… <ul><li>These tests focus on a specific area of functionality or a subsystem of the product. </li></ul><ul><li>They still need to be fast, but speed is not as critical. </li></ul><ul><li>The tests may use an interface that is not directly available to product users. </li></ul><ul><li>Writing these kinds of tests requires significant expertise in the specific protocol/feature. </li></ul><ul><li>Once fully implemented, the tests can be migrated to project/product-line testing. </li></ul>
  14. 14. Are the builds becoming more stable or less stable?
  15. 15. Project context… <ul><li>Focus on user functionality of the system </li></ul><ul><li>Speed is desirable, but not essential </li></ul><ul><li>Requires a more complex infrastructure </li></ul><ul><ul><li>Hardware dependencies </li></ul></ul><ul><ul><li>Variations in expected results from release to release </li></ul></ul><ul><ul><li>Other external dependencies </li></ul></ul><ul><li>Reporting is critical </li></ul><ul><li>Can be migrated to Product Line easily </li></ul>
  16. 16. Will this patch work for customers running Basic, Pro, and Premiere editions with Service Packs 1, 2 or 3?
  17. 17. Product Line context… <ul><li>This automation is intended to run on releases that are out in the field. </li></ul><ul><li>The automation may take a very long time to run. </li></ul><ul><li>Goals: </li></ul><ul><ul><li>Ensure that patches fix the problem they claim to fix. </li></ul></ul><ul><ul><li>Ensure that they don’t break something else. </li></ul></ul><ul><li>Reliability is critical. </li></ul><ul><li>These tests are challenging to maintain. </li></ul><ul><li>Run-time control is a big deal. </li></ul>
  18. 18. Case Study: ITE … <ul><li>Summary: </li></ul><ul><ul><li>The ITE is STAF/STAX based. </li></ul></ul><ul><ul><li>It was developed by testers for use by other testers, with developers as a secondary target. </li></ul></ul><ul><li>ITE Design Criteria: </li></ul><ul><ul><li>Allow hands-off execution of tests. </li></ul></ul><ul><ul><li>Allow the test harness to automatically determine which tests to run. </li></ul></ul><ul><ul><li>Reduce the set up/tear down burden on test writers. </li></ul></ul>
  19. 19. ITE … <ul><li>Distribution / Runtime control </li></ul><ul><ul><li>Tests and framework are distributed as a linux chroot that includes all dependencies. </li></ul></ul><ul><ul><li>Both tests and framework stored in source control. </li></ul></ul><ul><ul><li>Tests tagged with meta-data used to control runs. </li></ul></ul><ul><li>Test Setup </li></ul><ul><ul><li>The ITE offers services to configure DUT and various test services. </li></ul></ul><ul><li>Execution </li></ul><ul><ul><li>This is largely left to test writer. The ITE is beginning to support data-driven tests. </li></ul></ul>
  20. 20. ITE … <ul><li>Verification </li></ul><ul><ul><li>This is largely left to the test writer. </li></ul></ul><ul><ul><li>The ITE performs “health checks” on DUT. </li></ul></ul><ul><li>Teardown </li></ul><ul><ul><li>It performs more extensive cleanup after “subjobs” complete. </li></ul></ul><ul><li>Results Reporting </li></ul><ul><ul><li>The ITE sends email after completion of runs, it also stores results in database. </li></ul></ul><ul><ul><li>Web pages are available for viewing results. </li></ul></ul>
  21. 21. Case Study: xBVT … <ul><li>Summary: </li></ul><ul><ul><li>The xBVT is a Perl based system. </li></ul></ul><ul><ul><li>It was developed by a developer for use by other developers, with testers as secondary target. </li></ul></ul><ul><li>xBVT Design Criteria: </li></ul><ul><ul><li>Tests should be able to run inside or outside the tool. </li></ul></ul><ul><ul><li>Impose little/no overhead on test writers and runners. </li></ul></ul>
  22. 22. xBVT … <ul><li>Distribution / Runtime control </li></ul><ul><ul><li>Tests and framework are stored in source control. </li></ul></ul><ul><ul><li>Tests are stored with the product code </li></ul></ul><ul><ul><li>Runtime execution is determined by “test manifests.” Manifests can be nested to arbitrary depths. </li></ul></ul><ul><li>Setup </li></ul><ul><ul><li>The xBVT provides the test with login credentials and ip address. Test is responsible for configuring system. </li></ul></ul><ul><li>Test execution </li></ul><ul><ul><li>Execution is left to test writer. </li></ul></ul>
  23. 23. xBVT … <ul><li>Results verification </li></ul><ul><ul><li>Verification is left to test writer. </li></ul></ul><ul><li>Teardown </li></ul><ul><ul><li>Teardown is left to test writer. The expectation is that each test will clean up completely, leaving system as it was prior to test. </li></ul></ul><ul><li>Reporting </li></ul><ul><ul><li>A text file is generated containing pass/fail results for each test. </li></ul></ul><ul><ul><li>The text files are emailed out when run is completed. They are also stored on a web page. </li></ul></ul>
  24. 24. What I Learned … <ul><li>If you have trouble agreeing, take a step back. </li></ul><ul><li>There are many different approaches that will work, the one that will work best for you depends on your test writers, framework writers, and automation customers. </li></ul><ul><li>Rather than build “one framework to test them all”, consider building sharable components. </li></ul>
  25. 25. How you can use this … <ul><li>Ask yourself: </li></ul><ul><ul><li>Who is going to write and maintain the framework? </li></ul></ul><ul><ul><li>Who will build and maintain the tests? </li></ul></ul><ul><ul><li>How are the tests going to be used? </li></ul></ul><ul><ul><li>How long will the tests live? </li></ul></ul>
  26. 26. In conclusion… <ul><li>Define your context: </li></ul><ul><ul><li>Who is going to write the tests? </li></ul></ul><ul><ul><li>Who is going to look at the results? </li></ul></ul><ul><ul><li>What decisions will the test results influence? </li></ul></ul><ul><li>Determine how your automation will implement the 6 actions: </li></ul><ul><ul><li>Test distribution and run control </li></ul></ul><ul><ul><li>Test set up / tear down </li></ul></ul><ul><ul><li>Test execution / Results evaluation </li></ul></ul><ul><ul><li>Reporting </li></ul></ul>
  27. 27. Acknowledgements … <ul><li>Thanks to the members of F5’s cross-functional tools team </li></ul><ul><ul><ul><li>Brian Sullivan, Chris Rouillard, Ephraim Dan, Patrick Walters, Sebastian Kamyshenko, Bob Conard, Terry Swartz </li></ul></ul></ul><ul><li>Thanks to the members of F5’s automated test team </li></ul><ul><ul><ul><li>Henry Su, Rex Stith, Randy Holte, Richard Jones, James Saryerwinnie </li></ul></ul></ul><ul><li>Special Thanks to </li></ul><ul><ul><ul><li>John Hall, Brian DeGeeter, Ryan Allen, and Brian Branagan </li></ul></ul></ul>