Thursday, December 24, 2009

1st Generation Frameworks LINEAR

1st Generation Frameworks
Framework.jpg The first generation of test automation is primarily comprised of the Linear approach to automated test development. The Linear approach typically yields a one-dimensional set of automated tests in which each automated test is treated simply as an extension of its manual counterpart. Driven mostly by the use of the Record & Playback, all components that are executed by a Linear script largely exist within the body of that script. There is little to no modularity, reusability, or any other Quality Attribute considered in the creation of Linear scripts. Linear Scripts, may be useful in environments with a very small scope.
Linear
The Linear "framework" typically yields a one-dimensional set of automated tests in which each automated test is treated simply as an extension of its manual counterpart. Driven mostly by the use of the Record & Playback, all components that are executed by a Linear script largely exist within the body of that script. There is little to no modularity, reusability, or any other Quality Attribute considered in the creation of Linear scripts. Linear Scripts, may be useful in environments with a very small scope. An example of a small linear script is shown below.
1 Input “John” into Username textbox
2 Input “JPass” into Password textbox
3 Click Login button
4 If “Welcome Screen” exists then
5 Pass the test
6 Else
7 Fail the test
8 End If

Notice that there are not calls to external modules, or external data.

Linear scripts are often driven by Record & Playback should, but in most cases, Record & Playback should not be treated as a framework or serious approach for an automation effort meant to span any real length of time. Some will agree, however, that while Record and Playback is not good as a framework, it may be useful as a technique.

Linear Script Pros
* Quick development – There is little planning or consideration of the various Quality Attributes when creating Linear scripts. Couple this information with the fact that Record and Playback is often the driving force behind Linear script development, then it’s easy to see that cost of development in time, resources and money could be relatively low.
* Smaller tool learning curve – Test automation typically requires knowledge of the automation tool features and language, as well as the knowledge of how the tool interacts with the application under test. The use of Record and Playback in the creation of Linear scripts dynamically creates code that corresponds with actions performed in the application. This code may then be studied by the automator for answers to questions about the tool’s language syntax as well as how the automated test tool’s interaction with the AUT.
* Quickly gather information about application dynamics – This advantage is closely related to the smaller tool learning curve advantage. The use of Record and Playback provides information about the Aut dynamics, such as how object properties change as activity in the application is altered.
* Script Independence – Given the fact that all the components executed by a script exist within that script, there is little apprehension about making script modifications that may unknowingly affect some other script.
* Simplifies error location – The more advanced an automation framework becomes the more complex it becomes. With complexity comes challenges related to locating the source of an error, particularly for those that are unfamiliar with the makeup of the automation framework. Given the fact that all components of a Linear script exist within that script, there is little question about where the error occurred.

Linear Script Challenges (Cons)

* Improper playback – When relying heavily on Record and Playback, recorded scripts will often not playback properly. This is due to the fact that the Record and Playback feature is not analytical. It doesn’t evaluate the application objects and behavior nor does it make decisions on how best to deal with those objects and behaviors. In an effort to fix the playback issues, a series of patchwork solutions are often introduced that won’t stand the test of time.
* Redundancy – Linear scripts don’t take advantage of reuse, therefore if more than one script performs the same or similar functionality, the functionality will be duplicated in each respective script. When the application changes in subsequent releases of the application, excessive maintenance will be the result.
* One dimensional scripts – Little flexibility is offered in altering the way Linear scripts may be executed. Scripts are only readily available to be run at one level, in one location and in one way. If a test manager wants the automator to execute a subset of the total test bed based on defined priorities and risks, or execute the tests in a different environment, or in a different sequence, the automator would have to perform time consuming, run-time analysis of the scripts to make it happen. This will decrease the amount of time available for script execution and analysis.
* Scripts are difficult to read – With the absence of reusable components, Linear scripts are replete with code or automation statements. This will make the script difficult to read and therefore tedious to analyze and maintain. If a statement in the script fails, it is often difficult to determine what application functionality was affected by failure. Likewise, when it becomes necessary to make changes to the script, it is a little more tedious to determine where the changes need to be made.
* Requires higher degree of application knowledge – In order to maintain Linear scripts, a higher degree of application knowledge is required. This is directly related to the fact that there is little modularity. Modularity helps to make it clear what a block of application statements is responsible for doing. The loose statements in Linear Scripts make it a little less clear. So when it comes to analyzing and/or debugging a script the automator must first burn a substantial amount of time gaining a mental understanding of what a given block of statements does in order to effectively maintain the script.

No comments:

Post a Comment