Software testing frequently asked questions and answers

1. Self-introduction

It varies from person to person, and introduce clearly personal work experience, project responsibility and personal hobbies, etc.

2. Software life cycle

Definition: The life cycle of software from creation to retirement.

The life cycle includes: problem definition and planning (discussion between the developer and the demand side), requirements analysis, software design, software coding, software testing (unit testing, integration testing, system testing, acceptance testing), and operation and maintenance phases. (industry concept)

3. Test process

First of all, do requirements review, participate in the project requirements review, ask questions during the project requirements review stage, carry out rectification, and conduct re-evaluation after the rectification is completed. After the re-evaluation, finalize the draft, combine the project plan, combine the implementation content, formulate and complete the test plan, and define the work content of the test. After the formulation is completed, write the test case according to the demand draft. Triage to assess whether the use case coverage is comprehensive. Smoke test is carried out during development and testing. After the smoke test is passed, system testing is carried out according to the written use cases, including but not limited to regression testing, bug acceptance testing, and scenario testing. Finally output the test report.

4. Interface use case design

  1. Whether the prerequisites are met

    Some APIs need to meet preconditions to successfully obtain data. Commonly, a login token is required.

    Reverse use case: Design 0n use cases for whether the preconditions are met (assumed to be n conditions)

  2. Whether to carry the default value parameter

    Forward use case: do not fill in or pass parameters with default values, fill in the correct and existing "regular" values ​​for the required parameters, and design 1 use case if you do not fill in the others;

  3. business rules, functional requirements

    Here, according to the actual situation, combined with the interface parameter description, it may be necessary to design n forward use cases and reverse use cases

  4. Is the parameter required?

    Reverse use case: For each required parameter, design a reverse use case with an empty parameter value

  5. Whether there is a relationship between the parameters

    Some parameters have a mutual restrictive relationship with each other

    Reverse use case: According to the actual situation, it may be necessary to design 0n use cases

  6. Parameter data type restrictions

    Reverse use case: design a reverse use case for each parameter that does not match the parameter value type

  7. The data range value limit of the parameter data type itself

    Forward use case:

    For all parameters, design a positive use case where the parameter value of each parameter is the maximum value within the data range

    Reverse use case:

    For each parameter (assuming n), design n reverse use cases where the parameter value of each parameter exceeds the maximum value of the data range

    For each parameter (assuming n), design n reverse use cases where the parameter value of each parameter is less than the minimum value of the data range

    If the above aspects are taken into consideration, the following aspects can basically be covered:

    Main process test case: normal main process function verification;

    Branch flow test case: normal branch flow function verification.

    Abnormal Flow Test Case: Abnormal Fault Tolerance Check

8. How to test the interface

1. First consider the normal call of the interface. According to the definition of the interface, pass the correct interface information, including address, method, and parameters, and then check whether the returned data is correct and whether the database data is correct. The transmitted request data needs to be overwritten and valid The response results returned by class and boundary value need to be checked, such as code, msg, status and other information to verify data storage, such as the verification of the database in the addition, deletion, modification and query business. Values, such as null values, length type exceptions, etc., whether the interface can be processed correctly, and whether the returned result can be correctly processed Considering business constraints, input wrong parameter names, one more or one less 3. Pay attention to the security test of the interface Inscription data, whether the password is encrypted, whether the returned data contains sensitive information, whether the interface performs sensitive information comparison on the transmitted data 4. Pay attention to the performance test of the interface and concurrently request the same interface to check the request status of the interface. The response time of the interface, whether Pressure test the interface within the user's acceptable range to determine the largest bottleneck point

