An article to let Xiaobai understand what software testing is

Basic introduction to software testing

One, the definition of software testing 

Test the "object under test" by hand or tools to verify whether there is a difference between the actual result and the expected result.
(A slap for a bite, the difference is a bug, or defect) 

Second, the role of software testing 

1. Through the testing work, the defects in the software can be found and repaired, so as to improve the user's confidence in the use of the product.
2. The test can record some data generated during the running of the software, so as to provide data support for decision-making. (Tickets purchased at 12306, the number of visits at the same time was not taken into consideration. During the test, 100 million to 1 billion users were set, and a certain period of time on the public network)
3. The test can reduce the risk of problems encountered in the development of the same type of product (let others first Go and see, go by yourself, experimental product, same type: qq-WeChat)

 Three, the principle of testing 

The so-called test principles refer to some principles that we must observe when performing test work.

1. The test proves that the software is defective (no matter how much it is done, it can only prove that the current software is defective)
2. Exhaustive testing cannot be performed (there is no way to list all the conditions, so any test work is at the end), ( From now to death, I can’t finish the test. I will test a function point in one year after entering the company. The test is very complete. I definitely don’t need you)
3. There is a cluster phenomenon of defects (28 theories, core=20%, non-core=80%)
(20% of the core functions commonly used in qq function are very small, 80% of other functions are not core functions, core functions seize the market, and all human, material and financial resources must be concentrated to test core functions, 100 people test 20%, 1 person test 80% What is the probability of detecting a problem? 100 pairs of eyes staring at a person finds more. More defects will be found = defect clusters)
In actual work, we will focus on testing 20% ​​of the core functions, so defects are found in this part The probability will be higher than 80%. Therefore, we will encounter the phenomenon that defects are concentrated in 20% of the functional modules.
4. Some tests need to rely on special environments (the north and south temperatures are different, and the mobile phone battery is not tested at low temperatures)
5. The test should be involved as soon as possible: To discover more and better solve the defects in the software, we pursue the testing work as soon as possible.
(If the bug is found, the developers must change and make sure that there is no problem. If you say that there is no problem, there is no problem. It
affects the whole body at once) 6. Pesticide phenomenon: the same test case cannot be executed multiple times, because the software will be immune to her (produce antibodies)
(I tell you 2.3+3.7 is not equal to 6. What will you do? What to do? Try every means to make it easy to use, so you can’t use the same data when you test again, so developers hate testers)
7. There is no defect fallacy
(my software is okay? Fallacy, Point and scold him.)

 Test object introduction

For the current testing industry, the most frequently tested subject is the software (main function), but we need to understand that a software is not only a function that needs to be tested. We can divide the software into three parts:
function set + instruction manual + configuration data
                  configuration data: the default provided to customers should also be the right (refrigerator)
map software, Taobao opens the default data for customers to see quickly Go to the default things on the website.
                   The software that comes with the phone when you buy it belongs to the configuration data.
For a software, it needs a process from scratch. We can divide this process into different stages, and then each stage will have a corresponding Test
1. Requirements analysis stage: various requirements specifications
(how the user is likely to use it, what kind of results the user will get according to his operation, write out the tester and get this manual for design, don’t think this does not even have software How to test it, the wrong word is considered a test, not all functions can be realized, unfeasible requirements, suggestions in the test phase, from the earth to Mars within half a year, is it possible?)
2. Software architecture design: API interface
The concept of document (interface test) design: House structure
Cto: Chief technology officer, no need to write the underlying code, stand at a certain height, build the framework of the entire company, how many functions need to be implemented, and how many functions each have Modules, how many small modules are in each module, draw a set of documents, programmers get to do development work
Interface document interface test
3, coding time phase: source code (white box test, black box test)
   a, determine what the idea does b, how to do it, c, do it by hand. At
this stage, the object of our test is the source code (if the tester can code, it is two programmers, the cost is too high),
if possible, we can give it Customer used
4, system function use (test phase):The test object at this stage is the main body of the software function. The most common type of test currently done in the industry is
equivalent to letting the tester act as a customer to verify the main body of the function. Once it is OK, get it on the market and give it to the customer
. It is software. This is a narrow error. The
software itself consists of three parts:

1. The software has a bunch of function instructions, (close, minimize) function instructions, and the user needs to be trained
2. The default configuration data (the content displayed for the first time when the customer is shown to the customer is correct)
3 , A piece of software needs many stages from nothing to there. As a tester, there are things to be tested at each stage (test requirements document, test api document, test source code, test main function)

