Testing is a major part of any application development life cycle. There are different types of testing based on the application stage – Unit testing, integration testing, system testing etc. Then there are different types of testing process – Manual testing and Automation Testing.
测试是任何应用程序开发生命周期的重要组成部分。 根据应用程序阶段有不同类型的测试-单元测试,集成测试,系统测试等。然后有不同类型的测试过程-手动测试和自动化测试。
手动测试与自动化测试 (Manual Testing vs Automation Testing)
As the name suggests, manual testing requires human effort in running test cases without the use of any tools. Whereas, automation testing is performed by using some tools and test scripts.
顾名思义,手动测试需要人工来运行测试用例,而无需使用任何工具。 而自动化测试是通过使用一些工具和测试脚本来执行的。
什么是自动化测试? (What is Automation Testing?)
When testing tools like Selenium, QTP, Load Runner etc. are used to write and execute test cases, it’s called Automation Testing.
当使用诸如Selenium,QTP,Load Runner等测试工具来编写和执行测试用例时,称为自动化测试。
什么是功能自动化测试? (What is Functional Automation Testing?)
Functional Automation Testing is the process of identifying various functionalities in the project which need to be repetitively tested and then developing and executing Automation Scripts (Programs) to validate the functionalities.
功能自动化测试是确定项目中需要重复测试的各种功能,然后开发和执行自动化脚本(程序)以验证功能的过程。
自动化测试的优势 (Advantages of Automation Testing)
- Automation vastly increases the test coverage
- Automation optimize the testing speed
- Automation improves the testing quality
- Automation reduces the cost of testing
- Automation reduces the test execution time
- Automation does not require Human intervention. We can schedule tests to run overnight without human intervention.
- Automation scripts can run at any time and any number of times.
- Reusability of scripts on other applications.
- Easy to test Stress, Performance and Load
- Saves manual efforts.
自动化测试的缺点 (Disadvantages of Automation Testing)
- Debugging the test script is a major issue. It may lead to consequences if any error is present in the test script
- Proficiency is required to write automation test scripts
- Test maintenance is costly
- Maintenance of test data is difficult.
哪些测试用例可以自动化? (Which Test Cases can be Automated?)
Test Cases should be automated if the following conditions are met.
如果满足以下条件,则测试用例应自动化。
- Tests that are used repeatedly
- High-Risk test cases
- Tests that tend to cause human error
- Test Cases that are impossible to perform manually
- Tests that take lot of time to do manual testing
- Time consuming test scenarios
- Regression test suites
- GUI items
- Database connections.
哪些测试用例不应该自动化? (Which Test Cases should Not be Automated?)
- Test Cases for which requires frequent changes
- Test Cases related to UI
- Exploratory tests
何时自动化? (When to Automate?)
- When projects are large and critical
- Once application becomes stable
- When enough time is available for testing
- When frequent regression testing needed
- When manual works are high.
什么时候不自动化? (When not to Automate?)
- When application not even tested manually atleast once
- When requirements changing frequently
- When there is no much regression
- When there is no time and resource constraint.
Note: Automation Testing is additional support to speed up the testing activity but not for replacement of Manual Testing because everything cannot be automated.
注意 :自动化测试是额外的支持,可以加快测试活动,但不能替代手动测试,因为所有内容都无法实现自动化。
如何决定要自动化什么而不要自动化 (How to decide what to Automate and what not to Automate)
Feature | Programmable | Testing Frequency | Cost | Automation |
---|---|---|---|---|
F1 | ✔ | High | High | ✔ |
F2 | ✔ | Low | High | ✖ |
F3 | ✔ | High | Low | ✔ |
F4 | ✔ | Low | Low | ✖ |
F5 | ✖ | ✖ | ✖ | ✖ |
特征 | 可编程的 | 测试频率 | 成本 | 自动化 |
---|---|---|---|---|
F1 | ✔ | 高 | 高 | ✔ |
F2 | ✔ | 低 | 高 | ✖ |
F3 | ✔ | 高 | 低 | ✔ |
F4 | ✔ | 低 | 低 | ✖ |
F5 | ✖ | ✖ | ✖ | ✖ |
自动化测试工具 (Automation Testing Tools)
- Selenium
- QTP(UFT)
- RFT
- Test Partner
- Silk Test
QTP, RFT, Silk test are Licensed tools and whereas Selenium is an open source tool.
QTP,RFT,Silk测试是许可工具,而Selenium是开放源代码工具。
自动化测试流程 (Automation Testing Process)
Following steps are followed in an Automation Process:
自动化过程中遵循以下步骤:
- Automation Test Planning
- Test Environment Setup
- Analyze test cases
- Developing test scripts
- Enhance test scripts
- Scripts debugging
- Scripts execution
- Analyze test results
- Defect reporting
自动化测试工具选择标准 (Automation Testing Tool Selection Criteria)
Selecting an automation tool largely depends on application technology. However, some other points to consider while selecting an automation tool are:
选择自动化工具在很大程度上取决于应用技术。 但是,在选择自动化工具时要考虑的其他几点是:
- Cost(License Price)
- Features
- Technology support
- Performance
- Maintenance
规划,设计与开发 (Planning, Design and Development)
During this phase, Tester creates an automation test strategy and plan, with the following details:
在此阶段,Tester会创建自动化测试策略和计划,其中包含以下详细信息:
- Automation tool selection
- Automation Framework design and its features
- In-Scope features to be tested of automation
- Out-of-Scope features to be tested of automation
- Automation testbed preparation
- Schedule and Timeline for scripts generation and execution
- Deliverables of Test Automation
测试执行 (Test Execution)
In this phase, automation scripts are executed written by testers. To execute the scripts we need input test data before testers run the tests. Once scripts execution completes testers provide detailed test reports.
在此阶段,自动化脚本由测试人员执行。 要执行脚本,我们需要在测试人员运行测试之前输入测试数据。 脚本执行完成后,测试人员将提供详细的测试报告。
保养 (Maintenance)
As new functionalities added each time to the System Under Test with successive cycles, Automation Scripts need to be added, reviewed and maintained for each test cycle release. Maintenance becomes necessary in order to improve the effectiveness of Automation Scripts.
由于每次都有连续的周期向被测系统添加新功能时,需要为每个测试周期版本添加,检查和维护自动化脚本。 为了提高自动化脚本的有效性,必须进行维护。
自动化框架 (Framework for Automation)
A framework is a set of guidelines which helps us in
框架是一组准则,可以帮助我们
- Less Maintenance of code
- Maintaining consistency in overall testing
- Improves test structure
- Minimum code utilization
Types of frameworks used in automation testing:
自动化测试中使用的框架类型:
- Keyword Driven Framework
- Data Driven Framework
- Modular Framework
- Hybrid Framework
可以自动化的测试类型 (Types of testing that can be automated)
- Unit Testing
- Integration Testing
- Functional Testing
- Smoke Testing
- Regression Testing
结论 (Conclusion)
If testing is one time needed then we should go for manual testing. If testing is frequently needed then we should go for automation testing. The right automation tool selection, testing process and right selection of the testing team are the key players for automation testing to be successful.
如果需要一次测试,那么我们应该进行手动测试。 如果经常需要测试,那么我们应该进行自动化测试。 正确的自动化工具选择,测试过程以及测试团队的正确选择是自动化测试成功的关键因素。