Testing basics + performance testing + automated testing interview questions (including answers)

Table of contents

Test basics

1. How to carry out testing without requirement documents

2. How to improve the coverage of use cases and reduce missed tests

3. After entering a url in the browser, what is the request process like?

Fourth, let’s talk about some common HTTP request header fields

5. What elements are included in the test case?

6. What is the life cycle of a bug?

7. Write about the project testing process

8. During the project testing process, what types of bugs have you tested? Where are bugs most likely to occur?

9. How does fiddler work? What scenarios are mainly used in the project testing process?

10. How to view the error log of an APP?

11. Xiao Ming posted a comment while browsing Douyin, but the APP interface did not display it. How to troubleshoot this problem?

Scenario questions

1. If an interface cannot be debugged, how to troubleshoot the cause?

2. What should I do if a bug occurs after going online?

3. Have you ever experienced online bugs caused by missing tests? Under what circumstances will a missed test occur?

4. If you are solely responsible for a project, what should you pay attention to?

5. How to maintain effective communication with developers at work?

LINUX

1. Set the /home/demo.txt file to be readable and writable by everyone.

2. Search the a.log file for logs containing Exception and the following 10 lines.

3. Check whether the mysql process is started successfully

4. Search for the storage directory of mysql.log in the /home directory.

5. There is a file a.log on the Linux server, which records the user’s access log.

Use one name to count the top 3 users with the highest access frequency

6. How to check whether port 3306 is occupied?

7. How to view yesterday’s operation log of user zhangsan in a.log

8. What is the command to turn off the firewall?

9. How to count the number of Exceptions in a.log

10. Commonly used Linux commands

SQL questions

1. List the department numbers and the number of people in the department whose total number of people is greater than 4

2. List the employee numbers and names of the development department and the testing department

3. Display the employee numbers and names of the top 3 employees with the highest wages

4. List the names of all employees whose salary is between 1000-2000

5. There is the following data in the T table. Write a SQL to delete the data with duplicate names in the table.

automation

1. Let’s talk about commonly used interface automation tools/frameworks

2. How to improve the stability of automated scripts

3. How to assemble cases in pytest

4. If an element cannot be positioned, what reasons would you generally consider?

performance

1. What are the common indicators in performance testing?

2. TPS is relatively low. What may be the reason?

3. How to ensure the stability of automated testing

4. TPS cannot be pressed during the pressure test. What are the possible reasons?

5. How to design performance test scenarios

6. What is the analysis idea of ​​high CPU of application server and high CPU of database server?

interface

1. Why do we need to do interface testing?

2. What are the focuses of interface testing?

3. What is the difference between get and post?

4. What is the difference between interface testing and web page testing?


Test basics

1. How to carry out testing without requirements document

1. The absence of a requirements document does not mean there is no requirement.
2. You can communicate with relevant personnel to obtain requirements, such as product managers and developers.
3. You can refer to competing products in the same industry to summarize and sort out your needs.
4. Some functional requirements can be summarized based on users’ usage habits and some industry specifications.

2. How to improve the coverage of use cases and reduce missed tests

1. Use cases should be written according to the requirements documents to ensure that each requirement is covered by the corresponding use cases
2. Fully understand the business, discover hidden needs, and write corresponding use cases
3. In addition to normal business scenarios, consider some abnormal scenarios and data
4. It is necessary to test the software from multiple dimensions, considering functions, performance, security and other aspects
5. Think about problems from the user's point of view and simulate the user's usage scenarios
6. Organize use case reviews

3. After entering a url in the browser, what is the request process like?

1. DNS domain name resolution
2. Establish a TCP connection with the server
3. Initiate HTTP request and send data
4. The server responds to the HTTP request and returns data
5. Browser parses data and renders
6. Close the connection

Fourth, let’s talk about some common HTTP request header fields

5. What elements are included in the test cases?

Use case number, module to which it belongs, use case title, preconditions, operation steps, priority, expected results, etc.

