15
ADVANCED TEST AUTOMATION By Unmesh Ballal

Advanced Software Test Automation

Embed Size (px)

Citation preview

Page 1: Advanced Software Test Automation

ADVANCED TEST AUTOMATIONBy Unmesh Ballal

Page 2: Advanced Software Test Automation

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

Page 3: Advanced Software Test Automation

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

Page 4: Advanced Software Test Automation

WHEN TO AUTOMATE

• Build needs to be stable

• No New functionality is added

• No defects since the test execution and build validated

Page 5: Advanced Software Test Automation

WHITE – BOX TESTING – THINGS TO CODE

• Control flow testing

• Data flow testing

• Branch testing

• Path testing

• Statement coverage

• Decision coverage

Page 6: Advanced Software Test Automation

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.

Page 7: Advanced Software Test Automation

TOOLS USED IN TEST AUTOMATION

• Visual Studio 2008 C#

• Microsoft Test

• NUnit

Page 8: Advanced Software Test Automation

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.

Page 9: Advanced Software Test Automation

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!

Page 10: Advanced Software Test Automation

TEST AUTOMATION PROCESS – CREATE TEST PROJECT

• Create a New Visual Studio solution sub-project – Test Project template

Page 11: Advanced Software Test Automation

CREATE NEW TEST PROJECT

Page 12: Advanced Software Test Automation

ADD TESTS TO TEST PROJECT

Page 13: Advanced Software Test Automation

TEST CASE DEVELOPMENT

Page 14: Advanced Software Test Automation

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

Page 15: Advanced Software Test Automation

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!