Test level 

Software development will be based on the corresponding development model, and the test level refers to the development steps that we think are defined in this model. Among them, the most common level classification for testing is as follows:
1. Unit test (UT unit test): In software testing, unit refers to the smallest underlying code structure that composes the software, generally classes, functions, and components (currently In the software testing industry, it’s not possible to require testers to test the source code, whoever develops the test) 

Units and small modules of the cell are tested. It
is to test the underlying source code to form the smallest part of the current source code
. There are three common types: class, function, component (do not understand the code, it’s okay to find the collection, the smallest component) )
No matter how beautiful the interface is, it doesn’t matter if the underlying code is correct, and the logical result is incorrect.

2. Integration test (IT system ingertation test):

Combine multiple different unit modules together, and then verify whether the "bridge" between them can work normally (in other words: interface test) The
unit is the smallest component, and the integration is combined together in time.
Example 1: Small Cars, wipers, windshields. The combination of the three-meter-long wiper and windshield is no longer working.
Example 2: The two were fine before they got married, and they quarreled together every day after they got married.

3. System test (ST system test): This is the most common type of test in the current industry. Testers act as users and then test the functional main body of the software.
4. Acceptance test:

Core: In order to allow users to pay for this software (not to find faults,)
Example: I am a contractor, and I have received a small project outside through many twists and turns. I need to invest money in the early stage, such as 1 million, to take out the building, and then Find the person who asked me to build the building (the job I received only after the trusteeship) to check and see how I built it. When I asked him to check it, I hope she finds the problem or not. I definitely don't want it. I can’t spend 1 million on my own and then tell him that you can pick the fault for me. Isn’t that my fault?
(1) Alpha test---internal test (internal company, test development together)
(2) Beta test ---Public beta (questions, feedback, email feedback, rewards)
(3) UAT (user acceptance test) test---The customer sends the company’s business proficient personnel to use the software to test the functions and the
customer pays for it Software, customers feel that you understand technology but not necessarily understand our business, so customers should stand on their own business needs and send their own company’s business proficient personnel to test the software (scenario)

System test classification

1. Function test: verify whether the main function of the current software is available.
Tell me if it is easy to use. I have to verify.
2. Compatibility test: verify whether the current software can still use
Windouw/Linux in different environments , browser, client: (Pad, TV, mobile phone, computer)
3. Security test: verify whether the software can only authorize users to provide functions to use
bank cards, password protection, limited number of times
4. Performance test:

Relative to the resources consumed by the current software, its output capacity
performance: high.
Example: As a person, I need to yell at you and give you lectures. You can have these two options. The
first is: you let me eat three meals a day, and I can yell at you for one day, and the
second: You let me eat two meals a day, let me yell
at you for two days. Compare, which one is more efficient? The second type is more efficient, and the person is still me. In
summary: the same as the game upgrade at 1234, the function test for the first time in the industry is the foundation of the foundation, then the compatibility, the safety, and the performance test in the last step.

Common system test methods

1. Classification by test object 

1. White box testing: The main body of this test is the underlying code of the software. It will not be ok in the unexpected interface. It only requires the implementation of the underlying functions and the logic is correct.
Ask if you can, you can say that you understand (not just understand ~~) html, python, database and so on.
Although you may not be able to use it now, learn it slowly.
2. Black box testing: This kind of testing refers to testing whether the external main functions of the software are available.
If you can’t see the inside, you can only see the outside (login, close, you can only see the test, and you can’t see the underlying code)
3. Gray box testing: between the two (interface testing),
first ensure that the function is available, and then ensure The module is no problem.
4. The "box" in the above three methods refers to the object to be tested

Second, according to whether the test object is classified

1. Static test: It means that the test is not executed and the
software is not given to me. How can I test it? Test the document, look at the web page interface against the document
2. Dynamic test: Run the software in a real environment for testing.
Give me a car, no problem, just run the test two laps on the road.

Three, according to the test method to classify

1. Manual test: The tester manually verifies the object under test. The advantage is that the test operating environment can be changed flexibly.
When the mobile phone is bought, it is to take pictures and make phone calls for testing, but some people like to cook in a frying pan, freeze or freeze in the refrigerator, no problem, when someone comes to operate it is flexible and can be changed, but Tools are not good-automation
2, automated testing: there are two main types of so-called automation 

