Fundamentals of Automation theory (i)

Source: Internet
Author: User
Tags manual writing

in the test for about two months, has been purely manual testing, manual Writing use cases, manual testing, daily repetitive do some work, feel very boring, and super insecure, their alternative is too strong, any person can do my present work. In order to become more valuable, so determined to start learning automated testing. At present, mainly to see some online public class video, I feel that Wu old public lessons do quite good, you can learn, because PPT does not share, so will be the video into text version with everyone to share under.

"Fundamentals of Automation Theory", 1.5 hours of video, word collated about 6 pages.


first, the basic knowledge needed

    • Html
    • Css
    • Javascript
    • Familiarity with one of the Java, Python,. Net, Ruby
    • Basic SQL knowledge of MySQL
    • The basic use of JUnit

Ii. tools and tools to be used

    • Browser:

    1. Ie
    2. FireFox
    3. Chrome
    4. Safari

    • Selenium Browser drivers:

    1. Chrome Driver
    2. Internet Explorer Driver

Iii. tools and tools to be used

    • Development tools: Eclipse (Java)

BDD (Behavior drivendevelopment, Behavior Driven Development) Framework tool: CUCUMBER-JVM

TDD (Test driven development, testing-driven development) : The principle of TDD is to write the unit test case code before developing the functional code, and test the code to determine what product code needs to be written. The basic idea of TDD is to drive the entire development through testing, but test-driven development is not just a test effort, but a requirement analysis , design, The process of quantifying quality control.

Agile development: Agile Development takes the user's demand evolution as the core, uses the iterative, the gradual and progressive method carries on the software development. In agile development, software projects are cut into multiple sub-projects in the early stages of construction, and the results of each sub-project are tested for visual, integrated, and operational use features. In other words, a large project is divided into several interconnected, but also can be run independently of small projects, and completed, in the process of software has been in a state of use. (Small-run mode, only consider their own needs, other needs are not considered; emphasis on quick feedback, daily morning meeting, completion of the day's development and testing)

Agile Testing:

Agile development efficiency is very high, but also very tired!

    • Build and integrate tools:

-maven (build)

-ant (build)

-jenkins (continuous integration)

Continuous Integration: Team Development members often integrate their work, usually at least once per day, which means multiple integrations may occur on a daily basis.

    • Other Tools ( learn ) :

-autoit : Operation Windows some of the controls and elements on it (such as the file box when uploading a file)

-sikuli : Automated testing based on images

    • Video capture tool:

-monte medialibrary

Iv. Stratification and benefits of testing (three-tier model)

Automation is divided into three tiers: unit testing, interface and component testing, and UI testing. Unit test yields the highest, interface and component testing second, UI testing is minimal.


Figure 1 Automated test three-layer model

The reason why unit testing is the most profitable is that it is easy to locate problems based on the smallest code modules, but most companies do not have unit tests at the moment, because the project cycle and survival issues are mostly done by developers.

One of HP's sisters said he had talked to an Australian developer about a product, and the developer said it was not too familiar with the product, but only for ten years. How many products in China have been developed for ten years? Ten years may have changed the company name for several times.

Interface and component testing: a layer of encapsulation, the combination of various code combinations as a function, his positioning and analysis will become more difficult.

UI testing: High cost, low yield. But it is also important to be based entirely on the user's experience and needs.

The benchmark company of the successful companies in the industry:

    • Google tested and developed 10:1 more people
    • Facebook's Test and development ratio is 0

Facebook's development engineers support 100W users on a single person. Why is there no test? 1.Facebook Development Engineer is absolute Daniel, Facebook needs to interview a large number of development engineers to recruit one, and the interview process is very complex, rigorous; 2. Do a lot of unit testing to ensure the quality of large-scale code products

How can pure manual testers improve themselves?

Learn to develop like a developer.

Some people just don't want to write code to do the test, in fact, this idea is not appropriate, senior Test Manager level testers are generally not only developed technology, but also a lot of testing requirements.

Vi. Current research and development process-agile development

    • Minor release, small step run
    • Continuous integration, build builds every day
    • Automate testing of major version logic to detect new issues and impacts from changes at any time
    • Pair programming: Two people together write a piece of code, can be a person to write a person to see, can also write a part, and then together.
    • Refactoring: function unchanged, code rewrite
    • Encourage communication and reduce the importance of documentation
    • Test-driven development

Vii. Fundamentals of web Automation testing

Automation: Replace manual testing with program execution

Figure 2 Fundamentals of Web Automation testing

viii. Types of automated tests

Unit test-the fastest execution speed 1-10ms

Interface testing-Faster execution 20ms-2s

UI test-the slowest execution of the browser requires 3s, plus the other time is longer