Five, bug life cycle

  • New (New)→ In Progress (Repairing)→ Fixed (Fixed)→ Closed (Close)

    | Acceptance failed

    Reopen (restart)→ In Progress (repair)→ Fixed (fixed)→ Closed (closed)

  • Cannot Reproduce : Cannot be reproduced- Pass : Cannot be repaired/no need- Delay : Postponed

    ————————————————————————— Bug Severity Level ————————————————————————— ———————

    P0:Block - cannot be tested, the product cannot be used, such as crash

    P1: Critical - important functions are not implemented, can be barely used, but the functions are severely limited

    P2: Major - the main function is not fully realized, which affects the progress of some processes, but does not affect the main process

    P3: Normal - general problems with small impact

    P4: Minor - subtle issues, generally optimization, suggestions

Six, continuous integration

1. Unified codebase

2. Automatic build

3. Automatic testing

4. Everyone submits code to the code base trunk every day

5. A build will be triggered on the continuous integration server after each code submission

6. Fast Builds Guaranteed

7. Automatic testing that simulates the production environment

8. Everyone can easily get the latest executable application

9. Everyone knows what's going on

10. Automated deployment

7. Develop a test plan

The test plan includes test objectives, test scope, test environment, description of test types, test tools, template division, relevant test leaders, test times, time arrangement, test-related risks, etc. The module division is mainly based on the tester's The degree of familiarity is divided, and the evaluation of workload needs to be evaluated based on previous testing experience and combined with this project.

8. Performance testing process

1. Analyze performance requirements, define complete performance indicators, and simultaneously design performance scenarios

2. Build a performance test environment

3. Implement test scripts based on scenarios

4. Prepare test data based on performance test

5. Execute the test and collect data

6. Performance diagnosis and analysis

7. Performance tuning (whoever has a problem to find), return to step 5-6

8. Output report

First check whether it is caused by insufficient local resources or the scene design. If there is no problem, whether the queue is caused by network transmission problems and whether the server has an MQ message queue. If so, it will not be a bandwidth problem.

Calculation:

QPS (TPS) = concurrent number/average response time or concurrent number = QPS average response time memory calculation formula Memtotal - Memfree - cached - buffers)/Memtotal   100 (=(B2-F2-K2-N2)/B2*100)

Open jmeter: cd /Users/dingyu/Documents/apache-jmeter-5.4.2/bin

Nine, Linux common commands