One is to write test scripts by yourself. It is
estimated that many students now think that the teacher, teach me to write scripts~~ I just finished learning Java and I am anxious to write something.
The test script is not a program development, and you don't need to get all the logic. Here you will find that the test script is nothing more than calling the interface and passing the value. This is a script.
Of course, if you have the ability to write and develop a framework by yourself, you can test the framework based on the process of your company’s products. This is also a script, but this can’t be done by just one person. After all, developing a software is not just one Humans can do it, so there is no need to feel frustrated. Needless to say, you can't write it, and I can't write it. So is there comfort in my heart?
One is to test the subject through a third-party tool.
Third-party tools charge fees, so if you can write your own scripts, many companies don't do automated testing.
The advantage is that it can efficiently perform some operations that cannot be achieved manually

Example: 12306, in which a scene is constructed. I want to measure how many people can simultaneously operate this website at the same time. The login function, you are not alone, how do you know how many people across the country go with you to order login.
Manually test: Now let you operate the maximum number of users you can order to log in to the computer, all 6 browsers are open, and there are at most a dozen users. But this kind of test is meaningless. If Taobao 12306 can't even be a user, you don't need to test it. Test
with tools: It can help you easily generate as many users as you want in batches, and do things that cannot be done manually.
Each has it's own benefits

Software quality

Describe whether the current software is easy to use. In the current software industry, the set of standards we use is based on the ISO organization. What we need to remember is the six major characteristics of software quality:
a little bit circumstantial, in fact, it is such a thing. In the industry, a set of standards that are used to measure the quality of software is a set of standards that the ISO International Organization for Standardization has issued a set of standards that the world follows. Standard, as long as it meets this standard, this software is good.

1. Functionality: The software needs to satisfy the user's display or implicit functions.

Example: Taobao enters the mobile phone and the result shows the related information of the mobile phone.
Implicit: For example, the default sorting, I just want to simply get the mobile phone information, but the implicit information will provide the customer's experience

2. Ease of use: the software is easy to learn and use

King of Glory: Why the fire? Easy to learn, simple to operate, there is a turntable on the left and buttons on the right,
attracting users: pursuing an upward mentality, thinking of ranking higher in the circle, so keep playing

3. Reliability: It means that the software must implement the specific functions specified in the requirements

You promised me that there is another function in this software, so when I use it, I have to have these ten, and eight of them are unreliable.

4. Efficiency: similar to the performance of software.

Download: Thunder, Baidu Netdisk, Tornado. Who is faster in the same network environment, who is more efficient

5. Maintainability:

The software is required to have the ability to continue using a function after it can be repaired. 

I bought a TV at home and gave the remote control. One day the remote control was broken and repaired. Then the TV can continue to be used.

6. Portability:

The current software can be transplanted from one platform to another platform to use the ability.

Summary: [The function is reliable and the function can be "moved"]
Example: For example, during an interview, you raised a bug to the backend, but the back-end developer said it was not a bug. Then you have to ask under what circumstances (under the use of the software environment) it is not a bug. For example: 6+2=8, the development said that the function is implemented, no problem is not a bug, the tester said that after the 6+2 result 8 dialog box pops up, click the OK button, and the value in the box does not return to the default value after the end.

From what angle do you persuade? In terms of user experience, it is too tall. There should be an ease of use in the software quality standard.
If the user clicks the OK button and the value 1, 2 does not return to the default, the user will be confused. Did I calculate the result just now? He will feel that he wants to click again [ Sum] button, so from the user's point of view, it is not easy for users to use. So it's casual to say that it's euphemistic. These are common problems in communication with development in the future, and also prove the idea of ​​testing.

 Software testing process

1. Demand analysis

(1) Make it clear what we need to design.
Know what you want to test
(2) The source of the requirements: requirements specifications (function specifications), API documents, analysis of competing products (we have the functions of similar products, and we can’t make mistakes that they don’t make), personal experience
How do I know what exactly this software is going to test? Write out test points based on the source of the requirements. Where to find

2. Design use cases/test cases

(1) What is a use case? Use case is the operation process performed by the user to test a certain function of the software
(2) There are methods for designing use cases (equivalence class, boundary value, decision table...)

3. Review use cases: add or delete current use cases

4. Configure the environment

(1) Environment: Refers to the execution environment required for the current operation of the tested object. As a tester, you need to have the ability to match the environment. If
not, Baidu, men ask women, women ask men, you must cultivate your own ability. Peace of mind: [Generally, an integrated environment for one-click installation is used].
(2) Environment classification: operating system + server software + database + execution environment of the software underlying code (.html can be opened to prove that there is such an environment, .jsp file Unable to open the proof that the required environment (java) is not installed) The
database is only responsible for use and not for optimization, and one is almost the same

