On the misunderstanding of automated testing (I.)

Source: Internet
Author: User

As a technical means of software testing, automated testing is often discussed by everyone. I have a little bit of automation technology, today talk about some of the mistakes of automation, to help the novice can correctly understand and recognize the concepts of automation.

What is the nature of the test behavior?

Why start with this concept, because for beginners, automation is always very high-end and complex.

Let's take a look at how functional testing works: Writing test cases, the most important of which is the test steps and expected results; The tester performs the steps based on the test case and then judges the actual and expected results by the eyes and thinking. Tests pass if they are equal, and tests fail if they are not equal.

What you do with automated testing is consistent with functional testing. Automation consists of three levels of automation, Unit test automation, Interface test automation, and Web test Automation. Of course, different levels of automation focus is not the same.

Unit Test automation invokes the class or method being tested, passing in the corresponding data according to the parameters of the class or method. Then, get a return result. The final assertion returns whether the result is equal to the expected result. Tests pass if they are equal, and tests fail if they are not equal. So, unit testing here is concerned with the implementation and logic of the code.

Interface test Automation, according to the interface document, in the end is get request? or post please? Calls the interface being tested, constructs the corresponding data ( id=1,name=zhangsan 200 successful and returns the results of the query. or 10021 , the user name cannot be empty. Regardless of the input parameters, we will get a result. The final assertion returns whether the result is equal to the expected result. Tests pass if they are equal, and tests fail if they are not equal. So, the interface test is concerned with the data. As long as the data is correct, the function is more than half, the rest is just how to display the data on the page.

The automation of Web testing, which is closer to the user's behavior, simulates what a user has clicked on a button and entered into an input box. However, the user can see that the login was successful, but Web Automation does not know if its click has taken effect. Therefore, to find "evidence", for example, after the successful login page will appear in the upper right corner of "welcome,xxx." This is the strong "evidence" of login success. Then, when the Web Automation login succeeds, it gets the data to assert. If the assertion is equal, the test passes, and if not equal, the test fails. So,Web Automation's focus user action is that the actual buttons and input boxes on the page are available.

So, from the test behavior in essence, functional testing and unit automation testing, interface Automation testing and Web Automation testing is no different. The only difference is that one is executed by a person, one by code or by a tool.

we often hear two of voices:

A sound, many Test novices think of automation as an essential skill to the pinnacle of life. As long as the mastery of automation can become the CTO, marry mating, to the pinnacle of life. Often with the small look of hope asked:xxx automation How much money one months? How to learn automated test technology? Recommend a book or material or video?

Another kind of voice, a little understanding of automation, was automated pits, or simply despise and resistance to automation, but also the automation to say excrement. The page always changes, the maintenance cost is high, this element TM How not to locate. Costly, the cost of a lot of effort can not find the bug. and the automation use case itself to be bug constantly. What the? Automation can't actually do browser compatibility testing? What the? Did your leaders let you automate? You lead SB.

The first sound, in theory any skill is to improve efficiency and output, saving the cost of the premise of the company. For example, the previous project to 5 tests, now with the automation,3 is enough. But if you use automation, you need to recruit 2 more people to maintain the automation scripts. That's not going to happen. So I just can't learn to study? I learned to find a full-time automation of the post can not ah? The salary is at least higher than the current functional test! Yes, yes, OK! Learning of course is OK. But the method should be correct. I'll talk about the posture of the automated tests right later. (left hand one slow motion ...) but, in fact, I want to tell you that for testing, in theory you have a single skill that is far from the pinnacle of your life.

Say another sound, which is generally our expectation of automated testing is too high. Automation, should not be automated scripts to write well, automated script brush run. Then, with a cup of tea, thebug was found. It must be so beautiful, how many functional testers have to change their careers to move bricks. Generally this understanding, the main two reasons, not enough skills, some rely only on a variety of automated testing tools, and some can only write simple script to simulate user action. The second reason, regardless of 3,721, is to take the project you have tested. Where does this element go? How does this function write assertions? Hell, the script is running and it's wrong.

Two tips for learning

You do not BB , you are big God, you certainly despise us these novice, you of course stand to speak not waist ache. So, what do you mean by automated testing? You give me a way. There's quite a lot of information on automation. I'll give you a two-point suggestion.

Don't be obsessed with automation tools, learn to develop language. I personally feel very deeply, theoretically, whether you write unit test automation, Interface test automation, or Web test automation, all belong to the development behavior, but with the test of thinking in writing test code only. You say, if the development ability only stay in a little can understand, let you achieve a simple function on the brain blank level certainly not. Code to write more, write more, natural ideas come, code structure of the design ability to come. However, it takes half a year to get results. Which language should I study? At present the mainstream of any line, you develop java, you can learn java, you develop with Python, you can learn Python .

I want to learn automation technology, you let me learn programming language, I want to be able to linguistics good, I when development to forget. So you want to go to the top of your life? There is only hope beyond the threshold of programming ability. (Of course, do not go to the technical flow of the other said.) )

When you learn the programming well, you know how the function is developed. A lot of test questions naturally go through. How to unit test how to write, interface test how to do and so on.

Another point of advice is single-minded! Single - minded! Single - minded! Important things to say three times, if you often mix test group, you will be attracted by a variety of testing technology tools, today we discuss performance test is very hot ah, seemingly high salary job. Or find some information science. After a period of time and found that mobile automation testing is the direction, you should learn about it. Therefore, the non-specificity is your biggest enemy, wait until the interview. Look at the resume to write a full of skills, each asked two more sentences on ...

What's the way? They must be required by the company, can you not learn? Well, then, can you put your eyes on the job information for the BAT? The future is to go to the pinnacle of life, how can only put their eyes on those second-rate companies above, these companies, have to recruit a functional test, but also not required "proficient in loadrunner,QTP and other automation tools ”。

Judging from your technical blog, you are not exclusive! Update this technology today and introduce the skills tomorrow. I have a learning line, okay? Blog updates are a small part of my study summary. From the big line, I've been focusing on programming skills and automation-related skills for the last three years.

Originally wanted to talk about some of the specific misunderstanding of automated testing, the results pulled so much, the rest of the next article.

On the misunderstanding of automated testing (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.