Distinction unit testing [turn], interface testing, functional testing

  Let's look at how functional tests carried out: write test cases, test cases are among the most important test steps and expected results; test personnel to perform the steps according to the test case, and then through the eyes and thinking to determine the actual results and expected results for equality. If they are equal, the test passes; if not equal, the test fails.

  Automated test and functional test needs to be done is the same. Automated here mainly includes three levels of automation, automated unit testing, test automation interfaces and web test automation. Of course, different levels of automation concern is not the same.

  Test automation unit, or call the class method to be tested, according to the parameters of the class or method, passing in the appropriate data. Then, get a return result. The end result assertion returned is equal to the expected results. If they are equal, the test passes; if not equal, the test fails. Therefore, where the test unit is implemented with the concerned logic of the code. Element is the basic test test test, the test unit is the smallest, the object is a function object that may contain input and output for the internal logic function or a function-aspects. It does not contain business logic.

  Interface test automation, according to interface documentation, get in the end is the transfer request it? Or post it please? Interface call to be tested, the corresponding data configuration (id = 1, name = zhangsan), return value, 200 is successful, and returns a query result. Or 10021, the user name can not be empty. Regardless of the input parameters of what we will get a result. The end result assertion returned is equal to the expected results. If they are equal, the test passes; if not equal, the test fails. Therefore, the interface testing are concerned about data. As long as the data is correct, the feature is to make most of the remaining nothing more than to show how these data on the page.

  Automated web testing, this test closer to the user's behavior, simulate a user clicks on a button to input box enter anything. But the user can see the login was successful, but the web automation does not know it just clicks have no effect. So, to find "evidence", for example, after a successful login upper right corner of the page will display "Welcome, xxx". This is a successful login strong "evidence." Thus, when the web automate the login is successful, go get this data asserted. Asserted if they are equal, the test passes; if not equal, the test fails. So, web automation of user actions shaped to focus on the real page buttons and input box is available.

  Therefore, the nature of the test from the behavioral point of view, functional testing and automated unit testing, automated testing, and web interfaces and automated testing is no different. The only difference is that performed by a person, executed by a code or tools.

 

https://blog.csdn.net/qq_16605855/article/details/78404370

Guess you like

Origin www.cnblogs.com/wangyi0419/p/11403387.html