Unit V Test Automation
Unit V Test Automation
TEST AUTOMATION
Software test automation – skill needed for automation – scope of automation – design
and architecture for automation – requirements for a test tool – challenges in automation –
Test metrics and measurements – project, progress and productivity metrics.
Software Test Automation :
Developing software to test the software is called test automation
Automation saves time as software can execute test cases faster than humans do.
The time saved can be used effectively by test engineers to
• Develop additional test cases to achieve better coverage
• Perform some esoteric or specialized tests like adhoc testing
• Perform some extra manual testing
Advantages :
• Test automation can free the test engineers from mundane tasks and make them focus on more
creative tasks
• Automated tests can be more reliable
• Automation helps in immediate testing
• Automation can protect an organization against attrition of test engineers
• Test automation opens up opportunities for better utilization of global resources
Advantages :
• Certain types of testing cannot be executed without automation
• Automation means end to end not test execution alone
Activities involved in automation:
• Picking up the right product build
• Choosing the right configuration
• Performing installation
• Running the tests
• Generating the right test data
• Analyzing the test results
• Filling the defects in the defect repository
Test data generators:
They are scripts that produce test data to maximize coverage of permutations and combinations of
inputs and expected output for result comparison
Terms used in automation:
Test case: It is a set of sequential steps to execute a test operating on a set of predefined inputs to
produce certain expected outputs.
Types of test cases:
1. Manual – executed manually
2. Automated – executed using automation
Same test case being used for different types of testing :
Sl.No. Test cases for testing Belongs to what type of
testing
1 Checks whether log in works Functionality
2 Repeat log in operation in a loop for 48 hours Reliability
3 Perform log in from 10000 clients Load / Stress testing
4 Measure time taken for log in operations in Performance
different conditions
5 Run log in operation from a machine running Internationalization
in Japanese language
External Modules:
There are two modules that are external modules to automation
• TCDB
• Defect DB
All the test cases , the steps to execute them, and the history of their execution are stored in
TCDB. The test cases in TCDB can be manual or automated. The interface shown by thick arrows
represent the interaction between the TCDB and the automation framework only for automated
test cases. Manual test cases do not need any interaction between the TCDB and the framework.
Defect DB contains details of all the defects that are found in various products that are tested in a
particular organization. It contains defects and all the related information. Test engineers submit
the defects for manual test cases . For automated test cases, the framework can automatically
submit the defects to the defects DB during execution.
Scenario and Configuration file modules:
Scenarios are information on “how to execute a particular test case”
Configuration file contains a set of variables that are used in automation. The variables could be
for the test framework or for other modules in automation such as tools and metrics or for the test
suite or for a set of test cases or for a particular test case. Configuration file is important for
running the tests for various input and output conditions and states. The values of variables in this
configuration can be changed dynamically to achieve different execution, input, output and state
conditions.
Test cases and test framework modules:
Test case means the automated test cases that are taken from TCDB and executed by the
framework. Test case is an object for execution for other modules in the architecture and does not
represent any interaction by itself.
A test framework is a module that combines “what to execute” and “ how they have to be
executed”. It picks up the specific test cases that are automated from TCDB and picks up the
scenarios and execute them. The variables and their defined values are picked up by the test
framework and the test cases are executed for those values.
Tools and Results Modules:
When a test framework performs its operations, there are a se of tools that may be required. When
test cases are stored as source code files in TCDB, they need to be extracted and compiled by
build tools. In order to run the compiled code, certain runtime tools and utilities may be required
When a test framework executes a set of test cases with a set of scenarios for the different values
provided by the configuration file, the results for each of the test case along with scenarios and
variable values have to be stored for future analysis and action. The results that come out of the
tests run by the test framework should not overwrite the results from the previous test run. The
history of all the previous test run should be recorded and kept as archives.
Report Generator and Report/Metrics Modules:
Once the results of a test run are available, the next step is to prepare the test reports and metrics.
Preparing report is a complex and time consuming effort and hence it should be part of the
automation design. There should be customized reports like
• Executive report – gives high level status
• Technical report – gives a moderate level of detail
• Debug report – generated for developers to debug the failed test cases and the product.
The periodicity of the report is different such as daily, weekly, monthly and milestone report.
The module that takes the necessary inputs and prepares a formatted report is called a report
generator. Once the results are available, the report generator can generate metrics. All the reports
and metrics that are generated are stored in the reports / metrics module of automation for future
use and analysis.
1. Identify the test suite requirements among the generic requirements. Add other requirements
2. Make sure experiences are taken care of
3. Collect the experiences of other organizations which used similar test tools
4. Keep a checklist of questions to be asked to the vendors on cost/effort/support
5. Identify list of tools that meet the above requirements
6. Evaluate and shortlist one/set of tools and train all test developers on the tool
7. Deploy the tool across test teams after training all potential users of the tool
Challenges in Automation:
• Management commitment
• Automation takes time and effort and pays off in the long run
• It requires significant initial outlay of money
• It requires a steep learning curve for test engineers
• Management should have patience and persist with automation
Test metrics and measurements :
In order to track a project performance and monitor its progress
• The right parameters must be measured
• The right analysis must be done on the data measured
• The result of the analysis must be presented in an appropriate form to the stakeholders to
enable them to make the right decisions on improving product or process quality
Defects per KLOC = ( Total defects found in the product ) / (Total executable AMD lines
of code in KLOC)
Defect removal rate
( Defects found by verification activities + Defects found in unit testing ) / (Defects found
by test test teams ) * 100
Productivity Metrics:
It combines several measurements and parameters with effort spent on the product. It helps in finding out
the capability of the team as well as for other purposes such as
1. Estimating for the new release
2. Finding out how well the team is progressing, understanding the reasons for variations in results
3. Estimating the number of defects that can be found
4. Estimating release date and quality
5. Estimating the cost involved in the release
Metrics:
• Defects per 100 Hours of testing
• Test cases executed per 100 Hours of testing
• Test cases developed per 100 Hours of testing
• Defects per 100 Test cases
• Defects per 100 Failed Test cases
• Test Phase Effectiveness – the defects found in various phases are plotted and analyzed
• Closed Defect Distribution – testing team tracks the defects and analyze how they are closed
Defects per 100 hours of testing = ( Total defects found in the product for a period / Total
hours spent to get those defects ) * 100
Test cases executed per 100 hours of testing = ( Total test cases executed for a period /
Total hours spent in test execution ) * 100
Test cases developed per 100 hours of testing = ( Total test cases developed for a period /
Total hours spent in test case development ) * 100
Defects per 100 test cases = ( Total defects found for a period / Total test cases executed
for the same period ) * 100
Defects per 100 failed test cases = ( Total defects found for a period / Total test cases failed
due to those defects ) * 100