Accelerated test case - Anish bhanu

28
Accelerated Test Case Automation Using Rational Functional Tester Anish Bhanu Manager, Software, Novellus Systems [email protected] Sriram Chakravarthi Sr. Engineer, Software, Novellus Systems

Transcript of Accelerated test case - Anish bhanu

Page 1: Accelerated test case - Anish bhanu

Accelerated Test Case Automation Using Rational Functional Tester

Anish BhanuManager, Software, Novellus Systems

[email protected] Chakravarthi

Sr. Engineer, Software, Novellus Systems

Page 2: Accelerated test case - Anish bhanu

Automation Challenges in today’s environment

Automation

Building Test

Framework

Test cases with Data Driven or Keyword Driven approach

RightResources

Programming knowledge vsSystem knowledge…

Test Case Maintenance

Re-usable Actions, Methods & Modules

ProperDocumentation

Coding Standards, Documentation of test cases and modules…

ApplicationAvailability

Automation lags development

FrameworkExtendibility

Framework running on multiple hardware, OS or platform

Modified Chinese saying, “May you automate in interesting times”

2

Page 3: Accelerated test case - Anish bhanu

System level diagram Data collection and analysis toolWindows 2003 server

JAVA GUI

Windows XP VC++

System ControllerQNX 4

CModule Controller

QNX 4C

Module ControllerQNX 4

C

MFCValve Robot Pump

EIOCQNX 6

C

EIOCQNX 6

C

EIOCQNX 6

C

EIOCQNX 6

C

Factory Automation ServerWindows 2003 server

VC++

Novellus

FA

Factory HostWindows 2000

VC++

3

Page 4: Accelerated test case - Anish bhanu

Challenges for testing semi-conductor tool software

• Around 40 releases a year supporting 14 products• Manual testing of each release takes about 1200 hours of testing for

each release• Software reliability is a key differentiator for tool software• System is graphic intensive, event driven and interacts with multiple

other systems• Every customer uses the tool in a unique way. Customer needs quick

turnaround on features and fixes

4

Page 5: Accelerated test case - Anish bhanu

Test Automation Approaches

Record and Playback

Standalone Record & Playback Scripts

Functional Test Decomposition

Modular test functions with data within test script

Data Driven

Test scripts with input & output data outside the test script

Keyword Driven

Test scripts with input & output data outside the test script along with re-usable keyword libraries

5

Page 6: Accelerated test case - Anish bhanu

Novellus Experience with Automation

• Started automation with Mercury WinRunner in 2003• Started with the Functional decomposition approach and later moved

to Data driven approach• Test case development took us 8 times the manual testing time • Maintaining the test cases for major releases took us 2 times the

manual testing time• By end of 2008, we had only 15% of test cases automated, which is

around 180 hours of manual testing time• Maintaining the script data for multiple releases and product was a

challenge• WinRunner was not able to recognize the controls and 25% of

Regression test cases could not be automated

6

Page 7: Accelerated test case - Anish bhanu

New Automation Approach using RFT• Simplify scripting

– Script should mimic what the user does on the screen.– Anyone could write the script

• Modular architecture– Common framework that supports multiple products– Provide reuse of code and test structure– Error recovery system for continuous run

• Parameterize test methods and modules– Provides mechanism to create new test cases easily and increase

coverage• Documentation

– Document generation of test methods and modules using JavaDoc• Use Proxies

– For custom controls not recognized by RFT • Rouge wave Stingray Controls

7

Page 8: Accelerated test case - Anish bhanu

Control metricsUI Controls Set Read Verify

Pushbutton NA NAEdit BoxStatic Text NACombo BoxRadio ButtonCheck ButtonMenu Item NA NAList BoxList TableWindow NATree List NA NAStingray GridTab NA NA NA: Not Applicable

• Basic operation for any UI control• Set, Read and Verify

• UI control class is derived from RationalTestScript Class and the basic operations are overridden in the derived class

8

Page 9: Accelerated test case - Anish bhanu

“4+1” view Architecture

Test Plans(Logical View)

End User Functionality

Test Modules(Development View)

Programmers Software Management

Data Tables(Process View)

Scalability

Test Methods(Physical View)

Topology

Use Test Cases(Scenarios)

Architectural Blueprints – The “4+1” View Model of Software Architecture by Philippe Kruchten

9

Page 10: Accelerated test case - Anish bhanu