6. What is the life cycle of a bug?

1.New: Submit a new bug and assign it to a developer for modification.
2. Open: Confirm the bug, think it needs to be modified, and assign it to the corresponding developer.
3.Fixed: After the developer makes modifications, it is marked as fixed and needs to be verified by the tester's regression test.
4.Rejected: If it is not considered a bug, the modification will be refused.
5.Closed: If the modified status of the bug is verified by the tester's regression test, the bug will be closed.
6.Reopen: If the verified bug still exists, the bug needs to be reopened and the developer can modify it again .

7. Write down the project testing process

Requirements review, test plan, technical review, use case writing, use case review, test execution, test report, online verification
Certificate, project summary

8. What types of bugs have you detected during project testing? Where are bugs most likely to occur?

Types of bugs: Mainly code logic errors and configuration errors
Where bugs are prone to occur: parameter verification, boundary conditions, complex logic, and some abnormal scenarios are not considered
comprehensive

9. How does fiddler work? In what scenarios is it mainly used during project testing?

Working principle: fiddler mainly acts as a proxy between the client and the server. After starting fiddler,
All requests and responses will go through fiddler.
Application scenarios:
1> Determine front-end and back-end bugs
2> Capture packets for data analysis
3> Request breakpoints, mainly to test whether the server verifies illegal data submitted by the client, such as the number of tickets purchased
The amount is 0, invalid activity time, etc.
4> Response breakpoint,
Request breakpoint: It is mainly used to test whether the server verifies the illegal data submitted by the client. For example, the number of tickets purchased is
0, invalid activity time, etc.
Response breakpoint: Mainly tests the client's handling method after the server returns abnormal data, for example, the server returns 500,
Or some other abnormal business data
5> Weak network test, you can modify the network delay time built into fiddler, the default is 300ms for upload and 150ms for download.
The larger these two values ​​are, the lower the network rate is.

10. How to view the error log of an APP?

a. View the package name of the APP
b. Check the APP process number through registration
c. Filter the error logs in adb logcat by process number

11. Xiao Ming posted a comment while browsing Douyin, but the APP interface did not display it. How to troubleshoot this problem?

1. Check whether there is any problem with the client network. You can also check whether other APPs can be used normally.
2. Check whether it is a version problem, you can change the operating system (Android, ios), or try another software version
3. Check whether it is a compatibility issue. You can try another mobile phone.
4. Packet capture analysis, if the APP does not send a request to the server, or if the request parameters are correct, it is a problem with the APP
Question; if the server response data is incorrect, it is a problem on the server side.

Scenario questions

1. An interface cannot be adjusted, how to troubleshoot the cause?

The request fails. The possible reasons are:
- The ip or port number or url is wrong
- The network between client and server is not connected
- The server-side project has not been deployed at all
- The server's firewall blocked it
- An error occurred within the server program
- No access rights (such as lack of token, cookie, etc.)
- The client has a network proxy set up
- If it is a browser access, is it bound wrong?

2. What should I do if a bug occurs after going online?

Based on some previous experience, we first work with the development team to initially assess the severity and cause of the bug.
If there is a functional problem with a relatively large impact, and it is difficult to locate the specific cause for the time being, the first consideration is to do code recovery.
Roll and revert to the last stable version. Then retest in the test environment and locate the cause of the problem.
If the cause of the problem can be quickly located, the development team will make emergency repairs and apply for emergency online after passing the test.
If it is a performance problem, we will usually expand the capacity or restart to try to solve it, and then the development will further determine the problem.
bit sum optimization.
If the problem is not too serious, it will usually be solved in the next version.
Finally, after the online bug is resolved, review the problem, record the entire process and conduct relevant analysis and summary to avoid future problems.
Similar problems continue to occur.

3. Have you ever experienced online bugs caused by missing tests? Under what circumstances will a missed test occur?

