Comments 0

Document transcript

69CHAPTER5Functional Test Automation*Functional testing assures that your implementation of SAP meetsyour business requirements. Given the highly configurable andtightly integrated nature of the SAP modules, as well as the probabil-ity that you will also integrate in-house applications or third-partyplug-ins, it is a critical and challenging task requiring the verificationof hundreds or even thousands of business processes and the rulesthat govern them.This chapter explores the business case for automating your func-tional testing, the alternative automation approaches to consider, andorganizational considerations and techniques for maintaining andmanaging your test automation assets.WHY AUTOMATE?Test automation is not a panacea, but it can make a dramatic differ-ence in the quality and stability of your SAP deployment over the longterm. The key is to understand when automation works and when itdoes not, and how to assure your success.Business Case for AutomationThere are three key benefits to automation:1.Expand your test coverage.2.Save time and resources.3.Retain knowledge.*This chapter was authored by Linda Hayes, CTO of WorkSoft, Inc.05_4782 2/5/07 10:41 AM Page 69Expanding your test coverage is one of the most valuable benefitsof automation because it translates into higher quality and thus lesscosts associated with downtime, errors, and rework. Over the life ofyour SAP deployment you will likely experience an increase in thenumber of business processes it supports, either through the imple-mentation of additional modules or integration with other systems.As a result, each successive implementation or modification af-fects a greater number of business processes, which increases the riskand opportunity for failure. Even a 10 percent increase in total func-tionality still requires testing of 100 percent of the process inventorydue to the risk of unexpected impact. The tightly integrated nature ofSAP increases this risk.As Exhibit 5.1 shows, a manual test process cannot keep pacewith this expanding workload because time and resources availablefor testing are either fixed or even declining. In this exhibit, thelighter arrow indicates the processes that need to be tested and thedark arrow indicates the number of test resources. This combinationof increasing processes that need to be tested with a static number oftesters leads to increased risk and potential cost of failure.Under the scenario represented in Exhibit 5.1, automation is theonly practical answer. It enables one to capture tests as repeatable as-sets that can be executed for each successive release or deployment,so that the inventory of tests can keep pace with the inventory ofbusiness processes at risk.This repeatability saves time and resources as well. Instead of re-quiring repetitive manual effort to reverify processes each timechanges are introduced, tests can be automatically executed in an un-attended mode. This allows your resources to focus on adding new70TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDERiskTest ResourcesBusiness ProcessesTime#EXHIBIT 5.1Test Workload Compared to Test Resources05_4782 2/5/07 10:41 AM Page 70tests to support new functionality instead of constantly repeating ex-isting tests.Ironically, when test time is short, testers will often sacrifice re-gression testing in favor of testing new features. The irony is that thegreatest risk to the user is in the existing features, not the new ones.If a business process that the enterprise depends on stops working—or worse, starts doing the wrong thing—then you could halt opera-tions. The loss of a new feature may be inconvenient or evenembarrassing, but it is unlikely to be devastating.This benefit will be lost if the automated tests are not designed tobe maintainable as the application changes. If they either have to berewritten or require significant modifications to be reused, you willkeep starting over instead of building on prior efforts. Therefore, it isessential to adopt an approach to test library design that supportsmaintainability over the life of the application.Finally, the process of automating your test cases introduces dis-cipline and formality to testing, which results in the capture of appli-cation knowledge in the form of test assets. You cannot automatewhat is not defined. By defining your business processes and rules astest cases, you are converting the experience of subject matter experts(SMEs) and business analysts (BAs) into an asset that can be pre-served and reused over the long term, protecting you from the in-evitable loss of expertise due to turnover.When to AutomateConventional wisdom holds that you should automate your tests onlyfor regression testing; that is, the initial deployment should be per-formed manually and only successive changes automated. This beliefarises from the historical record/playback approach to test automa-tion, which requires that the software be completed and stable beforescripts can be captured.New approaches exist, however, that allow automated tests to bedeveloped well in advance of configuration or code completion.These approaches are further described later in the Test AutomationApproaches section.Using these new approaches, automated tests can serve a dualpurpose: They can provide documentation of the “to be” businessprocess as well as deliver test automation. This collapses two steps—Functional Test Automation7105_4782 2/5/07 10:41 AM Page 71documentation and automation—into one, thus further conservingtime and resources.What to AutomateAutomation is all about predictability. If you cannot express the pre-cise inputs and expected outputs, you cannot automate a test. Thismeans that it should be used to verify what is known or predicted.Typically this means positive tests, as in assuring that the businessprocess is executed successfully, but can also be applied to negativetests that verify if business or field edit rules are violated, such asinvalid data types or out-of-range values in which the data is rejectedand an error message given. Think of these tests as “making sure”that processes work as expected.In the context of SAP, the obvious automation candidates are the“to-be” processes, processes that are executed frequently, critical tothe business, and contain integration points (touch points). For SAP-based production systems, SAP transaction ST03 allows for quick fil-tering of which SAP transaction codes are actually used in productionand to what extent/volume.Further, for each process, the data variations that exercise busi-ness and edit rules can also be automated. Applying data-driven tech-niques to automation enables you to quickly expand your test casesby adding data. This also means, however, that automation is not ap-propriate for ad hoc, random, or destructive testing. These tests mustbe performed manually because by their very nature they introduceunexpected or intentionally random conditions. Think of these testsas covering “what-if” scenarios.Ad hoc tests are uniquely suited to manual testing because theyrequire creativity and are deliberately unpredictable. By allowing au-tomation to take care of what you expect to work, you can free yourexperts to try to break the system.Critical Success FactorsSuccessful test automation requires:■Management commitment■Planning and training72TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDE05_4782 2/5/07 10:41 AM Page 72■Dedicated resources■Controlled test environment■Pilot projectNo project can succeed without management commitment, andautomation is no exception. In order for management to manage,they must know where things stand and what to expect. By lettingmanagement know up front what investment you need to succeedwith automation, then keeping them informed every step of the way,you can get their commitment and keep it. This requires a compre-hensive project plan.Your automation plan must clearly identify the total costs and ben-efits of the project up front, provide a detailed project plan with the re-quired resources, timelines, and related activities, then track results andreport to management regularly. Costs include selecting and licensingthe right tool, training the team, establishing a test environment, de-veloping your test library, and maintaining both the tests and the tool.The number and type of resources you need, the time required, and thespecific activities will depend on the approach you adopt.If and when obstacles are encountered, let management knowright away. Get bad news out as early as possible and good news outas soon as you can back it up. Nothing is more disconcerting formanagement than to invest resources without seeing progress or,worse, by sudden surprises. Also keep focus on the fact that the testautomation project will last as long as SAP is being used and main-tained. Every successive release, update, patch, or new integrationwill need to be tested and the automated test assets accordingly main-tained and reexecuted.No matter how easy to use the tool is claimed to be, plan fortraining as well, and perhaps consulting. Learning a tool through trialand error is costly and time consuming, and it is better to get off onthe right foot. Since it is easier to get money allocated all at once in-stead of piecemeal, be careful not to buy the software first and thendecide later you need training or additional services.Although the promise of automation is exciting, realize that testtools do not work by themselves. Buying a test tool is like buying atreadmill—the only weight you lose is in your wallet! You must usethe equipment, do the exercises, and sweat it out to get the benefits.Also understand that even though test automation saves time and re-sources in the long run, in the short term it will require more thanFunctional Test Automation7305_4782 2/5/07 10:41 AM Page 73manual testing. Make sure management understands this, or you mayfind yourself with a tool and no one to implement it.Not only must you have the right resources, you must also com-mit to a controlled test environment that supports predictable data.Automation is all about repeatability, and you cannot repeat the sametests if the data keeps changing. In most cases the data values are thekey to the expected results. Identifying, creating, and maintaining theproper data is not a trivial problem to address and often representsmore than half of the overall effort. Do not wait until you are readyto start testing to implement your strategy.The ideal test data strategy is to have a known data state that canbe archived and refreshed for each test cycle. If this is not possible orpractical, you may consider using automation to “seed” or conditionthe data to create or modify data to meet your needs.If this is your first automation effort, start with a small pilot pro-ject to test your project plan assumptions. Invest two to four weeksand a couple of resources in automating a representative subset ofyour business processes, and carefully document the effort and resultsduring the pilot as these results can be used to estimate a larger im-plementation. Since you can be sure you do not know what you donot know, it is better to learn your lessons on a small scale.Also be sure to commit the right type of resources. As describedin the following section on test automation approaches, depending onthe approach you adopt you will need a mix of skills that may or maynot be part of your existing test group. Do not imagine that having atool means you can get by with less skill or knowledge: The truth isexactly the opposite.Common MistakesPitfalls to avoid when automating your SAP testing include:■Selecting the wrong tool.■Using record and play techniques.■Writing programs to test programs.■Ignoring standards and conventions.In order to select the right test tool you must perform an evalua-tion in your environment with your team. This is the only way to74TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDE05_4782 2/5/07 10:41 AM Page 74assure that the tool is compatible with your SAP implementation—including any gap applications—and especially that your team hasthe right skill set to be productive with it. A scripting tool that re-quires programming skills, for example, will not be successful unlessyou have technical resources available on your team.For purposes of this evaluation, make sure you understand howthe tool handles not only test development but also test managementand especially maintenance, since these are critical to long-term pro-ductivity. Do not settle for a simplistic record-and-play script. Insiston understanding how to write robust tests that are well structured,documented, reliable, and easy to maintain.Record and play is a very attractive approach: Simply perform amanual process and have it automatically recorded into a script. Butwhile these scripts are easy to record, they are unstable when exe-cuted and all but impossible to maintain. They do not have the doc-umentation and structure to be readable, and they lack any logic todetect and respond to the inevitable errors and changes that willoccur. Even variations in the response time of an SAP transaction cancause failures.Another drawback to recorded scripts is that they contain hard-coded data. Recording the process of creating a hundred invoices, forexample, will yield a script containing the same steps 100 times over.This means if a configuration change is made to any step of theprocess, it must be made 100 times. Since this is impractical, recordedscripts are rarely reused after changes and must often be re-recorded.Thus, the value of automation is lost.While the issues with capture/playback can be resolved using ad-vanced scripting code, this leads to the other extreme: writing pro-grams to test programs. This technique requires programming skills,which may exclude your most experienced testers. Further, if each testcase is converted to script code, you will have more code than theSAP module does. This approach results in custom code that is alsodifficult to maintain, especially by anyone other than the originalauthor.Balancing the trade-offs between ease of use and coding is thesubject of the discussion of test automation approaches in the nextsection.The last common mistake is to ignore the need for naming stan-dards and test case conventions. If each tester is permitted to adopttheir own approach and store their tests wherever they wish, it willFunctional Test Automation7505_4782 2/5/07 10:41 AM Page 75be impossible to implement a centralized, unified test library wheretests can be easily located and shared. Treat your automated tests asthe asset they are and ensure that they are easily found, understood,and maintained.TEST AUTOMATION APPROACHESTest automation has steadily evolved over the past two decades(longer if you count mainframes) from record and play, which is allcode and no data, to code-free approaches that are all data and littleor no code. This trend reflects the fact that code is more costly todevelop and maintain than data.This evolution has followed these four stages:1.Record and play2.Data-driven3.Frameworks4.Code-free automationThese represent varying combinations of code and data used to con-struct test cases and each has different advantages and drawbacks.Record and PlayRecord and play appears to be easy but turns out to be difficult.Recorded scripts usually have a very short useful life because they arehard to read, unstable when executed, and almost impossible to main-tain. The time that is saved during the initial development is morethan offset by the downstream costs of debugging failed sessions orre-recording after changes. Exhibit 5.2 shows an example of arecorded script.The ideal use of record and play, oddly enough, is to capture theresults of manually executed tests. This assists the tester in docu-menting results and perhaps reproducing the exact steps that led toany errors.76TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDE05_4782 2/5/07 10:41 AM Page 76Traditional test automation tools that cost thousands of dollarsper user are overkill for this use. Instead, look for simple sessionrecorders that are available for as low as $100.Data-DrivenData-driven techniques address the hard-coded data issue of recordand play by removing the data from the scripts and instead reading itfrom an external file. Typically, a process is recorded once, then scriptcode is added to substitute variables for literal data, read the variablevalues from a file, and loop until all records are completed.This approach reduces overall code volume and allows test casesto be added quickly as data records, but requires programming skillsto implement. It also results in custom code for each process thatmust be maintained as the application changes. Exhibit 5.3 reflectsthe type of changes introduced into a recorded script in order to makeit data-driven.FrameworksWhile data-driven techniques succeeded in reducing code volumeattributable to hard-coded data, they did not directly address theFunctional Test Automation77EXHIBIT 5.2Example of Recorded Script05_4782 2/5/07 10:41 AM Page 77inefficiencies of not sharing common code to handle common tasksacross test cases. They also limited the analyst’s ability to design testflows consisting of multiple scenarios and data.In response, frameworks evolved as a way to provide an infra-structure to handle common tasks and allow business and quality an-alysts to write test flows by calling reusable code components.Typical elements of a framework include:■A layer that allows test flows to be constructed as data in aspreadsheet or database.■Reusable or generated code components that execute testing tasksagainst SAP.■An infrastructure that handles test packaging, timing synchro-nization, error handling, context recovery, result and error log-ging, and other common tasks.Frameworks require two roles and skills: the test engineer, a pro-grammer or scripter who develops the framework and reusable codecomponents, and the test designer, a business or quality analyst whoconstructs processes by ordering these components, together with thetest data values they require, into a spreadsheet or database.78TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDEEXHIBIT 5.3Example of Data-Driven Script and Data File05_4782 2/5/07 10:41 AM Page 78A framework offers several advantages. Nontechnical testers candesign automated test flows and provide data in a standard format,and test engineers can optimize their coding and maintenance effortby developing reusable components. The framework also takes careof managing and monitoring execution to provide reliable results.There are three basic types of frameworks: key/action word,screen/window, and class library. Each type can be implemented usingtext files (spreadsheets) or databases. Spreadsheets are more eco-nomical, as most users already have access to them and are familiarwith their use, but they are more challenging to manage and maintainbecause they are not centrally stored or controlled. It is also easier tomake typographical or spelling errors in a spreadsheet.A database, however, requires more cost and effort to implementbut is easier to manage. By providing a graphical user interface (GUI)front end, users can select from drop-down lists and otherwise beprotected from making input errors. Relational databases also enablemore rapid maintenance as mass changes can be introduced usingStructured Query Language (SQL) statements and similar functions.Key/Action Word FrameworkA key or action word framework comprisesbusiness functions that perform tasks against SAP such as entering anorder or verifying an invoice. Each key or action word has a set ofdata values associated with it for either input or verification. Exhibit5.4 illustrates a typical key/action word implementation using spread-sheets.Key/action word frameworks can be developed internally or ac-quired from commercial vendors. Some of the commercial tools gen-erate the scripts for common components, then allow test engineersto add additional code to handle errors and decision making at run-time as well as other application-specific logic or functionality.The maintenance of key/action word frameworks is divided be-tween the code and the data. The code may have to be regenerated ormodified when the application behavior changes and the spreadsheetor database may have to be updated as functionality is enhanced orchanged.Screen/WindowThis type of framework is a variation of key/actionword in that there are reusable code components that perform specifictasks, but in this case they are organized around actions such as dataFunctional Test Automation7905_4782 2/5/07 10:41 AM Page 79input or verification against each SAP screen. Exhibit 5.5 shows ascreen/window implementation using a database and GUI interface.When a screen changes, the related screen action code compo-nents must be modified or regenerated as well as the related test casespreadsheet or database.Class LibraryA class library framework is built around code compo-nents that are mapped to SAP objects instead of tasks or screens. Eachobject class has an associated set of actions that can be performedagainst it—for example, input to a text box or pressing a button.These class/action code components may be developed or generated,with code added for decision-making logic based on the results dur-ing execution. Exhibit 5.6 is an example of a spreadsheet implemen-tation for a class library framework.As with other framework types, these can be organized into testprocesses in spreadsheets or databases. In this case, the data is pro-vided for each single action.Since the SAP class library rarely changes, the only code that re-quires maintenance for functional changes is any decision-making orother custom code that has been added. The rest of the maintenanceoccurs in the spreadsheets or database.80TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDEEXHIBIT 5.4Key/Action Word Implementation Using SpreadsheetsTest Name:Add OrderDescription Create ordersand verify totaland taxTestcase Customer Product Quantity PriceAdd Order Acme Signs Posterboard 1000 5Add Order Baltimore Sun Paper 65000 1.15Add Order Crosstown, Inc.Confetti 1250000 0.05Testcase Customer Product Tax TotalVerify Order Acme Signs Posterboard 400 5400Verify Order Baltimore Sun Paper 5980 80730Verify Order Crosstown, Inc.Confetti 0 100000005_4782 2/5/07 10:41 AM Page 80Functional Test Automation81EXHIBIT 5.5Screen/Window Implementation Using a Database and GUIInterfaceEXHIBIT 5.6Spreadsheet Implementation for a Class Library FrameworkBuild versus BuyAny of these framework types can be internally devel-oped or licensed from a commercial vendor. While building your ownframework may sometimes appear to be less costly and provide themost flexibility and control, it requires an investment in the develop-ment and ongoing support and maintenance of the framework. Sincerobust frameworks consist of tens of thousands of lines of code, the05_4782 2/5/07 10:41 AM Page 81resource costs and time to create and support this code may besubstantial.Further, if the original framework developers leave, it is commonfor the replacement engineer to rewrite or restructure the frameworkcode according to their own style or preferences. This adds to the on-going cost of ownership.Of course, buying a framework incurs a licensing fee, but this costmay be offset by reducing the continued support and maintenancecosts to a fixed-price annual fee. The decision as to which option ismore economical should also take into consideration how much cus-tom code is needed in either scenario. If the commercial frameworkstill needs significant code development to support the desired testwork flows, it may not offer enough of a cost advantage to offset thelicense costs.Code-Free AutomationA new type of test automation solution has recently emerged thatdoes not require any code to be developed at all. This approachincludes vendor-supported reusable code components that aremapped to the SAP class library and allows test analysts to constructprocesses using point and click within a GUI interface. The testerselects the SAP screen, the object and the action to be performed froma series of drop-down lists, then provides the test data or variablename for any required values.The difference between the code-free approach and the previousframeworks is that no code is written or generated in order to auto-mate the tests. All test processes are stored as data within a database.Even decision making is supported through a GUI without requiringthe development of any additional code.In this approach, the application screens and fields are defined ei-ther by learning the SAP screens or by extracting the screen informa-tion directly from the SAP metadata. This information is stored as amap within the database and it is used to populate the drop-downlists as tests are defined. Test analysts can further select from prede-fined options for making decisions at runtime to control the processworkflow. Exhibit 5.7 depicts an example GUI process editor for acode-free automation solution.82TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDE05_4782 2/5/07 10:41 AM Page 82Aside from removing the need for test engineers to develop andmaintain custom code, code-free solutions enable automated mainte-nance. As the application changes, the map components are com-pared and all differences documented, including the affected testassets. Global changes can be made automatically as well to modifyor remove test steps related to changes or deletions. Since all test as-sets are stored as data, this can be more easily accomplished thanfinding impact and making changes to code.Even a code-free solution, however, should support extensibilityoptions in the event that your implementation of SAP contains inter-faces to non-SAP applications to fill gaps.TEST LIBRARY MAINTENANCEThe primary benefit of automating your SAP test processes is forfuture reuse as configuration changes are made or new patches orFunctional Test Automation83EXHIBIT 5.7Example GUI Process Editor for a Code-Free AutomationSolution05_4782 2/5/07 10:41 AM Page 83versions installed. By automatically reexecuting all of your testprocesses after changes, you can ensure that there have been no unin-tended effects. This level of test coverage can prevent costly produc-tion errors, failures, and downtime.In order to enjoy this benefit you must be able to maintain yourtest processes as changes are made to SAP or your configuration. Ifyou do not update the tests each time you make a change, they willbecome obsolete. In the same vein, you must add new test processesor test data to verify new functionality as it is added so that your testcoverage continues to expand as your usage of SAP does.One way to limit maintenance time and overhead is to adopt aframework or code-free approach so that script code maintenance islimited or eliminated entirely and most changes occur in data instead.Because maintenance is an ongoing requirement, it is critical thatit be efficient. Extensive manual changes to custom-coded compo-nents may be too time-consuming or difficult, resulting in a reduceduseful life for your automated tests. This means you must design yourtests to be easily maintained by following development standards andnaming conventions, and by enforcing change management and ver-sion control on all test assets.Maintenance EventsThere are three primary events that can trigger maintenance of yourtest assets. The first arises when your SAP configuration changes,whether to modify screens or the business process workflow. Depend-ing on your automation approach, this will require that your testcomponents—whether stored in code, spreadsheets, or a database—be modified to accommodate the differences.The second maintenance event is a change to a business processdue to new or different rules. The SAP screens themselves may not bemodified, but the rules that govern the workflow may be changed. Ina script code–based framework, this may necessitate scripting or re-generation of code; a code-free solution will need only changes to thetest processes.Changes to data can cause the third type of maintenance event.This change may arise from different data in the test environment it-84TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDE05_4782 2/5/07 10:41 AM Page 84self, or new data may be needed to exercise new process or rules. Un-less you are using record and play, your test data should be located ina text file, spreadsheet, or database.In each of these cases it is important that your naming conven-tions or coding standards permit you to easily identify which test as-sets are affected by changes without individually inspecting every testprocess or data file. Depending on the automation technique andframework type you select, the impact of a change may be analyzedautomatically or manually. Generally, assets stored as code make itmore difficult to locate and make changes than assets stored as data.Similarly, data housed in a database is easier to manage and maintainthan data stored in text files or spreadsheets.Version ControlBecause maintenance events result in changes to test assets, it is nec-essary to institute version control. Prior versions of a test should bekept in case the functionality has to be rolled back, or for audit trailpurposes to comply with regulatory requirements.If your tests are stored as script code, you may use a softwaresource control system that supports check in/check out for code mod-ules and allows you to identify differences and perform merges be-tween versions.If your tests are stored as data in text files or spreadsheets, youmay also use most software source control systems. For test assetsstored in a database, make sure the database schema permits multi-ple versions to be maintained and compared, and if a test asset isbeing modified, that it is protected from being overwritten by some-one else.MANAGING TEST AUTOMATIONYour test automation team will require a mix of skills, depending onthe approach you have selected. Estimating the time and effort willalso depend on the techniques and tools you have adopted.Functional Test Automation8505_4782 2/5/07 10:41 AM Page 85Team RolesAs described in previous sections, the code-based approaches andframeworks require a minimum of two roles: test engineers, whodevelop and maintain the script code components, and test analystsor designers, who construct and execute the test processes and data.Test designers should be SMEs or BAs who have domain exper-tise in the business processes to be tested. Test engineers need to haveprogramming skills and either training or experience with the script-ing tool of choice. Test analysts need SAP domain expertise and busi-ness process experience. If you have adopted a database repository,you will also need database administration skills.Whether your test framework is internally developed or commer-cially licensed, you will need to plan for training the test team on howto design and develop reusable, maintainable test processes.It is important not to skimp on training team members on nam-ing standards and coding conventions. These are essential skills forimplementing a test library that can be managed, maintained, andtransferred over the long term.EstimatingEstimating the timeline for your test automation effort requires youto consider the following factors: the automation approach youadopt, the number of business processes to be executed, and the num-ber of business rules to be verified.For example, if you select the key/action word framework ap-proach you will need to define the inventory of key or action wordsthat are needed, together with any custom decision-making code.Generally, if it takes one hour to record a process, it will take anotherfive to modify the script to add variables, timing, logic, error han-dling, and so forth, plus another five to integrate it into the frame-work, test, and debug it. So a one-hour manual process will takeabout 10 hours to reduce to a script code component. From there, ad-ditional rules can be tested by adding rows of test data, which may berapid if the data is already defined and slower if not.If you are developing the framework internally, add time to de-velop and test the infrastructure as well. A typical custom framework86TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDE05_4782 2/5/07 10:41 AM Page 86infrastructure for a single application is about 50,000 lines of code.Plan for time to design the library, develop, test, and document it. At25 to 50 tested lines of code (LOC) per developer per day, this trans-lates into about four to eight person-years of development.Likewise, the screen/window approach can be estimated bycounting the number of SAP screens you need to traverse, then mul-tiplying by the number of actions you intend to support for each (e.g.,input, verify, and store). Finally, automate one screen of average com-plexity and use it as a baseline to project the remaining effort.The class library implementation can be estimated by identifyingthe number of classes and related actions plus the infrastructure.There are about 12 different GUI object classes in the SAP GUI; if youprovide an average of five actions for each one of approximately 50LOC each, you will have 600 LOC for the classes and actions plusany custom code needed.After that, estimate the number of test processes and test data val-ues needed; developing the test workflows may take from half anhour to an hour including writing, testing, and debugging. Addingtest data to a workflow to exercise different rules may take only a fewminutes by adding rows to a data file.Code-free approaches require estimates for the number of busi-ness processes and rules to be verified. Processes can typically be con-structed in 15 minutes to half an hour depending on complexity, andtest data can be added in minutes as another row in a table. This doesnot include any extensions for non-SAP applications.In all approaches, however, be certain to plan for gathering andanalyzing the business process flows and the business rules and re-lated data. Ideally, these were documented during the initial businessprocess engineering phase in the form of the “to-be” processes. If not,plan time to interview application subject matter experts to extractthis information. Exhibit 5.8 summarizes the estimating factors foreach approach.OUTSOURCING SCRIPTING TASKSIf you adopt one of the techniques that requires test engineers—andespecially if you elect to build instead of buy your framework—yourorganization will need skilled script coders. If you do not already haveFunctional Test Automation8705_4782 2/5/07 10:41 AM Page 87these resources available, you have three options: Hire new employ-ees, retain contractors, or outsource.Outsourcing may offer the benefits of reduced costs and access toresources already skilled in the test tool at hand. However, realizethat the test designer role requires domain expertise and cannot beoutsourced.The biggest challenge of outsourcing is facilitating efficient com-munication and project management between the designers and engi-neers, especially if the engineers are offshore. Be sure to include extratime for detailed, explicit test case documentation to support remoteengineering. Insist on industry best coding practices such as namingstandards, coding conventions, version control, and documentation,as discussed previously in this chapter: All are essential to assure thelong-term viability of your automated tests.88TESTING SAP R/3: A MANAGER’S STEP-BY-STEP GUIDEEXHIBIT 5.8Effort Estimation Factors by ApproachApproach Framework Code Components Data ComponentsKey/action 50,000 LOC# business tasks ×# processes × testword 25–50 LOC/day 200 LOC each case variations × 1or licensed minute per rowScreen 50,000 LOC# screens × 4 tasks# processes × testword 25–50 LOC/day × 100 LOC each case variations × 1or licensed minute per rowClass 50,000 LOC 10 classes × # processes ×library 25–50 LOC/day 5 actions × number of stepsor licensed 50 LOC each × 30 secondsor licensed per step plus #test case variationsper process × 1minute per rowCode-free Licensed Licensed# processes ×number of steps ×30 seconds perstep plus # testcase variations perprocess × 1 minuteper row05_4782 2/5/07 10:41 AM Page 88Finally, plan for the results to be reviewed and analyzed by the de-signers since they are the owners of the processes and ultimately ac-countable for their accuracy.SUMMARYTest automation is a strategic solution to assuring that your SAPimplementation is accurate and reliable both the first time it goes liveand after every other time that configuration or software changes aremade. Thorough, automated test coverage can save millions in pro-duction errors, downtime, and loss of user productivity by detectingissues before they impact the business.So take the time to select the right tool and technique for yourneeds, invest the proper resources, and follow best practices so thatyour test automation library can serve as a long-term asset.Functional Test Automation8905_4782 2/5/07 10:41 AM Page 8905_4782 2/5/07 10:41 AM Page 90