2. Summary of test interview questions

Summary of test interview questions

function test

1. Similarities and differences between app and web testing ***

Same point:
A.The test cases are the same.
B.The same test method: will be checked according to the renderings UI,Test functionality against requirements documentation.
C.Compatibility testing is required
D.All need to test the stability of the application system.
difference:
A.App Installation and uninstallation test (fresh installation, upgrade installation, third-party tool installation, third-party tool uninstallation, direct uninstallation and deletion),web No installation and uninstallation
B.app Message push test, mobile phone authorization test, front-end and back-end switching.
C.App Interruption test: call interruption, SMS interruption, bluetooth, alarm clock, unplug data cable, mobile phone lock, mobile phone power failure, mobile phone problem (system crash and restart).
D.Compatibility Test: Web The project considers browser compatibility with different kernels, app The different operating systems of the mobile phone need to be considered ( android/ios),different operating system versions,Different models, different screen resolutions, etc.
E.Network test: Different networks and operators, there are currently three major operators in my country such as: Telecom, China Mobile, China Unicom, different network standards, such as: GSM,CDMA,3G,4G,5G etc, in the case of bad or no network APP Behavior.
F.app If the test equipment is insufficient, you can consider using the cloud test platform (Baidu Cloud Test, testin cloud measurement, etc.).

2. The focus of app testing/what is generally tested in app testing ***

Function test, installation and uninstallation test, upgrade test, security test, message push, front-end and back-end switching, ui test, compatibility test, network environment test, performance test, interruption test

3. The focus of web testing ***

functional testing, compatibility testing, ui test ,security testing

4. How to ensure that test cases cover all requirement points / how to ensure product quality**

Test case coverage is hard to reach 1 00%,The more complex the function, the more difficult it is to guarantee. It can only be said that the test coverage should be improved as much as possible.

Coverage can be improved by:
1,Before writing test cases, check whether there are any problems with the relevant requirements and design documents (unclear functional description, design logic defects).
2,Then organize it into a list of functions that need to be covered or a mind map. The list of functions includes new and modified function points, and the performance requirements are also listed (because the corresponding performance test cases need to be sorted out)
3,It is necessary to sort out the existing functions (explicit requirements and invisible requirements must be analyzed), and it is also necessary to check whether there will be interactions with other functions, and sort out the impact points.
4,Send the function list to the team members, and find time to conduct a meeting review, mainly to check and fill in the gaps of functions.
5,The last step is to write test cases, pay attention to writing specifications.
6,After writing, send the test case to the team members, hold a meeting for review, and mainly check the checkpoints and use case specifications to fill in the gaps.
7,In the process of executing the test case, if the test case is found to be incomplete or wrong, it is necessary to modify and optimize the test case in time.
8,After the test is completed, the leakage test bug Add test cases.

5. What do you submit when you file a bug? ***

Title, Reproduction Steps, Expected Result, Actual Result, Test Environment, Priority, Severity, Assigned to, Module, Attachment, Defect Type

6.bug status/bug circulation process **


New: newly discovered bug
Assigned: The defect has been assigned by the tester to the developer for processing
Opened: Developers are working on fixing bugs
Fixed: Developers complete bug fixes, no regression testing yet
Rejected: Developer refused to fix
Deferred: Deferring processing of defects
Closed: After regression testing by testers, the defect no longer exists
Reopen: After regression testing by testers, it is found that the defect still exists

7. The development does not recognize the bug/If you find a bug and the development does not recognize it, what should you do? ***

1.Find a developer to communicate and see why he doesn't recognize him,There may be two cases
2.The first case: The development may say that the product needs to change,
	----We need to find the product to confirm, if it is changed, change the use case according to the new requirements, and re-test after the change
	----                If the product says there is no change, call them together and confirm
3.The second case: the demand has not changed, and the needs understood by both parties are inconsistent. Find the product together to determine,
	----The development understanding is correct, change the use case according to the new understanding, and retest after the change
	----We understand correctly, let the development change bug

8. What should I do if the bug cannot be reproduced? **

A.First consider environmental issues to see if the original environment can be restored
B.Try to recall the reproduction steps when the problem occurred, do not miss any details, and try to reproduce according to the combination of steps
C.Cooperate with developers, let developers check the corresponding code to see if there is a problem through the code level check
D.Reservation occurs bug time log,attached to the commit Bug , hope to pass log Find some clues.
E.Look at the code, maybe a code change, caused by Bug
F.When you encounter a problem, you must mention it, and you can't let any one go Bug,submitted in Bug Add a sentence to the description, that is the recurrence probability, try 20 times, appear once or try 10 times, hand it over to the development, the development will be based on Bug The recurrence probability of , adjust the Bug priority.

9. What is the most classic BUG in your project? /Your most impressive bug ***

Open question, it can be said that it involves front and back issues,The process of positioning meal analysis,I talked about two business logics before ( processon pictured above)
for example
	Xiao Ming on Taobao app Click Add to Cart in the product details ,Then enter the shopping cart and find that the item is not in the shopping cart.
or
	Xiao Ming on Taobao app paid for an order(WeChat Pay), Then I found that the order that should have been ordered is still pending payment, There is no such order in pending shipment, And the money in Xiao Ming's account has been deducted..

make up similar bug,Then give the process of analyzing and locating the problem

Where is the final problem and how did you locate it

10. The process of use case review, what are the passed rules/audit content *

Two rounds: internal review, external review (product, development)

Review content:
1.Whether the structural arrangement of the use case design is clear and reasonable,Whether it is conducive to efficient coverage of requirements.
2.Whether the prioritization is reasonable.
3.Whether to cover all functional points on the test requirements
4.Is the use case well executable?.For example, whether the preconditions, execution steps, input data and expected results of the use case are clear and correct; whether there is an obvious verification method for the expected results
5.Have redundant use cases been removed
6.Whether sufficient negative test cases (counter-examples) are included. Full definition if used here 2/8 Rule, that is 4 times the amount of positive use cases, after all a robust software,80 of them%The codes are all under "protection" 20%function realization
7.Whether to design test cases for user usage scenarios and usage processes from the user level
8.Is it concise and reusable? For example, highly repetitive steps or processes can be extracted and defined as some reusable standard steps.
9.Whether use cases are written according to company-specified templates