Basically, in my testing, there have been no P0 and P1 level BUGs.
Occasionally there are some small problems, the main reason is
Because it's all about compatibility. Especially Android phones are too fragmented.
Then I will mainly talk about the common reasons for missed testing bugs.
⚫Unclear requirement specifications lead to too rough writing of test cases.
⚫Requirement specifications changed and test cases were not updated in time
⚫Test case coverage is not comprehensive and scenarios are omitted
⚫Failure to strictly follow the test cases during the testing process
⚫Insufficient testing time resulted in some functional points being ignored during the testing process
⚫The test environment or test data is limited, resulting in missed defects
⚫New bugs introduced when developers fix other bugs

4. If you are solely responsible for a project, what should you pay attention to ?

1. Evaluate the test scope and test cycle of the project and whether it can be completed alone.

2. Make good testing strategies and plans, and try to ensure that each link is completed on time

3. If you cannot solve the problem by yourself, you should promptly throw it out, expose the risk, and seek help.

4. Try to use some technical means to improve testing efficiency

5. Set priorities for use cases and execute them according to priorities.

6. Track bugs in a timely manner and promote development to solve bugs as soon as possible

7. Control the launch standards and indicate launch risks in the test report

5. How to maintain effective communication with developers at work?

1. Discuss the matter as it stands, don’t carry any emotions when communicating with developers, and communicate objectively and truthfully
2. Don’t rely too much on development. When you encounter problems, try to analyze them first. After you have a basic judgment, go to the development
3. The description of the problem should be concise and clear, such as what you are doing now, what problems you have encountered, and what needs to be provided by development
help
4. Testing must have its own principles and positions. What you think is the right thing must be firm and self-judgmental. It cannot be completed.
Quan Tingxin Development
5. Communicate issues in a centralized manner as much as possible to avoid fragmented communication, which may lead to frequent interruptions in development work.
6. Improve your technical ability and cognition, and use more professional language to communicate with development
7. When encountering developments that are very difficult to communicate with, if necessary, provide timely feedback and seek help.


LINUX

1. Set the /home/demo.txt file to be readable and writable by everyone.

chmod 666 /home/demo.txt

2. Search the a.log file for logs containing Exception and the following 10 lines.

grep -A 10 “Exception” a.log

3. Check whether the mysql process starts successfully

ps -ef | grep mysql

4. Search for the storage directory of mysql.log in the /home directory.

find /home -name mysql.log

5. There is a file a.log on the Linux server, which records the user’s access log.

Use one name to count the top 3 users with the highest access frequency

2022-07-04 11:11:11 zhangsan /index.html 192.168.2.2
2022-07-04 12:11:12 lisi /login 192.168.2.2
2022-07-05 16:11:13 zhangsan /shop/buy 192.168.2.2
2022-07-06 09:11:18 jack /cart/go 192.168.2.2
答案:awk ‘{print $3}’ a.log | sort | unic -c | sort -rn | head -3

6. How to check whether port 3306 is occupied

netstat -anp | Grip 3306
or
lsof -i 3306

7. How to view yesterday’s operation log of user zhangsan in a.log

grep 'zhangsan' a.log | grep 'yesterday's date'

8. What is the command to turn off the firewall?

systemctl stop firewalld

9. How to count the number of Exceptions in a.log

grep ‘Exception’ a.log | wc -l

10. Commonly used Linux commands

pwd shows working path

shutdown -h now Shut down the system /halt Shut down the system

shutdown -r now restart / reboot restart

systemctl stop firewalld Turn off the firewall

ip addr view ip address

SQL questions

Department table departments (dept_id, dept_name)
Employee table employees (emp_id, emp_name, sex, dept_id, jobs)
Salary table salary (salary_id, emp_id, money)

1. List the department numbers with a total headcount greater than 4 and the number of people in the department

select dept_id, count(*) from employees e group by dept_id having count(*)>4

2. List the employee numbers and names of the development department and the testing department

select e.emp_id,d.emp_name
from employees e inner join department d on e.dept_id = d.dept_id
where d.dept_name in ('Development Department', 'Testing Department')

