zoukankan      html  css  js  c++  java
  • 自动化测试01

    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)

    1. Automation vastly increases the test coverage

       

      自动化极大地增加了测试范围
    2. Automation optimize the testing speed

       

      自动化优化测试速度
    3. Automation improves the testing quality

       

      自动化提高了测试质量
    4. Automation reduces the cost of testing

       

      自动化降低了测试成本
    5. Automation reduces the test execution time

       

      自动化减少了测试执行时间
    6. Automation does not require Human intervention. We can schedule tests to run overnight without human intervention.

       

      自动化不需要人工干预。 我们可以安排测试在无需人工干预的情况下进行过夜。
    7. Automation scripts can run at any time and any number of times.

       

      自动化脚本可以随时随地运行。
    8. Reusability of scripts on other applications.

       

      脚本在其他应用程序上的可重用性。
    9. Easy to test Stress, Performance and Load

       

      易于测试压力,性能和负载
    10. Saves manual efforts.

       

      节省了人工。

    自动化测试的缺点 (Disadvantages of Automation Testing)

    1. Debugging the test script is a major issue. It may lead to consequences if any error is present in the test script

       

      调试测试脚本是一个主要问题。 如果测试脚本中存在任何错误,可能会导致后果
    2. Proficiency is required to write automation test scripts

       

      熟练编写自动化测试脚本
    3. Test maintenance is costly

       

      测试维护成本高昂
    4. Maintenance of test data is difficult.

       

      测试数据的维护很困难。

    哪些测试用例可以自动化? (Which Test Cases can be Automated?)

    Test Cases should be automated if the following conditions are met.

    如果满足以下条件,则测试用例应自动化。

    1. Tests that are used repeatedly

       

      重复使用的测试
    2. High-Risk test cases

       

      高风险测试案例
    3. Tests that tend to cause human error

       

      容易引起人为错误的测试
    4. Test Cases that are impossible to perform manually

       

      无法手动执行的测试用例
    5. Tests that take lot of time to do manual testing

       

      需要大量时间进行手动测试的测试
    6. Time consuming test scenarios

       

      耗时的测试方案
    7. Regression test suites

       

      回归测试套件
    8. GUI items

       

      GUI项目
    9. Database connections.

       

      数据库连接。

    哪些测试用例不应该自动化? (Which Test Cases should Not be Automated?)

    1. Test Cases for which requires frequent changes

       

      需要经常更改的测试用例
    2. Test Cases related to UI

       

      与UI相关的测试用例
    3. Exploratory tests

       

      探索性测试

    何时自动化? (When to Automate?)

    1. When projects are large and critical

       

      当项目很大且至关重要时
    2. Once application becomes stable

       

      一旦应用稳定
    3. When enough time is available for testing

       

      有足够的时间进行测试时
    4. When frequent regression testing needed

       

      需要频繁进行回归测试时
    5. When manual works are high.

       

      当手工工作很高时。

    什么时候不自动化? (When not to Automate?)

    1. When application not even tested manually atleast once

       

      如果甚至没有手动测试过一次应用程序
    2. When requirements changing frequently

       

      当需求经常变化时
    3. When there is no much regression

       

      当没有太多回归
    4. 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)

    FeatureProgrammableTesting FrequencyCostAutomation
    F1 High High
    F2 Low High
    F3 High Low
    F4 Low Low
    F5
    特征可编程的测试频率成本自动化
    F1
    F2
    F3
    F4
    F5

    自动化测试工具 (Automation Testing Tools)

    1. Selenium

       

      Selenium
    2. QTP(UFT)

       

      QTP(UFT)
    3. RFT

       

      RFT
    4. Test Partner

       

      测试伙伴
    5. 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:

    自动化过程中遵循以下步骤:

     
    1. Automation Test Planning

       

      自动化测试计划
    2. Test Environment Setup

       

      测试环境设置
    3. Analyze test cases

       

      分析测试用例
    4. Developing test scripts

       

      开发测试脚本
    5. Enhance test scripts

       

      增强测试脚本
    6. Scripts debugging

       

      脚本调试
    7. Scripts execution

       

      脚本执行
    8. Analyze test results

       

      分析测试结果
    9. Defect reporting

       

      缺陷报告
    Automation Testing Process

    Automation Testing Process

    自动化测试流程

    自动化测试工具选择标准 (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:

    选择自动化工具在很大程度上取决于应用技术。 但是,在选择自动化工具时要考虑的其他几点是:

    1. Cost(License Price)

       

      费用(许可证价格)
    2. Features

       

      特征
    3. Technology support

       

      技术支持
    4. Performance

       

      性能
    5. Maintenance

       

      保养

    规划,设计与开发 (Planning, Design and Development)

    During this phase, Tester creates an automation test strategy and plan, with the following details:

    在此阶段,Tester会创建自动化测试策略和计划,其中包含以下详细信息:

    1. Automation tool selection

       

      自动化工具选择
    2. Automation Framework design and its features

       

      自动化框架设计及其功能
    3. In-Scope features to be tested of automation

       

      范围内功能需要进行自动化测试
    4. Out-of-Scope features to be tested of automation

       

      自动化测试之外的功能
    5. Automation testbed preparation

       

      自动化测试台准备
    6. Schedule and Timeline for scripts generation and execution

       

      脚本生成和执行的时间表和时间表
    7. 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

    框架是一组准则,可以帮助我们

    1. Less Maintenance of code

       

      减少代码维护
    2. Maintaining consistency in overall testing

       

      保持整体测试的一致性
    3. Improves test structure

       

      改善测试结构
    4. Minimum code utilization

       

      最低代码使用率

    Types of frameworks used in automation testing:

    自动化测试中使用的框架类型:

    1. Keyword Driven Framework

       

      关键字驱动框架
    2. Data Driven Framework

       

      数据驱动框架
    3. Modular Framework

       

      模块化框架
    4. Hybrid Framework

       

      混合框架

    可以自动化的测试类型 (Types of testing that can be automated)

    1. Unit Testing

       

      单元测试
    2. Integration Testing

       

      整合测试
    3. Functional Testing

       

      功能测试
    4. Smoke Testing

       

      烟雾测试
    5. 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.

    如果需要一次测试,那么我们应该进行手动测试。 如果经常需要测试,那么我们应该进行自动化测试。 正确的自动化工具选择,测试过程以及测试团队的正确选择是自动化测试成功的关键因素。

    翻译自: https://www.journaldev.com/25157/automation-testing

  • 相关阅读:
    [摘]提高SQL语句查询效率的若干建议
    WinForm做的一个多条件查询,主要是解决多控件联动
    MSCRM中用IFRAME显示实体的关联视图
    windows 常用命令
    mscrm WebService开发 之 CrmDiscoveryService
    Mscrm 二次开发之 plugin开发
    热血高校2
    6、情人节杀人事件
    热血高校
    第八章 培养幽默的习惯
  • 原文地址:https://www.cnblogs.com/xyt123/p/14229545.html
Copyright © 2011-2022 走看看