Check items for use case review (don't memorize):
1.Are use cases written according to company-defined templates
2.Whether the description of the use case is clear and whether there is ambiguity
3.Whether the content of the use case is correct and consistent with the requirements
4.Whether the expected result of the use case is certain, unique
5.The operation steps should be consistent with the description
6.Whether all requirements are covered **
7.Whether the use case is redundant ** 
8.Is it enforceable
9.Whether it is a test case for designing user usage scenarios and usage processes from the user level
10.Whether the scenario test cases cover the most complex business processes
11.Whether to include positive and negative use cases  **
12.Whether the generation rules are indicated for the output items automatically generated by the system
13.Test cases should contain checks on intermediate and background data
14.have the correct name and number
15.Whether to indicate priority
16.Whether to include configuration information: test environment, data, preconditions, user authorization, etc.
17.Test steps should be specific and clear
18.Automated test scripts must be annotated (including: purpose, input, expected result, etc.)
19.Whether non-functional test requirements or non-testable requirements are listed and explained in use cases

11. Who wrote the test plan in your company? What's in it *

Usually a test manager/The test team leader wrote,
Test purpose, test resources, test scope, test risk (emphasis), division of labor (emphasis), test strategy, test guidelines, test progress (emphasis), test output

12.v model and w model **


13. How to write test case s/test points (say test points for a given business, such as water cup test points, Douyin comments/red envelopes/transfers/likes in the circle of friends/login test points)

Analysis: You can choose from features, performance, ui,ease of use, security, compatibility, app Special test (if it is a mobile terminal project) These seven aspects are described in the form of total score. First, it can be considered from five aspects, and then each aspect is detailed, combined with the method of designing test cases

- WeChat red envelope:
--Function-A single red envelope:				
1,The red envelope amount is empty, 0, 0.01,200.00,200.01,199.99,200
2,Message input numbers, letters, Chinese characters, special characters
3,message length
4,message copy paste
5,Expression selection Favorite expression, other expressions
6,Delete emoji, reselect emoji
7,Select payment method Change, bank card, add new card payment. the amount of money<The amount of money in the red envelope, the amount of money in it=The amount of money in the red envelope, the amount of money in it>Red envelope amount
8,Confirm payment with fingerprints (correct, wrong fingerprints)
9,Confirm payment with password (correct password, wrong password)
10,After the red envelope is successfully sent, the amount of money in the corresponding payment method is reduced (the reduced amount is the same as the amount of the red envelope)
11,The recipient can see the specific information of the red envelope, and the amount, message and expression of the red envelope can be displayed correctly
12,After the red envelope is opened, it shows that it has been received, and the correct amount is added to the change of the recipient. After receiving it again, only the information of the red envelope can be viewed.
13,Red envelope recipients receive their own red envelopes
14,If the red envelope is not received within 24 hours, it will prompt the red envelope to be returned, and the amount of money in the corresponding payment method will increase (the increased amount is the same as the amount of the red envelope), and the other party cannot receive the red envelope.

-- Function-Group red envelopes-Ordinary red envelope: (only the difference from a single red envelope is written)
1,The number of red envelopes is empty, 0, 001, 100, 99, 101
2,When the red envelope is opened, each amount is the same as the amount corresponding to the single amount set when the red envelope is issued.
3,When the red envelope is opened, there will be corresponding prompts
4,Red envelope recipients receive their own red envelopes
5,If the red envelope is not opened within 24 hours, the remaining money will be returned, and the amount of money in the corresponding payment method will increase

-- Group red envelopes-Lucky Red Packet:
1,The total amount of red packets/Number of red packets<0.01
2,The amount of each person opening the red envelope is different, and the total amount is the same as the total amount set for the red envelope
3,The best luck is shown after the red envelope is opened within 24 hours
4,If the red envelope is not opened within 24 hours, it does not show the best luck

Compatibility: Android, Apple, different models and versions of mobile phones
UI Test: The interface has no typos, and the style is unified, Consistent with the design
 Interruption test: switching between different applications, disconnection, incoming calls, text messages, low battery, no phone battery
 Network Test: 2 g/3g/4g/5g  WiFi Mobile Unicom Telecom Weak Network No Network  


- Circle of friends likes:
-- function test
1.Whether to display the result after the like;
2.Whether it can be canceled after liking;
3.Whether the like can be repeated after the like is canceled;
4.Whether there is a message reminder after mutual friends like it;
5.Whether there is a message reminder after non-common friends like it;
6.Click the like person's nickname, can you jump to him?/her homepage;
7.Can you give yourself a compliment?
8.If the user is blocked, whether the common friend likes is prompted;
9.When the liker has a note, whether to display the note nickname;
10.Delete friends after liking, whether to continue to show their likes;

-- UI interface testing
1.Whether the interface is brief and beautiful;
2.Whether the dynamic special effects are displayed normally after likes;
3.Whether the picture of the circle of friends interface is displayed normally;
4.Whether the text of the circle of friends interface is displayed normally;
-- Performance Testing
1.Whether the number of likes is too many can be displayed normally;
2.Is it normal to receive a prompt if there are too many likes at the same time;
-- Safety test
1.Send some visible Moments, the rest are invisible;
2.Send some visible circles of friends, and common friends will not be visible after likes;
-- Weak network test
1.In the weak network environment, whether the like is successful;
2.In a weak network environment, the time to like;
-- Usability Test
 The sending part is visible, whether the last list can be used;


- Taobao search box:
-- function test:
1.Enter the normal keywords that can find the results, the retrieved content and link accuracy
2.Enter a keyword that cannot be found, and whether there is an error message
3.Enter some special content, such as null characters, special characters, etc., the method of equivalence class division can be introduced, etc.
4.The returned product results are sorted: price, sales, evaluation, comprehensive
5.When the returned results are huge, limit the output of the first page, and need to support page turning
6.Multi-option search: keyword, brand, origin, price range, whether Tmall or not, whether to buy nationwide
7.Whether to support fuzzy search and wildcard query
8.Search on slow internet
9.When the search result is empty
10.Search without login and login (in login case, store the user's search keywords and search habits)

-- Performance Testing:
1.Stress test: performance under the pressure of different development users (evaluation indicators such as response time, etc.)
2.Load test: see how many users the limit can carry while using it normally
3.Stability test: how long can it maintain stable operation under normal pressure
4.Memory test: whether there is a memory leak
5.Large data volume test: such as simulating the search results from massive data, listing the search results, how to perform, etc.

-- Usability test:
1.Whether the design of the interface is convenient and easy to use
2.According to different query results, there will be relevant humanized prompts. If you can't find them, you will inform them. When you find them, count the number of entries and inform them. If there is a suspected input condition error, you will be prompted for possible correct input items, etc.
3.The results of the query are listed in an orderly manner, such as by sales or other sorting and synthesis, to ensure that the results of each query are listed according to the rules for easy positioning, and the font, size, and color are displayed for easy identification, etc.
4.Whether the practical retrieval methods such as title query, full-text retrieval, fuzzy query, fault-tolerant query, and multi-keyword organization query (separated by spaces) are normal
5.The spatial style design of the input search criteria, whether the placement is eye-catching for users to notice, whether there are quick query methods such as snapshots and other humanized designs

-- compatibility:
1.Windows/Linux Applications under various operating systems and versions
2.IE/Fireox/Goolge/360/QQ/edge Applications under various browsers, versions, and display resolutions
3.SQL/ORACLE/MySQL Compatibility testing under various database storages such as
4.Compatibility test under various language software platforms such as Simplified Chinese, Traditional Chinese, and English
5.iphone/ipad/Compatibility testing under various mobile application platforms such as Android
6.Compatibility test with related monitoring programs, such as input method, antivirus, monitoring, firewall and other tools at the same time

-- safety:
1.Deleted, encrypted, authorized data is not allowed to be SQL Check whether there is a security control design by attack methods such as injection
2.Enter some reserved characters for database queries, such as single quotation marks,%etc., causing the query SQL There are loopholes in the spliced ​​statements, such as all data can be found out, etc. In this regard, some hacking ideas must be introduced and some tools and technologies, such as crawling, must be introduced.
3.Through white box testing technology, check whether there are security risks in program design
4.Whether relevant filtering and control of content related to national security and prohibited by law are carried out


- shopping cart:
-- interface testing
1.After opening the Taobao shopping cart page, whether the layout of the page is reasonable and complete.
2.Products from different sellers in different table The area is displayed, and the distinction is obvious.
3.The function buttons of the page can be displayed normally.
4.The bottom of the product shows the expired baby.
5."You might like" at the bottom of the page
6.Swipe down the page to display "Shopping Cart" at the top of the shopping cart.
7.If there are items in the shopping cart with price reductions, insufficient inventory, and limited number of purchases, the corresponding fonts will be displayed below the item details.

-- basic skills
1.Are all connections to the cart page OK.
2.Products added from the product information page can be displayed in the shopping cart.
3.If you are not logged in, click the item in the shopping cart to proceed directly to the checkout, and the user will be prompted to enter the user name and password, or the user will be prompted to register.
4.If no product is selected, click settlement, and the user will be prompted "Please add the product to be settled".
5.After checking the item, the total price of the item selected (and the discounted offer) will be displayed.
6.Select the product, click the checkout button, and go to the confirmation order information page.
7.In the shopping cart page, you can modify the information of the added product information, and automatically save it successfully.
8.Product specifications can be re-edited in the shopping cart.
9.There is a limit to the number of items that can be added to the shopping cart.
10.When checking out, you can select all items by clicking the select all button at the bottom.
11.Baby can be managed on the shopping cart page.

-- Performance features Easy-to-use secure interface
1.Is it possible to pay in batches
2.Is there a select all or no select function
3.Can the product be deleted
4.Can the items in the shopping cart be moved to favorites?
5.Whether there is a display of product specifications and purchase quantities
6.Whether there is a display of the product name
7.Whether there are store activities, full discounts, and price reductions
8.Whether each product has a shop name prompt
9.Click on the product store to see if you can enter the store to view the product
10.Click on the product name to enter the product details page
11.Whether there is a text prompt to receive coupons
12.Whether the discounted price after receiving the coupon will be displayed
13.Whether the expired item will still appear in the cart's history
14.Whether each product has a corresponding product image display
15.Is there an order reminder
16.Can you select the type of product again on the shopping cart page?
17.Swipe to the bottom of the shopping cart page, are there any recommended products to display?
18.Will there be a prompt for the regions that do not support delivery? Will the select all and no select checkboxes in front of the product turn gray?
19.When there is no check box for all or no check, and no product is selected, click the Checkout button to jump to the page
20.Is there a function to delete products and delete them in batches?
21.Is there a function to find similar products

-- Performance Testing
1.Whether the cart open time is within a predetermined time frame that can be tricky for users.
2.Edit shopping cart: Time required to delete and add items.
3.When you select the item to be purchased on the shopping cart page for settlement, can the settlement amount be displayed in real time?
4.Time required to clear expired items.
5.How long does it take to open the shopping cart page
6.Whether the shortcut key function is supported
-- Compatibility test
1.iOS: different models, different iOS system.
2.Android: Different brands, different models, different Android systems.
3.Does the test function on different browsers work?

-- Web environment
1.3G,4G,WiFi The functions of the application in the network environment can run normally.
2.Whether there will be a reminder for data exchange when the network is abnormal.
3.If the network is disconnected in the middle and then quickly connected to the network, whether the data can be automatically restored and loaded normally.
4.Intranet access only APP,Whether there will be a reminder when connecting to the external network.

-- exception test
1.When there is no memory, APP whether it can respond normally.
2.Switch display between horizontal and vertical screens.
3.APP Network outage during runtime.
4.Repeatedly operate a function, click and refresh continuously, whether there is a flashback.
5.APP Whether it can run normally when accessing information prompts from phone calls, text messages, and social software during runtime.


Login test case design:
one. Interface test design points:
1. Is the design style of the interface consistent with UI unified design style,Is the layout reasonable?, Is the button aligned
2. web if, Whether the page zoom login module scales with the zoom ratio
3.The text in the interface is concise and easy to understand,no typos
 two. Functional Test Design Essentials:
1.  Enter the registered user name and correct password to verify whether the login is successful
2.  Enter the registered user name and incorrect password, verify whether the verification succeeds or fails, and the prompt information is correct
3.  Enter an unregistered user name and arbitrary password to verify whether the login fails and the prompt information is correct
4.  Log in with an inactive account to verify if the login fails
5.  Log in with a disabled user to verify if the login fails
6.  Both the username and password are empty, and the verification fails to log in, and the prompt information is correct
7.  One of the username and password is empty, the authentication fails to log in, and the prompt information is correct
8.  If the verification code function is enabled for the login function, if the user name and password are correct, enter the correct verification code to verify whether the login is successful.
9.  If the login function enables the verification code function, if the user name and password are correct, enter the wrong verification code to verify whether the login fails and the prompt information is correct
10.Are usernames and passwords case sensitive?
11.Whether the password box on the page is encrypted and displayed, or whether there is a switch button for light and password
12.Whether to prompt to change the password when the user created by the background system successfully logs in for the first time
13.Is the Forgot Username and Forgotten Password features available?
14.Whether the front-end page limits the length of the username and password according to the design requirements
15.If the login function requires a verification code, click the verification code picture or click Change to see if the verification code can be replaced, and whether the replaced verification code is available
16.Whether refreshing the page will refresh the verification code
17.If the verification code is time-sensitive, it is necessary to separate the validity of the verification code within and outside the validity period.
18.After the user logs in successfully but the session times out, whether to continue the operation will be redirected to the user login interface
19.Whether users of different levels, such as administrators and ordinary users, have correct permissions after logging in to the system
20.Whether the default focus of the page is positioned on the user input box
21.hot key Tab and Enter Wait, whether it can be used normally
22.Whether the check of empty and input space strings is consistent
23.Is the length of the characters passed into the backend consistent with using the Chinese keyboard to enter letters and using the English keyboard to enter letters
24.after successful login session Aging settings of
25.Whether to set a quick delete button in the input field
26.Whether the username and password support special characters and Chinese
27.The browser's forward and back buttons, is it valid?
28.After successfully logging out, click the browser back button to see if you can continue the operating system
29.Whether there is a login time limit in the requirements, and if there is a verification time limit is it valid?
30.Verify the correctness of different login methods: scan code, account password, third party...
31.If mobile phone number is supported+Verification code login, whether there is a time limit for the verification code, and whether the mobile device can directly obtain the verification code
32.Whether the operation error message is simple and clear
 three. Performance Test Design Essentials:
1.  Whether the response time of single-user login is less than 3 seconds
2.  Whether there are too many background requests when a single user is logged in
3.  Whether the response time of user login in high concurrency scenarios is less than 5 seconds
4.  Whether the monitoring indicators on the server side meet expectations in high concurrency scenarios
5.  Whether there is resource deadlock and unreasonable resource waiting in high rendezvous concurrency scenarios
6.  If a large number of users log in and out continuously for a long time, is there any memory leak in the server?
7.  Check whether the input content is added with function anti-shake
 Four. Security Test Design Essentials:
1.  Whether the backend storage of user passwords is encrypted
2.  Whether the user password is encrypted during network transmission
3.  Whether the password has a validity period, and whether the password needs to be changed after the validity period of the password expires
4.  Without logging in, directly enter the logged-in URL address,Verify that redirects to user login screen
5.  Whether the password input box does not support copy and paste
6.  Whether the password entered in the password input box can be viewed in the page source mode
7.  The user name and password input boxes respectively enter the typical " SQL Inject the attack" string to verify the system's return page
8.  The user name and password input boxes respectively enter the typical " XSS Cross-site scripting attack" string to verify that system behavior has not been tampered with
9.  In the case of multiple consecutive login failures, whether the system will block subsequent attempts to deal with brute force
10.The same user logs in on multiple browsers on the same terminal to verify that the mutual exclusivity of the login function meets the design expectations
11.The same user logs in successively on the browsers of multiple terminals to verify whether the logins are mutually exclusive
12.Whether the password can be remembered, whether the remembered password is encrypted, whether the remembered password has an expiration date, and whether the password is cleared after the expiration date
13.Whether to support third-party login
14.Password strength, complexity check
15.Remote login verification, replacement device login verification, abnormal login information whether account freezing and deactivation are considered, and whether third-party platforms are allowed to store passwords
16.Is it possible to use the login api Send a login request and bypass the verification code
17.Whether it is possible to log in directly with the request package captured by the packet capture tool
18.intercepted token and other information, whether it can be used directly on other terminals, bypassing the login, token Expiration time check
19.Is there a security risk in the prompt after login error?
five. Compatibility Testing Essentials:
1.  In different browsers, verify the display and functional correctness of the login page
2.  Verify the display and functional correctness of the login page under different versions of the same browser
3.  Verify the correctness of the login page display and function under different browsers of different mobile device terminals
4.  Verify the display and function correctness of the login page under the interface of different resolutions
 six. User Experience Design Essentials:
1. Whether the input box has a key to clear function
2. Entered wrong username/Password login failed, It is best to suggest that the password or user name is wrong
3. The number of passwords entered should preferably be different from the number of encrypted input boxes.
4. How the verification code is pure numbers, Click the verification code input box to pop up the numeric keyboard
5. click user/The password field can jump the mouse focus to the corresponding input box

14. Seven Ways to Design Test Cases*

Boundary value analysis method, equivalence class division method, scenario method, error inference method, decision table, cause and effect diagram, orthogonal experiment method (the first 3 are most commonly used)

Determining the in-point and departure points of the upper point:(0,18],[0,18),(0,18),[0,18]
Upper point: point on the boundary
 interior point: a point within the domain
 From the point: the point closest to the upper point, open inside and close outside

Effective equivalence class: data that meets the requirements of the specification
 Invalid equivalence class: data that does not meet the requirements of the specification

15. The process of your company's testing work ***


Prototype Format: .rp
Started software: axure/Blue Lake View online
ui design: Blue Lake/local design
ui Restoration: The relationship between software and design

16. Test report content*

Writing purpose, testers (emphasis), test environment, test progress (emphasis), use case execution (yes), defect statistics (emphasis), defect analysis (emphasis), test summary (emphasis), risk analysis (emphasis), legacy Question (emphasis)

17. Online related

Android Installation package suffix:.apk(Before),.aab(android app bundle)
ios Installation package suffix:.ipa(iphone app)

Participate in on-line work? ? ?
Only do the acceptance, and do not participate in the follow-up work. They probably do this.
	rear end/front end html: Deployment server
	Android Go Live: Development/The project manager submits the installation package to various application markets (App Store, 360 application market, various mobile applications, goole application market), conduct an audit, and go online after the audit is passed.
	ios Go Live: Development/The project manager submits the installation package to app store,Review (more strict), and you can go online after the review

Apple tax: refers to the App Store charges APP will be 30%(virtual goods).

18. If you are the test leader, what should you do if you find that the test task cannot be completed when you go online next Wednesday?

Analysis: Consider two aspects, 1.Response to this crisis; 2.Reflect on what led to this crisis
 Aspect One: Responding to Crisis
1.work overtime,Second, find a good colleague
2.Transfer people from other groups
3.Consider deferring
4.cut off some demand
5.outsource
 Aspect 2: Reflection
1.Test: The level is not good (substitution, internal training), insufficient manpower (recruitment)
2.Product: For example, frequently changing requirements/new demand
3.UI: The level is not good (replacement, internal training), insufficient manpower (recruitment)
4.Development: The level is not good (replacement, internal training), lack of manpower (recruitment)

19. Black box testing, white box testing, grey box testing **

- black box testing(Black Box -Test):Bundle cover test of Software Look Make a black box, us No go Care about the inside of the box of structure Yes What it looks like, just care about the software enter data and Output result Someone put the black box test Compare do middle Medicine, pass"Interview and Interview cut"To judge Yes Is there a problem.

  "see":Observe whether the software behaves normally.
  "smell":Check that the output is correct.
  "ask":Input all kinds of information, combine "look" and "smell" to observe the response of the software.
  "cut":Like traditional Chinese medicine, give the software "feeling the pulse" and tap some "joints" of the software 

- white box testing:It is a test method that designs test data according to the internal logic structure and coding structure of the program and completes the test. 

- grey box testing:A test method for designing test data based on the external performance of the program while combining the internal structure of the program

20. According to the classification of the test stage, which categories are the tests divided into **

unit testing, integration testing, system testing, acceptance testing
  • Unit testing: a test method for correctness checking of a module, a function or a class
  • Integration testing: After unit testing, the individual modules are assembled into subsystems or systems according to the design requirements, and the testing method is performed as a whole
  • System test: After the integration test, the hardware and software are regarded as a whole, and the overall test of the function and performance of the system
  • Acceptance test: after the system test, the user test is mainly used, or the test method that the testers participate in to check the software quality

21. What is smoke testing and regression testing **

  • Smoke test: a test method to verify that the core functions of the system can operate normally
  • Regression testing: After developing and modifying the bug, re-test to confirm whether the repair is successful, and whether the modification has any test methods that cause errors in other codes

22. Classification of software

1.Classification according to application scenarios:
	Tool software, game software, media software, e-commerce software, etc.
2.Classification according to software architecture:
	Stand-alone software, distributed software
	2.1 Stand-alone software: office,red alert etc.
	2.2 Distributed software:
		C/S Architecture software:The client needs to install special software, such as QQ WeChat, etc.
		B/S Architecture software:The client is a browser, such as Baidu, hao123 Wait

23. What is the difference between BS/CS architecture? *

Concept: The so-called architecture is a kind of thinking used to guide our software development. At present, the most common one is BS/CS.
B---browser browser
C---client client
S---server Server
 the difference:
A.Standard: Relative to cs Architecture Bs Both ends of the architecture use off-the-shelf mature products, bs Some of the standards will be displayed.
B.Efficiency: Relative to bs Architecture cs The clients in the server can share some data processing, and the execution efficiency will be higher.
C.Safety: bs The transmission of data obtained in the architecture is based on Http protocol for transmission, and Http The protocol is again output in plaintext. can be captured, then bs architecture compared to cs The architecture appears to be less secure, (actually it's all relative).
D.upgrade: bs The architecture only needs to update the data on the server side, and the foreground only needs to refresh the page to upgrade, and cs The architecture must be updated on both ends.
E.Development Cost: Relative to bs Architecture cs The client needs to be developed by itself, bs no, so cs The cost will be higher.

24. What is the difference between Android mobile phone and IOS mobile phone system?**

A.different operating mechanism:IOS The sandbox operation mechanism is used,Android uses a virtual machine operating mechanism
B.The two background systems are different:IOS No third-party programs can run in the background,Any program in Android can run in the background,until no+memory will be closed
C.IOS used in UI highest command authority,Data processing instructions have the highest authority in Android

25. What environment have you built ***

1.Install JDK,Configure environment variables
2.Install the tools needed for testing, like Jmeter,postman,Packet capture tool
3.Install Android sdk,Configure environment variables for ease of use monkey right Android software test
4.Install Python environment and ide,Write python script, do interface automation and ui automation
5.Install on the server ServerAgent,Monitor server performance

26. What is the difference between a development environment and a test environment?

Development environment: It is in the coding stage. Generally, our code is basically in the development environment, not in the production and testing environment, such as the operating system, web server, locale, php,database etc.
Test environment: After the project is completed, it is available for testing Bug,and modify Bug post-debugging environment.
Production environment: The front-end and back-end of the project data have been dredged, and deployed to Alibaba Cloud for customers to use and access, an environment for users to use

27. Please describe how interface testing and UI testing work together?

A.some overlap, Ui The test is to call the interface through the interface written by the front end, and the interface test is to directly call the interface.
B.Excluding the correctness of front-end processing logic and calls, in theory, the interface test can cover all Ui test, but in practice, as the interface layer covers all business flows, in Ui Only the front-end logic is tested, and the final result will ignore many original function points, resulting in Ui If the test is not sufficient, then when there are many people and sufficient time, you can try the interface to fully cover the business flow, otherwise don't try it easily.

28. What are the common reasons for App crashes?

A.Device fragmentation: Due to the great diversity of devices, App It may appear differently on different devices.
B.Broadband throttling: Networks with poor broadband APP The fast response time required is not enough.
C.Changes in networks: switching between different networks may affect App stability.
D.Memory management: may be low on memory, or use of non-authorized memory locations may cause App fail.
E.Too many users: Too many consecutive numbers can cause App collapse.
F.Code bug: no new feature tested, may cause App Fails in production environment.
Third-Party Services: Ads or pop-ups may cause App collapse.   

30. How to submit high-quality software defect records (reports)? *

A.ui To be uniform and accurate.
B.Try to use the expression terms and expressions commonly used in the industry
C.Only one defect per defect report
D.Non-reproducible defects are also reported
E.Clearly indicate the defect type
F.Clearly indicate defect severity and priority
G.describe (Description) ,Concise, accurate and complete, reveal the essence of the defect, and record the defect or the location of the defect
 Use automatic numeric sequence numbers between short lines, use the same font, font size, and line spacing
 The use of automatic numerical serial numbers between short lines, the use of the same font, font size, and line spacing can ensure that the format of each record is consistent and standardized and professional.
H.Try to record only one operation per step
I.Confirmation steps are complete, accurate, and brief
J.Depending on the defect, image capture can be selected

31. What if the regression test fails?**

Explain the reason for the failure,hold bug Call back and let development re-fix

32. Stress test, load test, stability test

pressure test: Test under heavy load,Check whether the system has functional hazards under peak conditions,Whether the system has good fault tolerance and recoverability
 load test:By gradually increasing the system load,Determine if the performance indicators of the system are met,A test to find out the maximum and ultimate load the system can withstand
 Stability test:Given a user's normal business load,Then do a long test(1 sky-1 week),And ultimately ensure that the server can meet the needs of online business

33. Project iteration cycle **

Usually 2 weeks- 1 month, How much is this and what's new/difficulty
 In addition, when the major version is updated(such as 1.x.x upgrade to 2.0.0) , All functions have to be retested

34. Team size**

product manager:1,project manager:1,ui:2,front end:2,rear end:3,Android:2,ios:3,test:2,

It can be said that there are a lot of people in the testing department.,There are 2 people assigned to this project group
 Make up your own,Reasonable enough,front end:rear end:android:ios:test = close to 1:1

sql statement ***

-------learn---------
Show database: show databases;
Database creation: create database data storage name; 
Database switch: use database;
View all tables of the current library: show tables;
Create the table: create table tablename (columnname type, column name type );
View the table structure: desc Table Name;
Drop table: drop table Table Name;
Remove the library: drop database library name;

-----master-------
Insert data: insert into Table Name values(); 
delete data: delete from Table Name where condition;
change the data: update Table Name set key=value, key=value where condition;( update student set name='Zhang San' where name='zhangsan'; )

-----Inquiry Focus on mastering-------
Query all: select * from Table Name;
Conditional query: select * from Table Name where condition; 
Query the scores of all students, and output the results as Name Chinese English Mathematics: 
select name as Name,chinese as language,english as English,math as math from student 
Query math score in 80-90 Between classmates: 
select * from student where math between 80 and 90 
Query the scores of students whose mathematics, Chinese, and English are both greater than 80 or or , and and:
select * from student where math>80 and english>80 and chinese >80; 

Fuzzy query:_Represents 1 character;%Represents 0 or more characters
 Query all students whose names contain Zhang: select * from student where name like '%open%' 

Ascending: asc
select * from Table Name order by fields in the table asc(MySQL The default is to sort in ascending order, you can not write) ;
Descending order: desc
select * from Table Name order by fields in the table desc ;
(Query by math scores in descending order: select * from student order by math desc;)

Paging query: limit,
select * from table limit m,n;in m means the record from m+1 start,,N representative take n Records.
Take out Articles 3 to 6, 4 records: select * from student limit 2,4 

Group query: group by field
 According to the gender classification, find the number of corresponding genders (for example, male: 20, female: 19):
select sex,count(*) from employee group by sex;
Group query plus conditions: use having,Do not use where
 Find the number of people older than 18 by gender
select sex,count(*) from employee group by sex having age>18;

count number
sum total
avg average
max maximum value
min minimum
 Language average: select avg(chinese) from student;
Count the highest and lowest scores in the language of the class:
select max(chinese) from student;
select min(chinese) from student; 
How many students are in the class: select count(*)from student; 

Subqueries: The result of one query is used as the condition of another query
 Check the brackets first, find kaifa class id,according to id go student Find the corresponding table class_id s student:
select * from student where class_id=(select id from class where name="kaifa");

Inner join query: inner join on Query two tables, set conditions, and query the corresponding data in the two tables
select * from customer c inner join , o on c.id=o.customer_id; 

Left outer join: left join on,Query the data corresponding to the two tables, and at the same time**Query the data that is not related to the left table itself ()
select * from customer c left join orders o on c.id=o.customer_id;

Right outer join: right join on Set the conditions to query the data corresponding to the two tables, and at the same time query all the data that is not related to the right table itself
select * from customer c right join orders o on c.id=o.customer_id;

Deduplication: distinct
SELECT distinct field 1,field 2 FROM Table Name

Common Linux Commands ***

• Directory operations
• cd usr/ switch to this directory usr Table of contents
• cd .. switch to the previous directory
• cd / Change to the system root directory
• mkdir directory name create directory 
• ls Directory name Query all directories and files in this directory 
• ls [-a] Directory name Query all directories and files in this directory,Include hidden files 
• ls [-l] Directory name Query the detailed information of all directories and files in the directory 
• find / -name directory name lookup/root directory under(document)   ****
• mv Directory name New directory name Modify directory name
• mv Directory name New location of directory Cut 
• cp -r directory name directory destination copy   ***
• rm -rf Directory Force delete directory 

• file operations 
• Create empty file: touch file name   ***
• View file contents: cat/more/less/tail document   ***
• Dynamic view/View files in real time(log): tail -f document  ***
• View the first 10 lines of the file: head -n 10 file name   ***
• Look at the last 5 lines of the file: tail -n 5 file name    ***
• Keyword Search : grep string to search for file to search        ***
• Modify the file content: vi/vim document(-->enter file----->command mode------>according to i enter edit mode----->edit file **------->according to**Esc enter command mode--Input: enter bottom line mode-**---->**input wq/q!)       ***
• Force deletion of files: rm -rf document  ***

• file compression :tar -zcvf file name.tar file to pack        ***
• decompression of files:tar -xvf file name.tar        ***
• expansion:Unzip the file to a fixed location :tar -xvf file name.tar -C Specify the location to unzip 

• Query current location : pwd 

• View progress: ps -ef | grep process name(tomcat/mysql)         ***
• kill process:kill -9 process pid         ***
• View the port number:netstat -an | grep The port number(3306)    ***
• View server ip : ifconfig        ***
• Check whether the network can be used normally 
• ping External network address Check whether you can access the external network 
• ping Intranet ip Check if you can access the intranet          ***

• permission command :chmod 777 file empowerment          ***

• Check cpu :top          ***
• View disk information : df -h          ***
• View memory information: free          ***
• To switch administrator accounts: su,then enter the password
• Depend on root switch to test user: su test

Performance Testing

1.Jmeter to do distributed pressure measurement configuration

press: 
	exist Jmeter bin/jmeter.properties modified in server.rmi.ssl.disable=false,change to true
	start up jmeter-server
 control machine:
	bin/jmeter.properties modified in server.rmi.ssl.disable=false,change to true
	bin/jmeter.properties in remote_hosts filling the press ip and port number,multiple use","separated
	Click to run–>Remote start

2. How is the performance test done? ***

1.Do performance requirements analysis and select the most frequently used users/Interfaces of core functions for performance testing, such as: homepage list, search, order submission, etc.
2.Determine performance indicators, such as: transaction pass rate of 99.99%,90%The transaction response time does not exceed 3 seconds, and the error rate is 0.01%,CPU and memory usage is 80%the following, TPS. 
3.Set up a performance test environment and prepare performance test data.
4.use Jmeter development scripts, including:parameterization, assertion, association,Listeners, etc.
5.Design performance test scenarios and use distributed stress testing,Our project has done a single function loop of 50 concurrent users for 30 min benchmarks, then gradually increase the number of concurrent users (150/300/500...),execute 1-2 Hourly load test to see if the system has performance bottlenecks;
6.Analyze the performance test results. If there is a performance bottleneck, collect related logs and bills of lading for performance tuning for development.
7.After development and tuning, regression performance testing(May need to go back and forth to optimize the regression multiple times)
8.After measuring the maximum load, do the stability test (1 day-7 sky)
9.Output load test and stability test report after completion



how to operate(no need to carry,When asked for details, say): 
1.The server needs to start ServerAgent
2.Add two components ( ServerAgent components, TPS)+Listeners (aggregated reports)+ assertion+association
3.The number of threads (the number of concurrent users), the number of loops is permanent+scheduler(set duration)
4.Analysis of the results, compilation of reports

3. How to analyze the performance test results? *

1.View aggregated reports and graphs of server resource usage, check response times, transaction success rates, CPU,memory and IO Whether the usage rate meets the requirements, if the error rate reaches 0 of the total number of requests.01%,We will check what caused it, and retest after modification;
2.If a performance bottleneck occurs, such as response time, or CPU If the usage rate is not up to the standard, we will export the log from the server and analyze where the response time is too long. If the analysis cannot be found, we will call the developer to discuss it together. Regression Testing.

Any indicator only fails to meet the target for a short period of time,need to analyze and optimize,for example cpu/Memory lasts over 80 for 3 minutes%

4. Metrics for performance testing ***

response time, number of concurrent users, throughput, TPS,error rate, resource usage ( CPU,memory, disk IO,network)

TPS and QPS the difference:
QPS: The number of requests processed by the server per second
TPS: The number of transactions processed by the server per second, 1 transaction contains 1 or more requests

5. What is the optimal number of concurrent users for your project? *

We did 1500 at the time (500-1500)When there are two concurrent users, the response time of the query function exceeds the performance index by more than 2 seconds, and the throughput begins to decrease, that is to say, the throughput has reached its peak and began to turn downward.

6. How to judge whether there is a bottleneck in the network? *

After the performance test is over, we will check the throughput of the network during the entire performance test process based on the results of the performance test. If the throughput of the network accounts for 70% of the server's throughput%Above, we believe that there is a bottleneck in the network, usually increasing the bandwidth or compressing the transmission data.

7. How to judge the response time is not up to standard *

us 90%The response time requirement is 3 s,If the response time does not meet the standard, we will first check whether there is a problem with the server bandwidth according to the performance test results. If there is a bottleneck in the bandwidth, we will consider increasing the bandwidth or compressing the transmission data. If there is no problem with the bandwidth, we will export from the server. Logs and developers discuss and analyze where the response time is too long. After the problem is identified, it will be billed to the developer to fix it, and the regression test will be carried out after the repair is completed.

8. How to judge the CPU usage is not up to standard *

We CPU The usage requirement does not exceed 80%,CPU If the usage rate is not up to standard, we will export the logs from the server and analyze where the cause is. CPU If the usage rate is not up to the standard, if the analysis cannot be made, we will call the development team to discuss it together. After the problem is determined, we will issue a bill to the development and repair it. After the repair is completed, we will conduct a regression test.

9. Daily activity, monthly activity, downloads (no need to memorize, just understand)

daily life ( DAU,daily active user): daily active users
 monthly life ( MAU,month active user): monthly active users
 Downloads: app downloads
 Downloads>=monthly life>=daily life

UV(Unique visitor)
Refers to the natural person who accesses and browses this web page through the Internet. A computer client accessing your website is a visitor.  00:00-24:00 The same client is counted only once. Multiple visits by the same visitor in one day count only one UV. 

PV(Page View)
That is, the number of page views or clicks, each time a user visits each page on the website, one is recorded. PV. The user visits the same page multiple times, and the cumulative number of visits is used to measure the number of web pages visited by website users.

10. How to optimize/tune the server*

Divided into software optimization and hardware optimization
 Software optimization: architecture refactoring, algorithm optimization, compilation optimization, code optimization
 Hardware optimization: increase cpu,Memory sticks, disks, increased bandwidth, distributed, load balancing

interface test

1. Network foundation

1. What is the difference between http and https? *

	simply put, HTTPS agreement is made by SSL/TLS+HTTP The network protocol built by the protocol that can perform encrypted transmission and identity authentication is better than http Protocol security. The main differences are as follows: 
	1,https agreement needs to ca To apply for a certificate, there are generally fewer free certificates, so a certain fee is required. 
	2,http is a hypertext transfer protocol, information is transmitted in clear text, https is safe ssl Encrypted Transport Protocol. 
	3,http and https It uses a completely different connection method, and the default port used is also different. The former is 80 and the latter is 443. 
	4,http The connection is simple and stateless; HTTPS agreement is made by SSL+HTTP Protocol built for encrypted transmission and identity authentication 
network protocol, than http Protocol security.

2. What is the difference between get and post requests? *

- GET back button/Refresh is harmless, POST The data will be resubmitted (the browser should inform the user that the data will be resubmitted). 
- GET bookmarks are collectible, POST Not bookmarkable. 
- GET can be cached, POST Cannot be cached.
- GET History parameters are kept in the browser history. POST Parameters are not saved in browser history GET There is a limit to the data length, when sending data, GET method URL adding data; URL is limited in length ( URL The maximum length is 2048 characters). POST Unlimited. 
- and POST compared to, GET is less secure because the data sent is URL a part of. Never use when sending passwords or other sensitive information GET ! 
- POST than GET Safer because parameters are not saved in browser history or web in the server log. 
- GET data in URL is visible to all. POST data will not be displayed in URL middle.

3. What are the request methods?

get,post,put,delete,

4. What are the common status codes? ***

100: This status code tells the client that it should continue to send the request. This temporary response is used to inform the client that part of the request has been accepted by the server, but the client should continue to send the rest of the request. If the request has been completed, ignore this response , and the server will send a final result to the client after the request is complete
200: This is the most common http Status code, indicating that the server has successfully accepted the request and will return the final result requested by the client
202: Indicates that the server has accepted the request, but has not yet processed it, and it is uncertain whether the request will be processed in the end
204: The server successfully processed the request, but did not return any entity content, possibly with new header meta information
301:Permanently redirected, the resource has been permanently allocated new URI 
302:Temporary redirect, resource has been temporarily allocated new URI
400:Bad Request Request message syntax error or parameter error 
401:Unauthorized need to pass HTTP Authentication, or authentication failed 
403:Forbidden Request for resource denied 
404:Not Found,The resource requested by the client was not found
500: The server encountered an unknown error that prevented the client from completing the current request
503:Server overload or downtime for maintenance

5. What is the composition of the http request?

Request Line: The first line of the request is the "method URI protocol/version" for example: GET/sample.jsp HTTP/1.1 
Request headers (message headers): Contains a lot of useful information about the client environment and the request body. For example, request headers can declare the language used by the browser, the length of the request body, etc.
Request body: There is a blank line between the request header and the request body, this line is very important, it means that the request header has ended, and the next is the request body. The request body can contain query string information submitted by the client: username=jinqiao&password=1234 

6. The composition of the http response

Status line: by http Version protocol, status code, status code description composition, such as HTTP/1.1 200 OK 
Response header (message header): Some information that the server passes to the client to describe the server, and the strategy for continuing to access the resource in the future
 Response body (response body): It is returned by the server to the client HTML Text content, or data in other formats, such as video streams, pictures, or audio data.

7. Difference between cookie, session and token*

token
 A token is a way of verifying a user's identity.
simplest token composition:uid(User unique ID),time(timestamp of the current time), sign(sign).

session
 A session represents a session between the server and the browser. This process is continuous or intermittent.
session because the request ( request object); session Is a container that can store any object during the session; session The creation and use is always on the server side, the browser never gets session object; session is a http storage mechanism, the purpose is to arm the http Provides a persistence mechanism.

cookie
 The data stored on the user's local terminal is generated by the server, sent to the browser, and the next time a unified website is requested to the server. cookie stored in a sessionID,This is sent when requested ID;

cookie and session the difference
cookie data is stored on the client, session data is placed on the server;
cookie Not very secure and limited data storage;
session Stored on the server for a certain period of time,When the access increases, the server memory is occupied.

session and token
 as identity authentication, token safety ratio session it is good; Session Authentication is as simple as putting User information is stored in Session , because SID The unpredictability is considered safe for the time being. This is a means of authentication.  and Token ,if referring to OAuth Token or similar mechanisms, provide authentication and authorization , authentication is for users, and authorization is for App . Its purpose is to make a App Has access to a user's information.


token and cookie
Cookie Domain access is not allowed, but token is supported, provided that the transmitted user authentication information passes HTTP header transmission; token It is a token. For example, when you authorize (log in) a program, it is a basis to judge whether you have authorized the software; cookie is written on the client side txt file, which includes your login information and the like, so that the next time you log in to a website, it will automatically call cookie Automatic login username; session and cookie almost, just session It is a file written on the server side and also needs to be written on the client side cookie file, but the file is your browser ID.Session The state is stored on the server side, the client only has session id;and Token The state is stored on the client side.


The above is for understanding, the following needs to be remembered

All three of them are used to verify the user's identity (authentication)

token The token is the authentication method of the user's identity (obtained after logging in, you can obtain user-related data, generally app in use), stored on the user side.
session Sessions, resulting from requests; session It is a container that can store any object in the session process and store it on the server. When the access increases, it occupies the server memory.
cookie,The data stored on the user's local terminal is generated by the server, sent to the browser, and the next time a unified website is requested to the server. cookie stored in a sessionID,This is sent when requested ID;

token safety ratio session it is good, Session Authentication is as simple as putting User information is stored in Session in, while Token ,if referring to OAuth Token or similar mechanisms, provide authentication and authorization , authentication is for users, and authorization is for App

2. Capture packets

1. Talk about capturing packets ***

Packet capture: Packet capture is to intercept, resend, edit, dump and other data packets sent and received by network transmission, and is also used to check network security. Common packet capture tools: Charlers,Fiddler,WireShark...
effect:
1.Locating front-end and back-end problems:
	app:
        View network requests by capturing packets
	web:
		browser press f12, click to network,Find the corresponding network request below
		
	Look url There are also parameters, if url And the parameters are wrong, the problem of the front end, if there is no problem
    Look at the response data, if there is a problem with the response data, then it is a backend problem, if there is no problem with the data
    front-end problem
2.Mock 404
3.Simulate weak net
4.mock test

2. How to locate the front-end and back-end problems *****

app:
	View network requests by capturing packets
web:
	browser press f12, click to network,Find the corresponding network request below

see url There are also parameters, if url And the parameters are wrong, the problem of the front end, if there is no problem
 Look at the response data, if there is a problem with the response data, then it is a backend problem, if there is no problem with the data
 front-end problem

3. Did you encounter garbled characters when capturing packets?

some
1.Caused by no trusted certificate,because https is encrypted transmission
2.The data itself has also been encrypted, and unless the key is obtained, there is no way to decrypt it

4. mock test, have you used rewrite, have you used map remote/local **

mock Test: simulate the request and test data return we want

charles
 Breakpoints: Breakpoints can be used to modify request data and response data, and are generally used to temporarily modify
map: 
Essentially a redirect
	map local(Replace the data returned by the server with the local file)   
 	map remote(Replace the original data with the data returned by another link) 
rewrite: Modify the request by regular matching/response data

5. Specific operation (no need to back)

5.1 How to trust the certificate

Export the certificate of the packet capture tool to the corresponding browser/trust in mobile

charles specific operation(don't ask, don't say):
Install:help --> ssl proxying--> install charles root certificate
 export:help-->ssl proxying-->save Charles root certificate,choose.cer certificate in format
 trust:chrome Browser: Settings → Manage Certificates (Security) → import

5.2 How to capture packets on the mobile terminal

1.pc on the same phone wifi Down
2.The phone needs to set up a proxy, ip and port number
3.trust certificate
4.turn on app Capture packets

5.3 Map local usage steps

Tools--Map Local --> specify local file

5.4 Steps for using map remote

tools--map remote -->Specify a redirected link

5.5 Breakpoint modification request parameters

Check link-->right click -->choose" BreakPoints" -->refresh page -->Edit Request,Modify request information-->Execute

5.6 Breakpoints modify response data

Check link-->right click -->choose" BreakPoints" -->refresh page -->Edit Response",Modify response data-->Execute

5.7 rewrite

Tools-Rewrite -->Add the corresponding link,rule

5.8 Weak network usage steps

Proxy-->Throttling Settings(Throttle valve setting) -->can choose 3 G,4G,56kbps,256kbps....

5.9 Simulate 404 usage steps

tools->blocklist--> Add URL

3. Interface test

3.1 Tell me about Postman (what is it, what is it useful for, and what functions have you used)***

Postman is a powerful http Debugging tool, we generally use it for interface testing
 Commonly used functions:
1. Create test and production environments and add corresponding environment variables, such as baseUrl,
2. Create an interface set, which adds the interface of the project
3. Add an interface, you can initiate get/post/delete/put wait for request
4. Get Request query parameters put in Params middle, post put request parameters Body , which can be a common key-value pair, json/html/xml/file, request headers are put into Headers in
5. Pre-request Script Preprocessing script, which will be called before making a network request js code, you can get some dynamic parameters in it, such as timestamp, random number, etc.
6. Tests The script, which is called after the initiating network successfully gets the response, can add an assertion to determine whether the response data is correct
7. Mock Test, simulate the server to return the test data you want
8. Parameterization: environment variables, global variables, csv document

Parameterized -- no need to remember

1.write a csv/txt document, put test data in
2.Create an interface set and write the interface in it
3.The parameters passed by the interface cannot be hard-coded, use the associated method ({{key}}),key should be csv file header name
4.Double-click the interface set, click on the upper right corner run,Open Runner
5.Configuration parameters
	Iterations(The number of iterations, there are several test data, just write a few)
	Delay: Delay the corresponding event to initiate the request
	data: choose csv document
	Data file type:  Choose the type of file ( text/csv)
6.Click to run

3.2 What if there is no interface documentation? *

1.You can find classes for front-end development about interfaces
2.Capture packets

3.3 What is included in the interface case? **

Use case title, priority, module, resource path, request parameters, request method, test data, expected result (should have result), actual result

3.4 How to test interfaces with dependencies/associations *****

for example B The request parameters of the interface are A interface response data
 we need to request A interface, after getting the data, extract the required data and put it in B interface to request

For specific implementation, you can use those tools we commonly use, such as postman,Jmeter,python Script will do
1.postman: ask A interface, in Tests write in script js Code, extract the desired data after parsing the data, and save it as a global/environment variables, in B When the interface is requested, it is associated with ({{id}})
2.Jmeter: ask A interface, give A Add post processor to interface--The regular extractor, in a regular way, extracts the data into user variables, in B The associated use in the interface ( ${id})
3.python: use requests ask A The interface, after getting the response, parses it into json,Then take out the desired data and do B Interface request, just insert the extracted parameters

3.5 Process of Interface Test ***

1.Find the backend to get the interface document
2.Write a test plan
3.Analysis interface (business relationship between interfaces, data associated with the interface, request parameters, request headers(token,os,Version),response data (data format, fields, error analysis))
4.Write use cases, review use cases
5.Execute use cases to test; automation: write scripts according to use cases ( requests+pytest/unittest),Manual: postman/jmeter test
6.Result analysis
7.bug submit
8.Regression test after fix

3.6 What to measure/concern/verify/test points for interface testing ***

automated test

Python and Automation Basics

1. Do you know what are the mutable and immutable data types in Python? **

mutable data types have lists(list),gather(set),dictionary(dict)
Immutable data types have numbers(number),string(str),Yuanzu(tuple),Immutable collections(frozenset)

2. What are the three elements of object orientation and their significance? ****

Object-oriented is relative to process-oriented, process-oriented is that everything has to be done by yourself, Object-oriented is to organize related data and methods as a whole. To complete the task, you only need to find objects with related functions.
Our whole world is an object-oriented world,Like I want to tell you something,I don't need to run all the way to tell you in person,just by phone/WeChat can,Telephone/WeChat is the object with the call function,I just need to know how to use it,No need to know how it works

Object-oriented three elements are: encapsulation, inheritance, polymorphism
 Encapsulation: Encapsulate common properties and methods under the same class, and only provide externally accessible interfaces,Do not provide implementation details
 Inheritance: The subclass inherits the parent class and can have the existing non-private properties and methods of the parent class to solve code reuse
 Polymorphism: The premise of polymorphism is inheritance, It means that the same method of the base class has different functions in different derived classes,For example, cats and dogs both inherit the animal class,But cats like to eat fish,dog loves bones,polymorphism

3. List the magic methods of Python *

main magic method
__new__: The constructor of the class, which creates the initialized basic instance object, which is equivalent to the skeleton child of the class
__init__: The data initialization method of the class is used to add properties to the instance object.
__del__: parser(This is C/C++the name),It is specially used to call before the instance is destroyed to release resources.
__call__: The instance object can be directly declared as a method call, which is convenient for the calling process and protects the internal implementation

Related property acquisition method
__getattr__: When getting an attribute, such as for a dictionary key Get the value or get the index of the list
__setattr__: When setting an attribute, such as setting the value corresponding to an index, or the dictionary corresponding key Of value update creation

comparison operator
__lt__,__le__: less than judgment, less than or equal to
__eq__,__ne__: This method is used when it is equal to or not equal to judgment.
__gt__,__ge__: Greater than judgment, greater than or equal judgment

4. List, tuple, dictionary difference ***

python 3 built-in data structures in:Lists, tuples and dictionaries
 List:[]Represents a mutable data type, that is, this type can be changed, and lists can be nested
 Tuples: () means that tuples are immutable and can be nested
 dictionary:{}Represents, stores key-value pairs, the key is required to be unique, the key in the dictionary/Value pairs are not ordered

5. How to use unittest

1.write a py file, import unittest
2.Write a class, inherit unittest.TestCase
3.copy setup(prepare the test environment), teardown(restore the test environment), write test The method at the beginning, which can verify some logic through assertion
4.another py file, using the test suite ( TestSuite),Add the use case you want to execute
5.use TextTestRunner/HtmlTestRunner,Run the test suite

6. How to guide the package

1.It is recommended to use absolute paths to import, rather than relative paths, when conditions permit.
	For example, there are two packages, w/a/c.py,exist f There is a package g.py,want to be in g.py used in c.py,Can pack like this import w.a.c or from w.a import c
2.modules of the system, like time,os,There are also modules downloaded by yourself, such as requests,exist sys.path(sys.path Yes python There is a path in the path set of the search module), so you can directly import
3.If you want to put in another module py file into the current project, you can add the path of another module to sys.path , and then import the package, for example, in C:\\tool\\myTool\\calc.py,You can package like this
import sys
sys.path.append("C:\\tool\\myTool\\")
import calc

7. Eight Positions ***

id: 
className: 
name: 
tagName: 
xpath: 
css Selector:
link_text:
partial_link_text:

in use api Yes
find_element(by,value)

8. Commonly used selenium api methods and functions*

FixFox/Chrome(): Get browser driver
get(): request a URL
find_element():find element
send_keys():Enter content into the textbox
click(): click
move_to_element()(ActionsChain method in): Move the mouse over the element
driver.execute_script('window.scrollTo(0,0)'):implement js code (This is swipe to the top)
element.get_attribute(property key): Get the value of the property
quite(): Exit the browser
close(): close the current window
switch_to.frame():toggle frame
switch_to.window:toggle window
clear():Clear input box content
text:get text

9. How does selenium switch window/frame/warning box

Get the handle of the current window: handles = driver.window_handlers
 Switch windows: driver.switch_to.window(handles[n])
toggle frame: driver.switch_to.frame(value)
toggle alert: driver.switch_to.alert

10. Commonly used python modules*

Unit test module: unittest,pytest
ui Automation module: selenium,appium
 time module: time
 Mathematical calculation module: math
 Execute the system command module: os
 Random number module: random
mysql database: pymsql
string Module: str
 network request:requests

11. Three ways the browser waits*

Fixed waiting: time.sleep(seconds)
Show waiting: WebDriverWait()
Implicit wait: driver.implicitly_wait()

12. What is the po model and its advantages

PageObject,Encapsulate the element positioning and element behavior of the page into one basepage class, other page inherit basepage,One page corresponds to one class
PageObject The core idea of ​​the design pattern is: test object (page) and test case (page operation+test data) separation; call the behavior in the desired page object to form a test case. In the use case, element positioning and element manipulation are invisible.
advantage:
1. PO Provides a pattern in which business processes are separated from page element operations, which makes testing code much cleaner
2. Page objects are separated from use cases, allowing us to better reuse objects
3. Reusable page method code will become more optimized
4. A more efficient command method allows us to know more clearly what the method operates UI element

13. Core elements of the PO model

1. exist PO Extract and encapsulate one in the mode BasePage class, the base class should have a webdriver instance properties
2. Every page both inherit BasePage,pass driver to manage this page middle element, will page The operations in the package are encapsulated into methods
3. TestCase inherit unittest.Testcase class, and depends on page class to implement the corresponding test steps

14.pymysql **

import pymysql
# Connect to the database
con =pymysql.connect(host="127.0.0.1",
                user="root",
                password="123456",
                database="h2106",
                port=3306)
# Get the cursor, the query result is a list nested dictionary
cursor = con.cursor(cursor=pymysql.cursors.DictCursor)
sql = "select * from stu;"
# execute sql statement
cursor.execute(sql)
# get the result
data = cursor.fetchall()
print(data)

# close cursor
cursor.close()
# close the database
con.close()


1.How to connect to the database
	connect()
2.Parameters required to connect to the database
	host(host ip),port(The port number),user(username),password(password),database(data storage name)
3.implement sql statement
	cursor.execute(sql statement)
4.get data
	cursor.fetchall()

ADB

1. Say something about adb**

adb yes Android debug bridge(Android Debug Bridge), yes sdk Provide a tool that can operate management app+equipment

view phone cpu Happening: adb shell dumpsys cpuinfo
 App memory usage: adb shell dumpsys meminfo +Package names
 View battery status:adb shell dumpsys battery

install software: adb install -r  (APK path)
Uninstall the software: adb uninstall Package names
 Output phone logs to a local file: adb logcat -v time process > C:/log/aa.txt
 Start the service: adb start-server
 Shut down the service: adb kill-server

View equipment: adb devices
 Transfer computer files to mobile terminal: adb push Computer path Mobile path
adb push C:\log\aa.txt /storage/emulated/0
 Transfer files from mobile to computer: adb pull Mobile path Computer path
adb pull /storage/emulated/0/Boya East Lake.mp4 C:\log\bo.mp4
 List all the phones installed app the package name: adb shell pm list packages
 Clear app cache information:adb shell pm clear [packagename]

2.monkey test (why called monkey) ***

monkey yes adb A subcommand under the Android Random touch events are generated on the phone screen, which can Android app stress test

adb shell monkey -p Package names -s 6009 --throttle(Zeno pottery) 300 --ignore(one-piece doll)-crashes(Kono died in the sun) --ignore-timeouts(Too buy to die) --pct-touch(Tao eat) 90 -v 300000 >C:\log\log.txt

-p Package names      ----******
-s 6009: Specify the seed, the value is the same, and the sequence of events generated is also the same  ----******
--throttle <millisecond> :  Specifies the interval between user actions (ie events)   ----******
--ignore-crashes: ignore crashes   -----*****
--ignore-timeouts: ignoring the timeout, ( ANR)   -----*****
--pct-touch Set click event percentage  -----*****
--pct-motion Set swipe event percentage  -----*****
-v,-v-v,-v-v-v: log verbosity
300000:  The number of events generated (usually 10 w+times)
>C:\log\log.txt :  location of log output


Time: 3-5H
 When you get off work at night, run it, wait until the end of work in the morning, analyze

Test result processing:
1.save the log to the computer
2.Find exception information			    				        
	a.XXXException(NUllPointerException,
		ArrayIndexOutOfBoundsException,FileNotFoundException...)
	b.ForceClosed(program force close) (ctrl+f search'Fatal')
	c.ApplicationNot Response(Application not responding)(search anr)
	d.out of memory (memory overflow)
	
3.Arrange the abnormal information found and send it to the development (the abnormal line and the following 10 lines)

Interface automation

1. Talk about how your interface automation is done

1.Find the backend to get the interface document
2.Analysis interface (business relationship between interfaces, data associated with the interface, request parameters, request headers(token,os,Version),response data (data format, fields, error analysis))
3.Write interface test cases
4.put test data in csv document
5.exist unittest Of testcase class (write a class, inherit unittest.TestCase),Write test The way to start, put csv Read test data into requests Make a network request, and then assert the obtained response data, or use pymysql Connect to the database to query data and compare
6.in another py used in the file TestSuite transfer TestCase method in the HtmlTestRunner Generate test report
7.Email the report to yourself and leaders

2. Details of automation ***

response = request.get()/post()
# 1. Response code
response.status_code
# 2. Response json data
response.json()
# 3. Convert json in string format to json/dictionary
json = eval(string)
# 4. Convert json/dictionary to string
str1 = str(dictionary/json)

UI automation

1. Introduce what functions you have automated in the project and how to do it

	If we do automation, we generally need to select relatively fixed functions, such as search, login, registration, etc. These functions always exist when we iterate, so choose these functions.
	To put it bluntly, automation is to convert all the steps of manual testing into code, and the corresponding operation is completed by the code, for example, people can see the button through the eyes/The position of the input box, the code does not work, you need to find the button by element positioning/The input box, the code has no hand, and the click has to pass click The method is completed, and there are other input contents such as input boxes, which need to be called send_keys()
	my script uses PO The model separates element operations from business, and element operations are encapsulated into BasePage,Specific business is written into specific business class, such as SearchPage,LoginPage,LocatePage,verification is passed unittest verified
	
	(The following is an example,Take your own project business as an example)
	Tell me about the search function I wrote (take the short book as an example), configure the browser and url After the information, the script will help us start the corresponding browser, chrome or Firefox, etc.
	After entering the main page, pass id Navigate to the search input box (you can xpath position, id position, class position...),transfer send_keys()Enter what you want to search for,
	pass xpath Locate the search button, the code calls the click click()method, the result will be displayed in a new window
	adopt driver.switch_to.window(handles[n])switch windows,
	The upper part of the search result is the user, and the lower part is the article. We need to verify that the user and article match our search keywords.
	Authenticating users is easy, by class Get the elements of all users, and then get the username (element.text),Then use an assertion to determine whether the username contains the search keyword
	To verify the article, we need to verify the author, title, and content of the article. As long as one of the three contains keywords, the result is correct. Similarly, we obtain the text of the author, title, and article content, and assert to determine whether the text contains search Keywords (how to judge, find)	

git

git and svn Both are tools for project version control, Can track changes in each file of the project
svn is a centralized version control tool,git is distributed

User configuration
git config --global user.name "username"
git config --global user.email "Mail"

Initialize warehouse
git init 
clone the repository
git clone Warehouse Address

add all files
git add --all
 Commit from staging area -m: Notes
git commit -m 'Comment content'
Pull remote content
git pull 
Push local history to remote
git push 

create a branch
git branch branch name
 delete a branch
git branch -d branch name
 switch branch
git checkout branch name
 merge branch
git merge

Roll back the current branch to a certain version in history
git reset   
View commit history
git log
 status tracking
git status

.gitignore ignore files: Files that do not want to be tracked can be configured here

Tags: Python Linux unit testing

Posted by Capnstank on Fri, 16 Sep 2022 21:56:24 +0300