```Plain Text

  • alt+ctrl Exit to operate linux, you can operate windows
  • Switch directory command:
  • pwd view current directory
  • cd folder into a folder
  • cd .. Back up one level
  • cd - move back to the last directory
  • cd / push to the root directory
  • show file list
  • ls lists all information in the current directory
  • ls -a shows all files, including hidden files
  • ls -l show file details
  • ll short for ls -l
  • clear clear content
  • directory operations
  • mkdir aa bb folder name create directory
  • rmdir aa (remove directory) remove directory can remove multiple
  • Browse documents
  • enter cd /etc
  • cat filename to open the file to view all contents
  • more View the content, you can view it in pages
  • Combined with enter key, a little bit to see
  • If you press the space bar, page view
  • q exit view
  • less view content
  • enter + down arrow, view a little bit
  • q exit view
  • tail can choose what to see
  • tail -10 profile View the last 10 lines
  • end ctrl+c
  • file operation
  • touch xx.txt Create xx.txt file
  • rm xx.txt To delete a file, you need to ask, if you are sure to delete y to cancel n
  • rm -f xx.txt delete files without asking
  • rm -r aa remove recursively and ask
  • rm -rf aa remove recursively without asking
  • cp aa.txt bb.txt copy
  • You can specify the copied directory, such as cp aa.txt /usr/local/bb.txt
  • mv aa.txt cc.txt cut
  • * You can specify the cut directory such as mv aa.txt /usr/local/dd.txt
  • compression and decompression
  • The tar command is located in the /bin directory. It can pack the files or directories specified by the user into one file without compression. Generally, the common compression method on Linux is to use tar to pack many files into one file, and then compress them with gzip The command is compressed into a xxx.tar.gz (or xxx.tgz) file.
  • tar -c specifies compression into a file -v displays process information -f specifies file name tar -cvf xxx.tar ./* -z specifies gzip compression tar -zcvf iii.tar.gz ./* -x unpacks Ordinary decompression of tar files tar -xvd uuu.tar.gz Decompression specified path tar -xvf uuu.tar.gz -C /usr/local
  • vi and vim edit text
  • vim is an upgraded version of vi. vi can view files as well as edit files. Three modes: command line, insert, bottom line mode. Switch to command line mode: press Esc key; switch to insert mode: press i, o, a key; i inserts I before the current position, inserts a at the beginning of the current line, inserts A after the current position, inserts o at the end of the current line Insert a line after the line O Insert a line before the current line Exit editing: esc (escape key)
    Exit and save: :wq(shift+:) Exit without saving: :q! Shortcut key: dd in non-editing state delete a line/ search hot key
  • Redirect output ifconfig view ip

Redirect the output, overwriting the original content;

Redirect output and append function; example: cat b.txt > a.txt direct output to a.txt cat c.txt >> a.txt output and append ifconfig > ifconfig.txt ifconfig >> ifconfig.txt

  • grep search command grep hello aaa.txt normal search grep hello aaa.txt --color highlight search
  • ps -ef view current process
  • Pipeline symbol | Pipeline is an important concept in Linux commands. Its function is to use the output of one command as the input of another command. cat hello.txt |more ps -ef|grep bash ls --help | more page query help information ps -ef |grep 2251 search process number ifconfig | more cat index.html | more
  • && command execution control: Use && connection between commands to realize the function of logic and. Only when the command on the left of && returns true (command return value $? == 0), the command on the right of && will be executed. mkdir haha ​​&& cd haha
  • Network communication command ifconfig View ip information ping Check whether the server is pinged Netstat Check the network port netstat -an|grep 3306 Search the mysql port Check the port of the bash process Step 1: Find the process number of the bash process pid=ps -ef|grep bash
    Step 2: Find the port netstat -an|grep pid according to the process number

Notes for the second day of Linux

system command

  • date view date
  • date -s "1991-11-11 11:11:11" set the date
  • kill process number to kill the process
  • kill -9 process number to forcibly kill the process
  • du View the current file size
  • du -h optimization view
  • who Displays the user name currently logged into the system
  • whoa I'mmi show current user
  • hostname displays the current host name
  • vim /etc/sysconf/network modify host name
  • uname show system information file show
  • tail Display tail information
  • tail -10 install.log shows the last 10 lines of the file
  • tail -c 10 install.log displays the last 10 characters
  • head
  • head -10 install.log displays the first 10 lines of the file
  • head -c 10 install.log displays the first 10 letters of the file system monitoring
  • free memory
  • -b: Display memory usage in Byte; -k: Display memory usage in KB; -m: Display memory usage in MB; -s: Continuously observe memory usage; free -b free - k free -m free -s 10 free -s -m 10 display memory information every 10 seconds, and calculate total total memory size in m units free remaining used used size (required to be less than %70)
  • uptime memory and cpu uptime The uptime command can print the total running time of the system and the average load of the system. The information displayed by the uptime command is: the current time, how long the system has been running, how many users are currently logged in, and the average load of the system in the past 1 minute, 5 minutes, and 15 minutes. 15:31:30 //The current time of the system is up 127 days, 3:00 //The running time of the host, the longer the time, the more stable your machine is. 1 user //The number of user connections is the total number of connections rather than the number of users. load average: 0.00, 0.00, 0.00 // System average load, statistics of the system average load in the last 1, 5, and 15 minutes The system average load refers to a specific time The average number of processes in the run queue over the interval. If the number of currently active processes per CPU core is not greater than 3, then the performance of the system is good. If the number of tasks per CPU core is greater than 5, then there is a serious problem with the performance of this machine.
  • The top process can dynamically view the overall operation of the system in real time. It is a practical tool that integrates multi-information monitoring system performance and operation information. Through the interactive interface provided by the top command, it can be managed with hotkeys. Can analyze the cpu and memory size occupied by the application
  • mpstat View cpu detailed information mpstat mpstat is the abbreviation of MultiProcessor Statistics, which is a real-time system monitoring tool. Its report and some statistical information of the CPU can not only view the average status information of all CPUs, but also view the information of a specific CPU.
  • The df command displays disk space The df command is used to display the available disk space on a disk partition. The default display unit is KB. You can use this command to obtain information such as how much space the hard disk is occupied and how much space is left. System restart and shutdown commands
  • shutdown shut down
  • reboot reboot
  • halt shutdown command
  • Linux permission command Permission denied is commonly used 777 755 chmod 755 a.txt chmod u=rwx,g=rx,o=rx a.txt chmod 000 a.txt
  • firewall
  • Temporarily close the firewall service iptables stop
  • Temporarily open the firewall service iptables start
  • View firewall status service iptables status
  • Permanently turn off the firewall chkconfig iptables off
  • Permanently open the firewall chkconfig iptables on
  • Which one to use? Change the system file vi /etc/sysconfig/iptables and copy a line to specify the open port
  • Restart the firewall service iptables restart

10. Automated test request function

getMethod() 获得请求方式
getHeader()获取请求头信息
getRequestURI() 获得请求资源
getParameter()获得参数的值

Eleven, python common functions

```Plain Text
staticmethod() 函数返回函数的静态方法。该方法不强制要求传递参数
print()函数:打印字符串;
raw_input()函数:从用户键盘捕获字符;
len()函数:计算字符长度;
format()函数:实现格式化输出;
type()函数:查询对象的类型;
int()函数、float()函数、str()函数等:类型的转化函数;
id()函数:获取对象的内存地址;
help()函数:Python的帮助函数;
s.islower()函数:判断字符小写;
s.sppace()函数:判断是否为空格;
str.replace()函数:替换字符;
import()函数:引进库;
math.sin()函数:sin()函数;
math.pow()函数:计算次方函数;
os.getcwd()函数:获取当前工作目录;
listdir()函数:显示当前目录下的文件;
time.sleep()函数:停止一段时间;
random.randint()函数:产生随机数;
range()函数:返回一个列表,打印从1到100;
file.read()函数:读取文件返回字符串;
file.readlines()函数:读取文件返回列表;
file.readline()函数:读取一行文件并返回字符串;
split()函数:用什么来间隔字符串;
isalnum()函数:判断是否为有效数字或字符;
isalpha()函数:判断是否全为字符;
isdigit()函数:判断是否全为数字;
lower()函数:将数据改成小写;
upper()函数:将数据改成大写;
startswith(s)函数:判断字符串是否以s开始的;
endwith(s)函数:判断字符串是否以s结尾的;
file.write()函数:写入函数;
file.writeline()函数:写入文件;
abs()函数:得到某数的绝对值;
file.sort()函数:对书数据排序;
tuple()函数:创建一个元组;
find()函数:查找 返回的是索引;
dict()函数:创建字典;
clear()函数:清楚字典中的所有项;
copy()函数:复制一个字典,会修改所有的字典;
get()函数:查询字典中的元素。
```


12. Use of testNG annotations for automated testing

@BeforeSuite	在该套件的所有测试都运行在注释的方法之前,仅运行一次
@AfterSuite	在该套件的所有测试都运行在注释方法之后,仅运行一次
@BeforeClass	在调用当前类的第一个测试方法之前运行,注释方法仅运行一次
@AfterClass	在调用当前类的第一个测试方法之后运行,注释方法仅运行一次
@BeforeTest	注释的方法将在属于test标签内的类的所有测试方法运行之前运行
@AfterTest	注释的方法将在属于test标签内的类的所有测试方法运行之后运行
@BeforeGroups	配置方法将在之前运行组列表。 此方法保证在调用属于这些组中的任何一个的第一个测试方法之前不久运行
@AfterGroups	此配置方法将在之后运行组列表。该方法保证在调用属于任何这些组的最后一个测试方法之后不久运行
@BeforeMethod	注释方法将在每个测试方法之前运行
@AfterMethod	注释方法将在每个测试方法之后运行
@DataProvider	标记一种方法来提供测试方法的数据。 注释方法必须返回一个Object [] [],其中每个Object []可以被分配给测试方法的参数列表。 要从该DataProvider接收数据的@Test方法需要使用与此注释名称相等的dataProvider名称
@Factory	将一个方法标记为工厂,返回TestNG将被用作测试类的对象。 该方法必须返回Object []
@Listeners	定义测试类上的侦听器
@Parameters	描述如何将参数传递给@Test方法
@Test	将类或方法标记为测试的一部分,此标记若放在类上,则该类所有公共方法都将被作为测试方法
@Test(priority = 0) 可进行循环控制,数字越小执行顺序越高
Suite > Test > Class > Groups > Method

Thirteen, the difference between HTTPS and HTTP:

1. The https protocol needs to go to CA to apply for a certificate. Generally, there are few free certificates, so a certain fee is required. 2. HTTP is a hypertext transfer protocol, information is transmitted in plain text, and https is a secure SSL encrypted transfer protocol. 3. http and https use completely different connection methods and different ports. The former is 80 and the latter is 443. 4. The http connection is very simple and stateless; the HTTPS protocol is a network protocol constructed by the SSL+HTTP protocol that can perform encrypted transmission and identity authentication, which is safer than the http protocol.

Fourteen, tcp three-way handshake

The first handshake is initiated by the browser and tells the server that I want to send a request. The second handshake is initiated by the server and tells the browser that I am ready to accept it. Send it quickly. The third handshake is sent by the browser and tells the server , I'll send it right away, ready to accept it

15. The difference between tcp and Udp

1. The security of udp is higher than that of tcp, and the vulnerability of udp is less. 2. The transmission of udp is better than that of tcp. 3. udp belongs to one-to-many connection or many-to-many connection, and tcp belongs to one-to-one connection

Sixteen, the difference between cookie and session

1. The session is on the server side, and the cookie is on the client side (browser) 2. The session is stored in a file on the server by default (not in memory) 3. The operation of the session depends on the session id, and the session id is stored in the cookie. That is to say, if the browser disables cookies, the session will also be invalid (but it can be achieved in other ways, such as passing session_id in the url) 4. The session can be placed in a file, database, or memory. 5. In this case, user authentication generally uses session

Seventeen, the difference between POST and GET

  1. Get is to get data from the server, and post is to send data to the server.

  2. The GET request includes the parameters in the URL, and the request information is placed after the URL. The POST request passes the parameters through the request body, and the request information is placed in the message body.

  3. The amount of data transmitted by get is small and cannot exceed 2KB. The amount of data transmitted by post is relatively large, and it is generally defaulted to be unlimited. But in theory, the maximum amount is 80KB in IIS4 and 100KB in IIS5.

  4. The security of get is very low. Get is designed to transmit data, which can generally be seen in the address bar. Post security is higher, and the data transmitted by post is more private, so it cannot be seen in the address bar. If there is no encryption, their security levels are both It is the same, any listener can listen to all the data.

  5. GET requests can be cached, GET requests will be saved in the browser's browsing history, URLs requested with GET can be saved as browser bookmarks, and post requests do not have these functions.

  6. The bottom layer of HTTP is TCP/IP, and the bottom layer of GET and POST is also TCP/IP, that is to say, GET/POST are both TCP links. GET and POST can do the same thing. You need to add a request body to GET and a url parameter to POST, which is completely feasible technically. 7. GET generates a TCP data packet. For a GET request, the browser sends the http header and data together, and the server responds with 200 (return data); POST generates two TCP data packets. For POST, the browser first Send the header, the server responds with 100 continue, the browser sends data again, and the server responds with 200 ok (return data), not all browsers will send the packet twice in the POST, Firefox only sends it once

Eighteen, status code

1. Indicates a provisional response and requires the requester to continue the operation: 100 (Continue) The requester should continue to make the request. The server returns this code to indicate that it has received the first part of the request and is waiting for the rest. 101 (Switch protocol) The requester has asked the server to switch protocols, and the server has confirmed and is ready to switch.

2. The status code indicating that the request was successfully processed: 200 (request successful), the server has successfully processed the request. Usually, this means that the server served the requested web page. 201 (Created) The request was successful and the server created a new resource. 202 (Accepted) The server has accepted the request but has not yet processed it. 203 (Non-Authorization Information) The server has successfully processed the request, but the returned information may have come from another source. 204 (No Content) The server successfully processed the request, but did not return any content. 205 (Reset Content) The server successfully processed the request, but did not return any content. 206 (Partial content) The server successfully processed part of the GET request.

3. Indicates that further action is required to complete the request. Typically, these status codes are used for redirection: 300 (multiple choices) The server can perform various actions in response to the request. 301 (Moved Permanently) The requested webpage has permanently moved to a new location. When the server returns this response (in response to a GET or HEAD request), it automatically forwards the requester to the new location. ** 302 (temporarily moved) The server currently responds to requests from web pages in different locations, but the requester should continue to use the original location for future requests. 303 (View Other Locations) The server returns this code when the requester should use separate GET requests for different locations to retrieve the response. 304 (Not Modified) The requested page has not been modified since the last request. When the server returns this response, no web page content is returned. 305 (Using Proxy) The requester can only use a proxy to access the requested web page. If the server returns this response, it also indicates that the requester should use a proxy. 307 (temporary redirection) The server is currently responding to requests from web pages in different locations, but the requester should continue to use the original location for future requests.

4. These status codes indicate that the request may have gone wrong, preventing the server from processing: 400 (Bad Request) The server does not understand the syntax of the request. 401 (Unauthorized) The request requires authentication. The server might return this response for web pages that require a login. 403 (Forbidden) The server rejected the request. 404 (Not Found) The server could not find the requested webpage. ** 405 (Method Disabled) The method specified in the request is disabled. 406 (Not Accepted) Unable to respond to the requested web page with the requested content attributes. 407 (Proxy Authorization Required) This status code is similar to 401 (Unauthorized), but specifies that the requester should be authorized to use a proxy. 408 (Request Timed Out) The server timed out while waiting for the request. 409 (Conflict) The server had a conflict while completing the request. The server MUST include information about the conflict in the response. 410 (Deleted) The server returns this response if the requested resource has been permanently deleted. 411 (Valid Length Required) The server does not accept a request without a Valid Content-Length header field. 412 (Precondition not met) The server did not meet one of the preconditions set by the requester in the request. 413 (The request entity is too large) The server cannot process the request because the request entity is too large and exceeds the processing capacity of the server. 414 (The requested URI is too long) The requested URI (usually a URL) is too long for the server to handle. 415 (Unsupported Media Type) The requested format is not supported by the requested page. 416 (Requested range does not meet requirements) This status code is returned by the server if the page cannot provide the requested range. 417 (Expectation not met) The server did not meet the "Expectation" request header field.

5. Generally, it is a server problem: 500 (Internal server error) The server encountered an error and could not complete the request. ** 501 (not yet implemented) The server is not capable of fulfilling the request. For example, this code might be returned when the server does not recognize the request method. 502 (Bad Gateway) The server, acting as a gateway or proxy, received an invalid response from an upstream server. 503 (Service Unavailable) The server is currently unavailable (due to overloading or down for maintenance). Usually, this is only a temporary state. 504 (Gateway Timeout) The server is acting as a gateway or proxy, but did not receive the request from the upstream server in time. 505 (HTTP Version Unsupported) The server does not support the HTTP protocol version used in the request.

19. Database Knowledge

#插入数据
insert into test (id,email,ip,state) values(2,'[email protected]','127.0.0.1','0');
#删除数据 
delete from test where id = 1;
#修改数据
update test set id='1',email='[email protected]' where id=1;
#查数据
select * from test;  #取所有数据
select * from test limit 0,2;  #取前两条数据 
select * from test email like '%qq%' #查含有qq字符 _表示一个 %表示多个
select * from test order by id asc;#降序desc
select * from test id not in('2','3');#id不含2,3或者去掉not表示含有
select * from test timer between 1 and 10;#数据在1,10之间

#---------------------------表连接知识------------------------------
#等值连接又叫内链接 inner join 只返回两个表中连接字段相等的行
select * from A inner join B on A.id = B.id; #写法1
select * from A,B where A.id = B.id; #写法2
select a.id,a.title from A a inner join B b on a.id=b.id and a.id=1;#写法3 表的临时名称
select a.id as ID,a.title as 标题 from A inner join B on A.id=B.id;#添加as字句

#左连接又叫外连接 left join 返回左表中所有记录和右表中连接字段相等的记录
select * from A left join B on A.id = B.id;

select * from A left join (B,C,D) on (B.i1=A.i1 and C.i2=A.i2 and D.i3 = A.i3);#复杂连接

#右连接又叫外连接 right join 返回右表中所有记录和左表中连接字段相等的记录
select * from A right join B on A.id = B.id;

#完整外部链接 full join 返回左右表中所有数据
select * from A full join B on A.id = B.id;

#交叉连接 没有where字句 返回卡迪尔积
select * from A cross join B;


CREATE TABLE 语句用于创建数据库中的表。
.查询数据库中所有表名称:

  select table_name from information_schema.tables where table_schema='数据库名称';(包含视图)

  select table_name from information_schema.tables where table_schema='数据库名称' and table_type = 'BASE TABLE' AND table_schema = DATABASE ();(不包含视图)

2.查询每张表中所有字段名:

  select COLUMN_NAME from INFORMATION_SCHEMA.Columns where table_name='表名称' and table_schema='数据库名称';

oracle:

1.查询数据库中所有表名称:

  select t.table_name from user_tables t;

2.查询每张表中所有字段名:

  SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = '表名称';

Twenty, login interface test point

Normal: All required Abnormal: Data abnormal: Mobile phone number/password: Abnormal length, length greater than 11 digits, length less than 11 digits Abnormal type: non-data (characters, letters, Chinese characters) Whether it is required or not Repeated Parameters Abnormal: Multiple parameters , few parameters, no parameters, wrong parameter business exception, the operation is successful! wrong user name or password

21. The difference between lists and tuples in Python, the difference between lists and dictionaries

1. The list can be modified, but the tuple cannot be modified. The list is equivalent to a dynamic array, and the tuple is a static array; 2. The list is declared with square brackets, and the tuple is declared with parentheses, and the tuple has only one element Sometimes you need to add a sign after it; 3. The dictionary is slow to generate, but the search is fast, and the block generated by the list is slow to search; 4. The list is ordered, and the dictionary is unordered; 5. The list is accessed through the index, Dictionaries are accessed using key;

Twenty-two, I have logged in as an example, let me talk about the process of po design mode

1. The first step is to implement the basepage base type, which mainly realizes the acquisition of drive, and the compatibility test can be performed through drive 2. Implement the object layer, encapsulate the element positioning of the login page, such as the input box, and determine the positioning method of the button element ; 3. Carry out relevant operations according to the method of encapsulation and positioning, such as entering the user name, entering the password, and clicking the confirmation button; 4. According to the encapsulated page and operation class, realize the corresponding automated test; What is the po design pattern: pageobject, For example, reduce code duplication, make the code more readable, and easier to maintain. It mainly includes three layers, object layer (mainly encapsulates the method of positioning certain elements), operation layer (encapsulates some specific operations of elements), and business layer (combines one or more operations into specific services to achieve specific functional tests)

Twenty-three, the difference between pytest and unittest

||unittest|pytest| |-|-|-| |Use case writing method|1) The test file must import the unittest package 2) The test class must inherit unittest.TestCase 3) The test class must have the unittest.main() method 4) The test method must start with test_|1) The name of the test file must start with test or end with test 2) The name of the test class must start with Test 3) The name of the test method must start with test_| Execute some use cases by loading the testsuit|Mark classes and methods through the @pytest.mark method, pytest main adds the parameter -m to only execute the marked classes and methods||Pre and post of use cases|Provide setUp/tearDown, Only for all use cases|fixtures in pytest are obviously more flexible. The method function can be customized arbitrarily, as long as the decorator @pytest.fixture() is added, the decorated method can be used||parameterized|parameterized|using the @pytest.mark.parametrize decorator| |assertion format |Assert many assertion formats (assertEqual, assertIn, assertTrue, assertFalse)|There is only one expression of assert, which is more convenient to use| |Generate test report|Use HTMLTestRunner|pytest-HTML, allure plugin||Failure rerun|None|pytest- The rerunfailures plugin supports failure rerun|

Generally speaking, the format of unittest use cases is complicated, there is no compatibility, there are few plug-ins, and secondary development is convenient. pytest is more convenient and fast, and the use case format is simple. It can execute unittest-style test cases without modifying any code of the unittest use case, and has better compatibility. The pytest plug-in is rich, such as the flask plug-in, which can be used to rerun the use case when an error occurs, and the xdist plug-in, which can be used for parallel execution of the device, which is more efficient.

Twenty-four, po design pattern

The difference between lists and tuples in Python, and the difference between lists and dictionaries: 1. Lists can be modified, but tuples cannot be modified. Lists are equivalent to a dynamic array, while tuples are a static array; 2. Lists are declared with square brackets. The tuple is declared with parentheses, and when the tuple has only one element, it needs to be followed by the sign; Yes, the dictionary is unordered; 5. The list is accessed through the index, and the dictionary is accessed through the key;

I have logged in as an example, let me talk about the process of po design mode 1. The first step is to implement the basepage base type, which mainly realizes the acquisition of drive, and the compatibility test can be performed through drive 2. Implement the object layer and encapsulate the element positioning of the login page , such as the input box, determine the positioning method of the button element; 3. Perform related operations according to the encapsulation and positioning method, such as entering the user name, entering the password, and clicking the confirmation button; 4. According to the encapsulated page and operation class, realize the corresponding What is the po design pattern: pageobject, for example, reduces code duplication, makes the code more readable and easier to maintain. It mainly includes three layers, object layer (mainly encapsulates the method of positioning certain elements), operation layer (encapsulates some specific operations of elements), and business layer (combines one or more operations into specific services to achieve specific functional tests)

25. System testing includes the following aspects

  • Software appearance interface test (referred to as UI test): Mainly test whether the layout of software interface function modules is reasonable, whether the overall style is consistent, whether the interface text is correct, whether the naming is unified, whether the page is beautiful, and whether the combination of text, color, and pictures is perfect, etc. Test Difficulty: Relatively easy.

  • Software functional testing: mainly to test whether all the functional points presented by the software to users can be used and operated normally, and whether they meet the requirements in the requirements document. Test Difficulty: Moderate.

  • Software performance testing: to test whether the software can operate normally under different environments and pressures, one of the important indicators is the system response time, for example, when multiple people visit a certain web page at the same time, whether the web page can be opened within the specified time, etc. . Test Difficulty: High.

  • Software security testing: testing the ability of the software to prevent illegal intrusion. Test Difficulty: High.

  • Software usability test: Test whether the software is easy to operate, which is relatively subjective, and experience whether the software product is easy to use from the perspective of the user. Test Difficulty: Relatively easy.

  • Software compatibility test: test the compatibility of the software with other software. As a junior software tester, the main consideration is the compatibility between the software and the browser, including resolution compatibility. Test Difficulty: Relatively easy.

Guess you like

Origin blog.csdn.net/DY_CSDN/article/details/130016848