Architecture

• Test Plan – Represents a collection of test cases that will be executed sequentially.– Output is a result sheet indicating whether the selected test cases passed or failed.

• Test cases– Consists of a collection of Test Modules and Test Methods which are organized in a

logical sequence.– Output is a result sheet indicating whether the individual Test Modules/Test Methods

passed or failed.• Test Modules

– Readily available entity that performs commonly used operation.– Consists of a collection of Test Methods which are organized in a logical sequence.– Reused across Test Cases.

• Test Methods– One class implemented corresponding to each UI control.– Operations that have been implemented in the UI control classes in Java.– Makes use of RFT APIs and Java libraries

10

Page 11: Accelerated test case - Anish bhanu

Test Framework Control flow

Page 12: Accelerated test case - Anish bhanu

Test case scriptModule/Method Argument1 Argument2 Argument3 Argument4

#Set-up

TestModule.LaunchProteusAndLogin c2 c2

TestModule.LaunchConfigurationEditor

TestModule.SetConfig argument3

TestModule.LaunchTelnetWindow

TestModule.Powercycle stop all;auto

TestModule.CloseTelnetWindow

#########Step1 Wafer run and nested error recovery ###########

TestModule.AssignWafers Port1 1 10 argument5

TestModule.StartWaferRun

TestModule.WaitForModuleToExecuteStep argument2 argument6

TestModule.InduceError argument2

TestModule.VerifyModuleInError argument2

TestModule.OpenErrorRecovery

TestModule.VerifyVCComboboxExists errorrecovery_IDC_ER_MODULES_COMBO Modules in Error CONTINUE

TestModule.SelectModuleForErrorRecovery argument1

TestModule.VerifyVCRadioButtonExists errorrecovery_IDC_DYNAMIC_RADIO1 Resume CONTINUE

TestModule.VerifyVCEditBoxExists errorrecovery_IDC_EDIT_DYNAMIC - CONTINUE

#########Step2 ###########

#Tear-down

TestModule.ReplaceAllCassettes hfkb

TestModule.DeleteRecipe argument5

TestModule.ExitProteus

Page 13: Accelerated test case - Anish bhanu

Error Recovery System• Cascading failures are avoided by using an error recovery that

brings the system to base state• Generic Teardown is executed if the test cases encounter

exceptions– Take the screenshot– Log the failure details– Close all windows– Restart the application

• Testcase dependent Setup & Teardown is implemented to make each test case independent

Page 14: Accelerated test case - Anish bhanu

Enhanced Logging• Logs are captured using excel sheet and text file.• Every level will have a log with results against each line in an excel sheet.

– Test Plan Result, TestCase Result & TestModule Result

• A detailed log also will be available in the form of a text file. • Log level is provided by the user at the test plan selection level.

Number of Test Plans Selected: 7PASS Variable.setLogLevel 3PASS Variable.setVariableValue IP_ADDRESS 192.168.1.10PASS Variable.setVariableValue PRODUCT_NAME INOVAxTPASS Variable.setVariableValue MACHINE_NAME swe011qnxPASS TestPlan.INOVAxT_TP_1508PASS TestPlan.INOVAxT_TP_INOVAxT_RTPPASS TestPlan.INOVAxT_TP_1833PASS TestPlan.INOVAxT_TP_2049FAIL TestPlan.Vector_TP_INOVAxT_RTPFAIL TestPlan.Vector_TP_2049FAIL TestPlan.Vector_TP_1508Number of Test Plans Executed: 7Number of Test Plans PASSED: 4Number of Test Plans FAILED: 3