3. Display the employee numbers and names of the top 3 employees with the highest salary

select e.emp_id, e.emp_name,s.money
from salary s inner join employees e on s.emp_id = e.emp_id
order by s.money desc
limit 3

4. List the names of all employees whose salary is between 1000-2000

select e.empname,s.salary

from salary s

inner join employees e on s.empid = e.empid
where s.salary between 1000 and 2000

5. There is the following data in the T table. Write a SQL to delete the data with duplicate names in the table.

| id | name | age | city |
1, Zhang San, 18, Beijing
2, Li Si, 35, Shanghai
3, Zhang San, 20, Nanjing
4, Wang Wu, 31, Tianjin
答案:delete from T where id not in ( select max(id) from T group by name)

automation

1. Let’s talk about commonly used interface automation tools/frameworks

Jmeter、Postman
Requests、pytest、unitest、HTTPClient、testNG、Junit

2. How to improve the stability of automated scripts

a. Avoid using fixed data. Old test data used in test cases may be modified or deleted by others.
So every time before running the script, new data is constructed in the script, and after running the script, the data is cleared.
b. Reduce the coupling between use cases. Try to follow a complete process for each use case. Do not rely on other use cases to avoid
This prevents other use cases from failing and affecting subsequent use cases.
c. Improve the stability of dependent environments. Usually some use cases will rely on the environment of third-party systems. If the third-party environment
Instability will cause instability in the execution of use cases. You can use mocks to shield third-party environments and improve
Improve environmental stability.
d. For exception handling in scripts, consider more possible exceptions in the script and try to have a corresponding response for each exception.
Processing method to avoid program exit after failure

3. How to assemble cases in pytest

1) By default, the file name named test_.py or **test.py is checked, and the file starting with test is searched inside the file
method or function and execute
2) You can use a custom marker (decorator). For example, when pytest is running, it will only run the marker with this marker.
test cases
3) In the pytest.ini configuration file, you can handle the cases when pytest is executed, such as executing a certain target.
Recorded use cases, executing a script file, etc.

4. If an element cannot be positioned, what reasons would you generally consider?

1) Wrong locator selection
2) Positioning string error
3) Elements are nested in frames
4) Page elements are not loaded in time
5) Element in new window
6) The script process does not match the actual situation
7) The element is not on the current page

performance

1. What are the common indicators in performance testing?

a) tps: Transactions per second, which represents the system’s processing capabilities. The higher the tps, the better the performance.
b) Response time: the time it takes from sending a request to receiving the system response data, the shorter the response time, the better the performance
the better
c) Throughput: the sum of network uplink and downlink traffic, throughput is an important indicator of network bottleneck positioning
d) Error rate: the proportion of errors in the system during the stress test
e) Operating system: CPU, memory, network, disk

2. TPS is relatively low. What may be the reason?

a) The performance bottleneck of the press itself
b) Network IO bottleneck
c) Middleware (tomcat/nginx/mysql) connection limit
b) Application: memory, thread blocking, waiting
e) Database performance issues
f) Bottlenecks of this system’s resources (cpu, memory, disk, network, etc.)
g) The response time of other external systems is too long, causing the time-wait of this system

3. How to ensure the stability of automated testing

1. Avoid using fixed data. Old test data used in test cases may be modified or deleted by others. so
Before each script is run, new data is constructed in the script, and after the script is finished, the data is cleared.
2. Reduce the coupling between use cases. Try to follow a complete process for each use case. Do not rely on other use cases to avoid them.
The execution of other use cases failed, affecting subsequent use cases.
3. Improve the stability of dependent environments. Usually some use cases rely on the environment of third-party systems. If the third-party environment is unstable,
If it is not fixed, it will cause instability in the execution of the use case. You can use mocks to shield third-party environments and improve environmental stability.
Qualitative.
4. For exception handling in scripts, consider more possible exceptions in the script and try to handle each exception accordingly.
Method to avoid program exit after failure

