Date post: | 10-May-2015 |
Category: |
Technology |
Upload: | unmesh-ballal |
View: | 239 times |
Download: | 1 times |
ADVANCED TEST AUTOMATIONBy Unmesh Ballal
AGENDA
• Introduction to Test Automation
• When to Automate
• White – Box Testing
• Benefits of Test Automation
• Tools Used in Test Automation
• Automation Test Case Specifications
• Test Automation Process
• Conclusion
INTRODUCTION TO TEST AUTOMATION
• Criteria for Test automation• Functional testing is completed• Unit testing is not enough for automation
• Scenario to be automated
• Need To reduce integration to external applications
• Maintain base compatibility and extend application with new versions and complex functionality
• Automate smaller code changes
• Identifying and finding defects in scenarios
WHEN TO AUTOMATE
• Build needs to be stable
• No New functionality is added
• No defects since the test execution and build validated
WHITE – BOX TESTING – THINGS TO CODE
• Control flow testing
• Data flow testing
• Branch testing
• Path testing
• Statement coverage
• Decision coverage
BENEFITS OF TEST AUTOMATION
• Save time in executing tests
• Repeatability
• Automated maintenance
• Coverage of testing
• Quality assurance
• Cost reduction for regression testing
• Reduce Testing cycles
• Manual testing Human error is eliminated
• More opportunity to improve productivity
• Software can be enhanced without interference of modules that are integrated
• The testing can be executed using configurable data.
TOOLS USED IN TEST AUTOMATION
• Visual Studio 2008 C#
• Microsoft Test
• NUnit
AUTOMATION TEST CASE SPECIFICATIONS
• Pre-condition is scenario – will be required to pre create data before calling the method.
• All returned data is used in test assertions
• Certain steps can be verified after method call returns to ensure that code is executed.
• All data referred in the function is created by helper methods before calling the methods so there is consistency in execution
• Post conditions are scenario level validations that will be required as an additional code.
TEST AUTOMATION STRATEGY
• Write test case for each flow considering if-else flows
• Automate some methods automatically by automating top – level classes
• Identify number of methods for each class to be automated
• Use Code coverage tool and identify gaps and improve coverage
• Start Automating!
TEST AUTOMATION PROCESS – CREATE TEST PROJECT
• Create a New Visual Studio solution sub-project – Test Project template
CREATE NEW TEST PROJECT
ADD TESTS TO TEST PROJECT
TEST CASE DEVELOPMENT
NEXT STEPS
• Add Helper Methods for building data
• Accessors to test private methods
• Execute the Tests
• Use a Code Coverage tool for analysis
• Identify missing coverage
• Automate process on command line for continuous integration
e.g.
mstest /testcontainer:TestProject1.dll
CONCLUSION
• Re-run test cases if Code Changed
• Validate integrity continuously by validating results
• Update code if test case failed and not a defect
• Done!