Black box testing, white box testing, stress testing their differences

White-box testing

  • White box: the test is carried out by the program source code without using the user interface. This type of testing or shortcomings need to find internal code error algorithm, the overflow path, the conditions and the like from the code syntax, and thus be corrected.
White-box testing process
  • White box test methods have code inspection method, static structural analysis, static quality metric, logical overlay method, the basic path test method, the test field, the test symbols, the path covered and process variations.
  • Method override the standard logical white box cover, and covering the basic path testing cycle. Wherein the cover comprises a logic statement coverage, decision coverage, condition coverage determination / condition coverage, condition combination coverage and path coverage. Six kinds of capabilities covering the standard error was found to vary from weak to strong:
  1. Statement covering each statement is executed at least once.
  2. Each branch is determined covering each decision is performed at least once.
  3. The conditions of each covering each decision shall be taken to the various possible values.
  4. Determination / decision coverage condition coverage while satisfying the conditions covered.
  5. Covering condition combination occurs at least once in each determined for each combination of each condition.
  6. Covering the path so each program performing at least one possible path.

Black box testing

  • Black Box Testing: is to rigorously test the entire software or by using some kind of software features, but not by checking the source code of the program or clear understanding of the source code of the software how specific design.
Black box testing process
  • The results testers by entering their data and then look at the output in order to understand how the software works, at the time of the test, the program can not open as a black box, in the case without considering the internal structure and internal characteristics of the program, testers Interface test only checks whether the program functions in accordance with the normal use of the requirements specification, whether the program can be received and properly correct output.
  • It does not matter what the internal structure of the program, but starting from the user, based on the actual product features that should be implemented and product specifications have been defined to verify that the product should have the function is realized, whether each feature is normally available, whether to meet user requirements.

The difference between black box with white box

  • The biggest difference between the two should be the test subject is not the same, mainly targeted at white-box testing program code logic, is aimed primarily at black box program presented to the user function, simply means that the former test procedure which tests the foreground background display function.

pressure test

  • Simple to understand: The web site also issue 10,100,1000 personal visit does not appear.

jmeter simulation of the site to do stress tests

General site, before entering the business functions need to login first before you can access business functions. The basic framework of the following

detailed steps:

1. Log badboy recording, random access to a URL.

2. jmeter open for a while when you can write your own reference inside the parameters of what name or path. If you can omit http familiar with these two direct write script

3. Create a new thread group

  • Select the test program, right-click - "add -" threads (users) thread group
  • Thread groups can be set to the number of concurrent threads to do stress tests. In the "cycles" setting does not select forever, the number of cycles setting 1.

4. Set the http request login, select the thread group, right - add - "sampler -" http request.

  • In the "server name or ip" set localhost or URL, port settings: 80, "method" set post, website address path settings login. Login required to pass user and password. Adding the parameter list in the "transmission request together with the parameters." Setting parameter values ​​according to the web application. The login_user = 0001; login_password = 1; actFlag = login. How to set specific content can be copied just recorded.

5. After a successful login, the site will generally jump page. In jmap do the judgment, determines whether to register as expected after the main page (this step may not be provided).

  • Selection 4 "http request", right - "add -" assertion - "Responding to the assertion. "Apply to" set the Main smaple only; "response field to test the" Settings "url sample"; "pattern matching rules" set "includes," "to test Mode," page to jump to main page
  1. After the general website login, generated in tomcat in the session, after visiting other pages will not need to log in again, provided that the browser must support cookie. In the jmap also like to continue to access other pages, set the following key needs to be done.
  • Select the "thread group" - "Right -" add - "configuration elements -" Http cookie manager. After the addition of this step, http request will have cookie function, ie after successful login to access other pages will not jump to the login page to log in again.

8. target page repeatedly stress test.

  • 7.1 How to make repeated visits to the test page load cells achieve results. Is selected from a "thread group" - "Right -" Logic Controller - "loop controller. Cycles, select "forever."
  • 7.2 selecting the newly added "cycler", right - "Add -" sampler - "http request, setting 4, step IP, port, HTTP request method" GET "path being tested pressure url
  • According to the above settings, the configuration has been completed, do stress testing. Just tap the menu "Run" - "start, that run stress tests.

9. jmeter provides a lot of pressure results View tool. When the stress test is a very good analysis tool. Here are several viewing tools can be selectively added.

  • 8.1 observe the result tree. He records each request to transmit data, the response data is returned. Select the "thread group" - "Right -" add - "look at the result tree.
  • 8.2 see the results with the form. View the response time per request. Select the "thread group" - "Right -" add - "to view the results in tables.
  • 8.3 Summary Report. You can see the average response time, maximum response time.

Guess you like

Origin blog.csdn.net/zxh7770/article/details/92435322