4. TPS cannot be pressed during the pressure test. What are the possible reasons?

a) The performance bottleneck of the press itself
b) Network IO bottleneck
c) Middleware (tomcat/nginx/mysql) connection limit
b) Thread blocking and waiting
e) Database performance issues
f) Bottlenecks of the system resources (cpu, memory, disk, network, etc.)
g) The response time of other external systems is too long, causing the time-wait of this system

5. How to design performance test scenarios

General basic scenarios include: benchmark testing, single transaction testing, mixed testing, and stability testing.
For the benchmark test, use 1 user or the number of benchmark users to run a single scenario test for several minutes. When the number of concurrent users gradually increases to the estimated value, run for 10 minutes.
Mixed scenario test, with multiple transaction settings and different proportions of concurrent users, ran for 30 minutes.
For stability testing, select the hybrid test to support 80% of the maximum number of concurrent users and run for 12 hours.

6. What is the analysis idea of ​​high CPU of application server and high CPU of database server?

1) If the CPU of the application server is high, first check the TPS and response time. If the TPS is relatively high, we think it is a normal CPU.
Consumption; if tps is relatively low, then some codes often consume too much CPU. You can consider using code analysis tools.
Analyze
2) The high cpu of the database server is often due to the low execution efficiency of sql statements, which can be slowed down by querying the database
It is monitoring, combined with the execution plan to analyze whether the relevant table has no index or the index has not taken effect.

interface

1. Why do we need to do interface testing?

A. In a company, the client and server are usually developed by different teams. During the project development process, the client
The progress of the development of the server and the server is inconsistent. For example, the development of the server is completed first. At this time, the server can be developed first.
Interface testing to ensure that the server-side logic and return data are correct, and then test the client. other testing department
The door is dedicated to testing the server-side development team, so their test object is the interface.
B. When testing certain services, you cannot just test through the front end, such as user registration, the front end limits the user name.
It cannot be empty, but some people may use tools to bypass the front-end and directly call the server interface. If the server does not
Relevant logical judgments will cause data errors. Including whether key information is encrypted during interface data transmission.
Therefore, the server interface must be tested separately.
C、
After development and testing, you can first run the server-side interface test through tools to ensure that the interface test cases are all
Yes, quickly judge whether the server interface meets expectations. Then test it through the UI interface. Otherwise accept
If there are bugs in the interface, there must be bugs in the front-end page.

2. What are the focus points of interface testing?

1) Input parameters, including parameter legality, parameter verification, parameter boundary, parameter is empty, missing parameters, etc.
2) The return value, including whether the response content in various cases is normal
3) Whether the interface business logic and functions are normal
4) Database verification
5) Performance testing (interface tps, response time, etc.)
6) Security, encryption of sensitive information, authority control, etc.
7) Idempotence

3. What is the difference between get and post?

1) The parameters of the get request are placed in the url, and the parameters of the post request are in the request body. 2) The get request can be cached by the browser, but the post request cannot be cached.
3) The get request parameters are placed in the url. The length of the url is limited, but the length of the post interface is not limited.
4) The get request parameters are placed in the url, which is less secure; the post request parameters are placed in the body, which is less secure.
Better to
5) The get request can be accessed directly through the browser, and refresh and back are supported. Post requests cannot use browsing directly.
After accessing the server, the data must be resent after refreshing.

4. What is the difference between interface testing and web page testing?

1) Web page testing is performed through interface operations, and different data is entered to test different scenarios.
2) Interface testing is to use tools to directly send HTTP requests to the server for testing, and enter different parameters to test different
scene.
3) Usually web pages will restrict certain input data, such as required fields, data format, etc. Interface testing is possible
By entering any data, you can test more abnormal data scenarios.
4) Web testing needs to consider browser compatibility, interface testing does not
5) For web testing, it is necessary to develop the front end and the server end before testing. The interface test only needs to be started on the server end.
After the release is completed, you can start testing

Guess you like

Origin blog.csdn.net/weixin_60870637/article/details/126975290