5. Execution use case

Take the design and execute it
(1) Generally, we will do a smoke test before executing the use case. The core of this test is to quickly verify the core functions of the current software or the main execution process. If there is a problem in the smoke test phase, you can return this version to development.
E-commerce websites: What are the core functions? shopping. Will quickly walk through the most core functions.
Smoke test: The smoke will be gone soon after the smoke has finished.
    (2) If the smoke test passes, then a comprehensive test will be carried out.

6. Regression testing and defect tracking

(1) For example, if a problem is found in the test, tell the developer, and the developer says that the repair is complete. Can you believe it?
Regression testing means that when we submit a defect to development, they will fix it. After the repair is completed, testers need to test it again [Regression testing]
(2) Defect tracking: It refers to when the tester finds a certain defect. Need to keep track of its status after a defect

7. Output test report

Visualize the data generated during the current test process. Convenient for others to view.
If you feel unwell today, go to the hospital for a checkup, check it up, and the doctor will tell me to go home and wait for death. I am definitely unwilling. I have to tell me why and give me some evidence~~~

8. The test is over

It may crash you and the test is over. Is it still a step? Forget it!
It should be because that many products now have many versions and need to be written and iterated, so it is necessary to archive the things produced by the current version,
and organize and archive some documents generated during the entire test process to facilitate the use of subsequent versions 

Software Architecture 

The so-called software architecture can be understood as an idea used to guide our software development. At present, the most common two-in-one architecture model is B/S C/S
B---browser browser   
C---client client
S---server server
Which is in life?

Comparison of the two architectures

1. Standard: Compared with the CS architecture, both ends of the BS architecture are using ready-made mature products. So BS will show some standards.
There are many types of browsers, but there are only a few fixed ones. Taobao will not develop its own browsers. QQ, WeChat, etc. need to develop its own interface
. 2. Efficiency: Compared with the bs architecture, the client in cs can share some data processing , So the execution efficiency will be higher. When
opening the Taobao interface, do you consider how the data comes from? Do we need to sort out the navigation on the left? No, it's all handled by Taobao's server. What you see is displayed after being parsed by the browser. The client is only responsible for display, the server does it. Once the browser is closed today, it will be gone if you open it tomorrow. The Cs architecture is different. If the network is disconnected and connected, things are still
3. Security: The data transmission in the BS architecture is output in the HTTP protocol, and the HTTP protocol is output in plain text, which can be captured, so Compared with the cs architecture, bs is not so safe (relatively speaking, not absolute),
find a browser, open it and look at it, people with ulterior motives
4. Upgrade: If Taobao is going to be revised, what can you do to see after the revision? Content. Just refresh the browser. How to update the Glory of Kings? To download and upgrade the
BS architecture, you only need to update the data on the server side. The front desk only needs to refresh the page to complete the upgrade. In the CS architecture, both ends must be updated.
5. Development cost: Compared with the BS architecture, the client in CS needs to be developed by itself, so the cost will be relatively higher.

Software development process model

1. Waterfall model:

It is a kind of linear model, and there is enough time to test after the code is completed.
Emphasis on early planning: If the first step in the requirements analysis phase is done in place in the early stage, there will be no need to change in the later
stage. Improvement: each stage can be integrated into small iterations, no problem, proceed to the next stage

2. Rapid prototyping model

3. Spiral model

Test model

With the management and development of the testing process, the testers have passed a lot of practice, thus summed up a lot of test models, common V model, W model, H model, etc. These models are closely integrated with development, abstract the testing activities, and become an important reference for testing process management.

1.V model

2.W model

Test work has also been added in the requirements and design phases

3.H model

Software testing classification

Black box testing:

Also known as data-driven testing, it does not consider internal institutions and characteristics at all, and only focuses on the functional requirements of the software (regardless of the code)

1. Functional test

1. Logic function test
2. Interface test
3. Usability test
4. Installation test
5. Compatibility test

Second, performance test

1. Time performance
2. Space performance
3. General performance
4. Stability test
5. Load test
6. Stress test

White box testing:

Open the box to study the program structure and source code in it
Static test/Dynamic test

Random test:

For important functions and newly added functions, modules that have had major bugs in the past are tested twice, which is also called exploratory testing, which can be used in conjunction with regression testing.

A very valuable theoretical article, which is of great help to junior testers.

Guess you like

Origin blog.csdn.net/feng8403000/article/details/114853526