Number of Test Cases Selected: 23PASS TestCase.INXT_P1508_TC1_01 InovaxTSamsungPASS TestCase.INXT_P1508_TC2_01 InovaxTSamsungPASS TestCase.INXT_P1508_TC2_06 InovaxTSamsungPASS TestCase.INXT_P1508_TC2_07 InovaxTSamsungPASS TestCase.INXT_P1508_TC2_08 InovaxTSamsungPASS TestCase.INXT_P1508_TC7_01 InovaxTSamsungPASS TestCase.INXT_P1508_TC8_02 InovaxTSamsungPASS TestCase.INXT_P1508_TC12_01 InovaxTSamsungPASS TestCase.INXT_P1508_TC12_02 InovaxTSamsungPASS TestCase.INXT_P1508_TC12_03 InovaxTSamsungPASS TestCase.INXT_P1508_TC11_02 InovaxTSamsungQFAPASS TestCase.INXT_P1508_TC11_03 InovaxTSamsungQFAPASS TestCase.INXT_P1508_TC11_04 InovaxTSamsungQFAPASS TestCase.INXT_P1508_TC11_05 InovaxTSamsungQFAPASS TestCase.INXT_P1508_TC11_06 InovaxTSamsungQFAPASS TestCase.INXT_P1508_TC11_02 InovaxTSamsungAFAPASS TestCase.INXT_P1508_TC11_03 InovaxTSamsungAFAPASS TestCase.INXT_P1508_TC11_04 InovaxTSamsungAFAPASS TestCase.INXT_P1508_TC11_05 InovaxTSamsungAFAPASS TestCase.INXT_P1508_TC11_06 InovaxTSamsungAFAPASS TestCase.INXT_P1508_TC2_02 InovaxTSamsungPASS TestCase.INXT_P1508_TC4_02 InovaxTSamsungPASS TestCase.INXT_P1508_TC4_04 InovaxTSamsungNumber of Test Cases Executed: 23Number of Test Cases PASSED: 23Number of Test Cases FAILED: 0

Page 15: Accelerated test case - Anish bhanu

Documentation using Java Doc for Modules and Methods

Page 16: Accelerated test case - Anish bhanu

Benefits with New Automation Approach

• Saving of 60% on efforts with the new approach.• Test cases can be scripted without the application fully developed.• Test case scripts are portable across operating systems.• Maintenance of the test case scripts is negligible.

7% coverage achieved using the new framework

Page 17: Accelerated test case - Anish bhanu

Proxy Development• Proxy developed for Novellus Application

Problem Statement:Novellus software use a third party grid application (Rogue Wave Stingray).RFT was not able to recognize the GRID Control and recorded script was referring to co-ordinates.Our requirement was to recognize the cells and their row and column indices

Solution:GRID Control API are exposed by the third partyHelper DLL was required for getting the window handle for the Grid and in turn calling Grid APIs We developed a Proxy DLL for the GRID Control by extending the Win.Genericproxy class.When the RFT recognizes the GRID control, Proxy DLL creates the Grid Test Object on the RFT

17

Page 18: Accelerated test case - Anish bhanu

Stingray grid controlStingray grid cells

Stingray grid window

18

Page 19: Accelerated test case - Anish bhanu

Proxy Development• Proxy developed for Novellus Application

AUTGrid

19

Helper DLL

VC++ 6.0 C# Java

RFT Script

Proxy DLL Test Object

Page 20: Accelerated test case - Anish bhanu

Summary• Test cases can be written faster to support quick turnaround.• Everyone can write test cases, does not require programming skills. • Framework is used to quickly write test scenarios to re-create

customer issues• Enables re-use of test methods and modules since the design is

modular• Java Doc helps in easy scripting• Robust design and error recovery system• Proxy SDK provides freedom to develop proxies for custom controls

20

Page 21: Accelerated test case - Anish bhanu
Page 22: Accelerated test case - Anish bhanu

Helper DLL code snippet

22

Page 23: Accelerated test case - Anish bhanu

Proxy DLL code snippet

23

Page 24: Accelerated test case - Anish bhanu

Proxy DLL code snippet contd…

24

Page 25: Accelerated test case - Anish bhanu

Test Object

25

Page 26: Accelerated test case - Anish bhanu

RFT script

26

Page 27: Accelerated test case - Anish bhanu

Proxy Development

• Why Proxy is required?– Every test object within RFT framework has a

corresponding proxy– Proxies need to be developed for controls that

are not recognized by RFT– Proxies can also be used to expose hidden

properties of controls even for controls recognized by RFT

• What is a Proxy?– Proxies are interface between the UI controls

and RFT– Proxy objects can interface with the UI

controls using native APIs supported by the UI control

– Test objects interact with proxy objects

27

Page 28: Accelerated test case - Anish bhanu

Proxy Development

• How is a Proxy developed– Proxy Development requires the Proxy SDK provided by RFT.– Proxies can be developed either in Java or C#.– Decide upon the control for which we need to develop the proxy and the functionalities

required out of that.– Generic proxy class is extended and mapped to the actual class corresponding to control

object

Generic Proxy Class

Custom Proxy Class

28