INCLUDE_DATA

Quick Testing Tips Your daily feed of short software testing tips…

8Sep/10Off

18 automation refactoring heuristics with code examples

Creating automation scripts from small steps and simple code is a common recommendation. In the context of learning programming, automation tools and object models it might even be considered a best practice. Yet practically using such scripts in testing brings minimal value due to variety of issues. Some of them related to programming.

Whenever encountering an external call that might break execution or raise exception see if you can improve it with error-handling.

On Error Resume Next
 boolRC = objRegExp.Test(sSource)
 intRC = Err.Number
 On Error GoTo 0
 If intRC <> 0 Then boolRC = FALSE
 If Not boolRC Then
    Set objRegExp = Nothing
    Regex_Match = ""
    Exit Function
 End If

 

Suggested collection of refactoring heuristics covers levels of code block, subroutine, simple class, function library, and intended to help improving code, created with such tools as Quick Test Professional and Test Complete.

Posted By Albert Gareev
Comments (1) Trackbacks (0)
  1. Very useful information. Thanks for sharing this.

Trackbacks are disabled.

Categories

Authors

Pages

Site speeded up by PHP Speedy Site speeded up by PHP Speedy