Nine, what needs automation

    • Not all functions need to be automated-for example, to simulate a disconnected network
    • The secret of GUI test automation-performing automated tests will only find very few bugs

Are automated tests designed to find more bugs? No, the automated tests are designed to verify that the original functionality can be performed properly.

    • Perform automated regression testing to verify system state, not to identify a number of bugs
    • Performing automated tests allows us to take time to do more manual testing and uncover defects
    • Writing an automated test process will help you find most of the bugs and keep track of them when you find them.

10. Some typical scenarios for using Automation

    • Verify that the legacy functionality is still available and suitable for a large number of regression testing scenarios
    • Injecting test data using automated testing techniques
    • TDD mode of agile development, behavior-driven Development mode
    • Mechanically and frequently tested. Each time you need to enter the same, large amount of data, and run in a project for a longer period
    • Do Business Operation status monitoring

11, some suggestions of automation practice

    • Support and collaboration from top to bottom
    • Start with a small project for the pilot
    • Testers need to have strong programming and design skills
    • Development needs to constantly improve the testability of software
    • Multi-encouragement Unit test, interface test
    • UI tests use parallel test methods to improve execution speed

Some suggestions for UI Automation

    • Need to tailor the test framework to suit your testing business type
    • Enable testers who do not understand the development to use the test framework for automated testing
    • Design a framework using layered structures
    • Improve some test efficiency with screen-cutting technology
    • Continuous accumulation of automated testing techniques to develop testability requirements

12, the failure of automated test implementation factors

1. Expectations are too high. Just as managers require full testing, it is also unrealistic to expect 100% of test automation.


Figure 3 Functional coverage and cost relationship

2. There is no clear understanding of the benefits and costs. The cost of purchasing and training of the tools should be left open, and the costs of automated testing should also include two parts (the cost of testing is also implied in the implementation cost):

Cost = Realized cost + Running maintenance cost

3. The benefits of automated testing are determined by the number of repeated runs of the test script, or by the utilization of the automated test script.

13. When to start implementing automation

Development phase? -Stable phase? Deployment phase?


Figure 4 do not test automatically at an inappropriate time

Recommendation: Predictable requirements do not affect the design of automated test cases


14, how to implement automated testing?

Simply speaking, the specific implementation of automated testing should include the following seven processes.

1. Access to information and test requirements analysis: The overall grasp of the system architecture and design, analysis of the system testing requirements.

2. Design: Design test Cases and select the test cases that need to be implemented automatically.

3. Implementation: Write, debug, and implement test scripts.

4. Execution: The process of executing a script requires constant analysis of exceptions during execution.

5. Test results Analysis: Analyze what bugs are and which are the test framework itself.

6. Maintenance: The maintenance of automated test scripts is a difficult problem to solve but must be solved.

7. Summary: Summarize the input-output ratio of automation practice in the process of automated testing.

15. Cost investment in software automation testing

1. Cost of maintenance of the script:

-Automated script Maintenance makes our automated tests more cost-prohibitive

-the development of each system is always changing as demand changes, but in most cases, it is a tiny bit of system modification that will lead us to a lot of changes to automated test scripts.

2. Factors to maintain: test cases, test scripts, test data, test results, automated cost analysis

3. Maintenance difficulties: The uncertainty of each factor, the version of the script should correspond to the software build number

4. Testing the server

5. Labor costs

6. Training related expenses

7. Time Cost

16, the terminology of automated testing-data-driven

A data-driven automated testing framework refers to a test-driven engine that obtains test data from a data source, then passes the data as parameters to the test script, and finally validates the test results by executing a test script and outputting the test results.

General data sources and test results are stored in Excel files, CSV files, and so on.

The main advantages of data-driven are:

--Separation of test scripts from test data

--When applying a feature change, you only need to modify the script for that feature section

--The person executing the test case does not need to know the implementation of the test script, only the test data table and the test report table. And the execution of the test script is discrete, that is, the non-linear, the tester can have the choice to execute the test case.

17. Automated test terminology-keyword driven

Automated test for keyword driven (keyword_driven):

--keyword-driven testing is an improved type of data-driven testing that decomposes test logic by keyword to form a data file that corresponds to the packaged business logic.

--key keywords include three classes: Manipulated Object (Item), Action (Operations), and value, which can be represented as item.operation (value) in Object-oriented form

The main idea of keyword-driven is: separation of script and data, separation of interface element name from test internal object name, test description and concrete implementation details.

18. Some goals of the automated testing framework

    • Gao Use Sex
    • High serviceability
    • Stability
    • Quickly write scripts
    • Automatic execution
    • Correct output results
    • Ability to continuously improve the scale of automated tests



Fundamentals of Automation theory (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.