Hello everyone , I'm erhei , Byte hopping 25 A classic interview question for software testing , Can you resist it ？
Here is a set of software testing related resources ：
Follow my official account ：【 Programmer two black 】 You can get it for free ！
Communication group ：642830685
Establish test plan , Determine test criteria and test scope
Design test cases for typical scenarios , It covers common business processes and uncommon business processes .
According to the test case , Develop automated test scripts and scenarios ：
Record test script ： Create a new script （Web/HTML agreement ）; Click the record button , In the pop-up dialog URL Input in ”about:blank”; After the normal operation process in the open browser , The end of the recording ; Debug the script and save , You may want to pay attention to the association of character sets .
Set up test scenarios ： Set up test scenarios for performance , The main judgment is under normal circumstances , Whether the average transaction response time of the system is up to standard ; Set up test scenarios for pressure loads , The main judgment is under the condition of full load or exceeding the bearing capacity of the system for a long time , Will the system crash ; Perform the test , Get test results , Analyze test results .
Software is another part of a computer system that is interdependent with hardware , A computer program related to the operation of a computer system 、 Rules 、 The rules , And possible documents 、 Documents and data .
Software reuse (SoftWare Reuse) It is to use all kinds of knowledge about existing software to build new software , To reduce the cost of software development and maintenance . Software reuse is an important technology to improve software productivity and quality . Early software reuse was mainly code level reuse , The reused knowledge refers to the program , Later it expanded to include domain knowledge 、 Development experience 、 Design decides 、 Architecture 、 demand 、 Design 、 Code and documentation and everything .
Software components that can be reused are generally called reusable components .
Software life cycle （Software life cycle） Also known as the software life cycle , Life span . It means from the formation of the concept of development software , After using the developed software , Know the whole process until the loss of use value . Generally speaking , The whole life cycle includes planning （ Definition ）、 Development 、 function （ maintain ） Three periods , Each period is divided into several stages . Each stage has a clear task .
The periodic model （ Typical types ）：
Waterfall model ：
Iterative model ：
Life cycle phase ：
Software planning and feasibility analysis
Operation and maintenance
Operate the program under specified conditions , To find program errors , Measuring software quality , And to evaluate whether it can meet the design requirements .
The purpose of software testing ：
Testing is the execution of a program , The aim is to discover mistakes
A successful test case is to find errors that have not been found so far
A successful test is one that finds errors that have not been found so far
Make sure that the product performs the functions it promises or publishes , And the functions that users can access have clear written instructions .
Ensure that the products meet the requirements of performance and efficiency
Make sure the product is robust and adaptable to the user environment
Principles of software testing ：
A necessary part of a test case is to define the expected output or take over
Programmers should avoid testing their own programs
Organizations that write software should not test their own software
The execution results of each test should be thoroughly checked
Test cases should be written not only based on valid and expected inputs , And it should also be based on invalid and unexpected inputs
Check that the program is “ Not doing what it's supposed to do ” It's only half the test , The other half of the test is to check if the program “ Did what it shouldn't have done ”
Test cases should be avoided to be discarded after use , Unless the software itself is a one-time Software
You should not plan your testing work on the assumption that no errors will be found
The possibility of more errors in some part of the program , In direct proportion to the number of errors that have been found in that section
Software testing is very creative , A challenging job with great intelligence .
Software configuration management （Software Configuration Management,SCM） It's a sign 、 The technology of organizing and controlling modifications . Software configuration management is applied to the whole software engineering process . Changes are inevitable when software is built , And change exacerbates the confusion among software developers in the project .SCM The goal of the activity is to identify changes 、 Control change 、 Ensure changes are implemented correctly and report changes to other relevant personnel . In a way ,SCM It's a sign 、 The technology of organizing and controlling modifications , The purpose is to minimize errors and improve production efficiency most effectively .
The software configuration includes the following ： Configuration item identification 、 Workspace management 、 version control 、 Change control 、 status report 、 Configuration audit
In a nutshell , Software quality is “ The degree to which software is consistent with clearly and implicitly defined requirements ”. To be specific , Software quality is that software meets the stated functional and performance requirements 、 The document clearly describes Development standards 、 And the extent to which all professionally developed software should have implicit features . The main factors that affect the quality of software , These factors are the measurement of software quality from the perspective of management . It can be divided into three groups , Reflect the three views of users when using software products . correctness 、 Robustness, 、 efficiency 、 integrity 、 Usability 、 risk （ Product running ）; Comprehensibility 、 Maintainability 、 flexibility 、 ...Testability （ Product modification ）; Portability 、 Reusability 、 Interoperability （ Product transfer ）.
White box testing ： Logical coverage 、 Cycle coverage 、 Basic path coverage
Black box testing ： Boundary value analysis 、 Equivalence class division 、 Wrong guess 、 Cause and effect diagram 、 State diagram 、 Test outline method 、 Random test 、 Scene method
Software security testing includes programs 、 Database security test . According to the system security indicators, different testing strategies are also different .
The test of user authentication security should consider ： Clearly distinguish different user rights in the system 、 Will there be user conflicts in the system 、 Will the system cause confusion due to the change of user's authority 、 Is the user's login password visible 、 Replicable 、 Is it possible to log in to the system through absolute means （ Copy the user's login link and enter the system directly ）、 Whether all authentication marks have been deleted after the user exits the system , Whether you can use the back key to enter without entering a password System 、 The test of system network security should consider the problem 、 Test whether the protective measures taken are correctly assembled , Is the patch on the system 、 Simulate unauthorized attacks , See if the protection system is strong 、 Use mature network vulnerability checking tools to check system related vulnerabilities （ That is, use the most professional hacker attack tools to attack , Now the most commonly used NBSI Series and IPhacker IP ） 、 Use a variety of Trojan inspection tools to check the Trojan status of the system 、 Using various anti plug-in tools to check the plug-in vulnerabilities of each program in the system .
Database security considerations ： Is the system data confidential （ For example, for the banking system , This is especially important , General website does not have too high requirement ）、 Integrity of system data （ There was data in the enterprise real name verification service system that I just finished It's not complete , There are obstacles to the function realization of this system ） 、 System data manageability 、 Independence of system data 、 System data can be backed up and recovered （ Is the data backup complete , Can you restore , Whether the recovery can be complete ）
Input data provided to the tested system for the purpose of carrying out the test 、 A specific collection of operations or various environment settings and expected results .
Test scripts are scripts written for automated testing .
The writing of test scripts must correspond to the corresponding test cases .
Static testing is the process of finding possible errors in program code or evaluating program code without running the program itself .
Dynamic testing is actually running the program under test , Enter the corresponding test case , Check the difference between the operation result and the expected result , Determine whether the implementation results meet the requirements , So as to test the correctness of the procedure 、 Reliability and effectiveness , And analyze the efficiency and robustness of the system .
Black box test is generally used to confirm the correctness and operability of software functions , The purpose is to test whether each function of the software can be realized , Treat the tested program as a black box , Regardless of its internal structure , Knowing the relationship between the input and output of the program or the function of the program , Rely on software specifications to determine test cases and infer the correctness of test results .
White box test is based on the analysis of the internal logic structure of the software , It's code based testing , Testers judge the quality of software by reading program code or by using single step debugging in development tools , Generally, black box testing is implemented by project manager in programmer development .
α Testing is a test conducted by a user in the development environment , It can also be controlled test conducted by users inside the company under simulated actual operation environment ,Alpha Testing cannot be done by programmers or testers .
β Testing is the testing of multiple users of the software in the actual use environment of one or more users . Developers are usually not at the test site ,Beta Testing cannot be done by programmers or testers .
SQA It consists of a set of software engineering processes and methods , In order to make sure （ The software ） quality .SQA Throughout the software development process ,( it ) It should include review of requirements documents 、 Code control 、 Code review 、 Change management 、 Configuration Management 、 Version management and software testing .
Software quality assurance （SQA-Software Quality Assurance） It's about building a plan , There is a systematic way , To assure management of the proposed standards 、 step 、 Practices and methods can be used correctly in all projects . The purpose of software quality assurance is to make the software process visible to managers . It verifies that software is up to standard by reviewing and auditing software products and activities . The software quality assurance team is involved in establishing the plan at the beginning of the project 、 Standards and processes . These will enable the software project to meet the requirements of the organization's policy .
Functionality ： adaptive 、 accuracy 、 Interoperability 、 Compliance 、 Security .
reliability ： Maturity 、 Fault tolerance 、 Resilience .
Usability ： Intelligibility 、 Easy to learn habits 、 Easy to operate .
efficiency ： Time characteristics 、 Resource features .
Maintainability ： Analyticity 、 Changeability 、 stability 、 Testability .
Portability ： adaptive 、 Ease of installation 、 Compliance 、 Replaceability
Software testing strategy ： In certain software testing standards 、 Under the guidance of the test specification , The principle of software testing according to the specific environmental constraints of the test project 、 The way 、 Set of methods .
Corresponding to the development process , The testing process goes through unit testing in turn 、 Integration testing 、 The system test 、 The acceptance test
Four main stages ：
unit testing ： Unit testing is the smallest unit for software design –– Program modules and even code segments for correctness testing , It's usually done by developers .
Integration testing ： Integration testing is to assemble modules for testing according to design requirements , The main purpose is to discover problems related to interfaces . Because before the product is submitted to the testing department , The product development team has to carry out joint debugging , So in most enterprises, integration testing is done by developers .
The system test ： The system test is carried out after the integration test is passed , The purpose is to fully run the system , Verify whether each subsystem can work normally and complete the design requirements . It is mainly carried out by the testing department , It's the biggest and most important test in the testing department , It has a great influence on the quality of products .
The acceptance test ： Acceptance testing is conducted in the requirements phase 《 Requirements specifications 》 It is the acceptance standard , It is required to simulate the actual user's running environment when testing . For the actual project can be carried out together with customers , For the product, it's the last system test . The test content is a comprehensive test of the functional modules , In particular, document testing .
Unit testing strategy ：
Top down unit testing strategy ： Much more expensive than isolated unit testing , Not a good choice for unit testing .
Bottom up unit testing strategy ： More reasonable unit testing strategy , But the test cycle is longer .
Isolated unit testing strategy ： The best unit testing strategy .
Test strategy of integration test ：
Big bang Integration ： It is suitable for a maintenance project or the system under test
Top down Integration ： It is suitable for clear and stable product control structure ; The high-level interface changes little ; The underlying interface is undefined or may be modified frequently ; There is a great technical risk in the production control module , It needs to be validated as soon as possible ; Hope to see the system function and behavior of the product as soon as possible .
Bottom up integration ： It is more stable to adapt to the underlying interface ; High level interfaces change frequently ; The underlying components were completed earlier .
Schedule based Integration
advantage ： It has a high degree of parallelism ; It can effectively shorten the development progress of the project .
shortcoming ： Pile and drive work is heavy ; Some interface tests are inadequate ; Some tests are repetitive and wasteful .
The testing strategy of system testing ：
Unit test phase ： Each independent unit module is tested in isolation from other parts of the system , Unit test checks the correctness of each program module , Check whether each program module realizes the specified function correctly . Generate unit test reports , Submit defect report .
Integration testing phase ： Integration testing is based on unit testing , The test is to assemble all software units into modules according to the requirements of the outline design specification 、 Whether the work of each part in the process of subsystem or system reaches or realizes the corresponding technical indicators and requirements . This phase generates integration test reports , Submit defect report .
System test phase ： Software that will pass validation testing , As an element of the whole computer system , With computer hardware 、 peripherals 、 Some support software 、 Data is combined with other system elements such as people , In the actual operating environment , Comprehensive functional coverage of the computer system . At this stage, test summary and defect report are required .
Find out as early as possible in the system Bug;
Avoid defects in the software development process ;
Measure the quality of software , Ensure the quality of the system ;
Focus on the needs of users , And ensure that the system meets the needs of users .
The overall goal is ： Ensure the quality of the software .
One Bug Basically, the record should contain ：
bug Number ;
bug Severity level , priority ;
bug The resulting module ;
First of all bug Abstract , This paper bug In general ;
bug Corresponding version ;
bug Detailed description of the phenomenon , Including some screenshots 、 videotape … wait ;
bug Test environment when it appears , The resulting conditions are the corresponding operation steps ;
High quality Bug Record ：
1) Universal UI To unify 、 accuracy
2) Try to use the expression terms and methods commonly used in the industry
3) Each defect report includes only one defect
4) Non reproducible defects should also be reported
5) Clearly indicate the type of defect
6) Clearly indicate the severity and priority of defects
7) describe (Description) , concise 、 accuracy , complete , Reveal the essence of the defect , Record the defect or the location of the defect
Bold style 8) Use automatic numeric sequence numbers between short lines , Use the same font 、 Font size 、 Row spacing
9) Try to record only one operation for each step
10) Confirm that the steps are complete , accuracy , brief
11) According to the defect , You can choose whether to capture the image
In order to intuitively observe defects or defect phenomena , It is usually necessary to add defects or interfaces where defects appear , Attached to the record as an attachment in the form of a picture “ The attachment ” part . To save space , And can truly reflect the defect or defect essence , It can capture the full screen of defects or defects , Active windows and local areas . For quick positioning 、 Correct the defect or defect location , It is usually required to attach Chinese comparison drawings .
Attach necessary special documents and personal suggestions and notes
If you open a special document, the defect or defect , The document must be attached , Thus, defects or defects can be quickly reproduced . Sometimes , In order to make the defect or defect corrector further clarify the defect or defect performance , You can attach personal modification suggestions or comments .
12) Spelling and grammar defects
13) Try to use phrases and short sentences , Avoid complex sentence patterns
The purpose of software defect management database is to locate defects easily , therefore , It is required to objectively describe the operation steps , There is no need for modifying words and complex sentence patterns , enhance readability .
The above summarizes the specification requirements for reporting test defects , As software testing requirements vary , The tester has been tested for a long time , Accumulated corresponding testing experience , Will gradually develop good professional habits , Constantly add new standard writing requirements . Besides , Read a lot 、 Learn test defect reports from other test engineers , Compare and think with your previous test defect reports , You can constantly improve your skills .
14) Defect description content
The advantages of black box testing are ：
The disadvantages of black box testing are ：
The advantages of white box testing are ：
The disadvantages of white box testing are ：
Functionality ： Fill a water cup with water to see if it leaks ; Can water be drunk
Security ： Is there any poison or bacteria in the cup
reliability ： The degree of damage caused by the cup falling from different heights
Portability ： The cups are in different places 、 Whether it can be used normally under the environment of temperature and so on
Compatibility ： Whether the cup can hold juice 、 plain water 、 alcohol 、 Gasoline, etc
Ease of use ： Is the cup hot 、 Is there any anti-skid measures 、 Is it convenient to drink
User documentation ： Is the instruction manual for cup usage 、 Limit 、 The conditions of use are described in detail
Fatigue test ： Fill the cup with water （ Case a ） discharge 24 Check the leak time and condition every hour ; Fill it with gasoline （ Case 2 ） discharge 24 Check the time and condition of leakage every hour
Pressure test ： Use a needle and add weight to it , Look at the pressure, it will penetrate
Software test plan is a programmatic document to guide the test process ：
Leaders can carry out macro-control according to the test plan , Corresponding resource allocation, etc
Testers can understand the whole project testing situation and the work to be done in different stages of project testing
It is convenient for other personnel to understand the work content of testers , Carry out relevant cooperation work
Includes product overview 、 The test strategy 、 The test method 、 Test area 、 Test configuration 、 Test cycle 、 Test resources 、 Test communication 、 Risk analysis, etc . With software test plan , Project members participating in the test , Especially test managers , Test tasks and methods can be specified , Maintain smooth communication during test implementation , Track and control test progress , Respond to changes during testing .
Test plan preparation 6 elements （5W1H）：
why—— Why do these tests ;
what— What to test , Different stages of work ;
when— Test the starting and ending time of different stages ;
where— Corresponding documents , Storage location of defects , Test environment, etc ;
who— Project related personnel composition , Who are the testers to test ;
how— How to do it , What testing tools and methods are used for testing
Test plan and test details 、 There is a strategic and tactical relationship between test cases , The test plan mainly plans the scope of testing activities from the macro level 、 Methods and resource allocation , And testing detailed specifications 、 Test cases are specific tactics for completing the test task . So the most important one is the test strategy and test method （ It's better to judge first ）.
1） Equivalence class division ：
2） Boundary value analysis ：
It is a supplement to the method of equivalence class partition . Testing experience tells me , A lot of errors occur at the boundary of the input or output range , Not inside the I / O range . Therefore, test cases are designed for various boundary conditions , We can find out more mistakes .
Use boundary value analysis to design test cases , First of all, boundary conditions should be determined . Generally, the boundary of input and output equivalence classes , It's the boundary situation that should be tested . It should be chosen exactly equal to , Just greater than or just less than the boundary value as test data , Instead of selecting typical values or arbitrary values in equivalent classes as test data .
3） Wrong guess ：
Based on experience and intuition, we can infer all kinds of possible errors in the program , So as to design test cases with pertinence .
The basic idea of the wrong way of guessing : List all the possible errors in the program and the special cases that are prone to errors , Choose test cases based on them . for example , Many of the common errors in modules that have been listed during unit testing . Mistakes found in previous product tests, etc , These are the summaries of experience . also , The input data and output data are 0 The situation of . Input form is blank or input form has only one line . These are all error prone situations . The examples in these cases can be selected as test cases .
4） Cause and effect diagram method ：
5） Orthogonal table analysis ：
6） Scene analysis method ：
7） State diagram ：
8） Outline method ：
Project manager through communication with customers , Complete the requirements document , The review of requirements documents is completed by developers and testers , The contents of the review include ： The requirements are not clearly described and there may be obvious conflicts or functions that cannot be realized . Project managers through integrated developers , Comments from testers and customers , Complete the project plan . then SQA Entry project , Start counting and tracking .
The developer completes the requirement analysis document according to the requirement document , The tester reviews , The main contents of the review include whether there are omissions or different understandings between the two parties . The tester completes the test plan document , The test plan includes the content described above .
The tester starts to write test cases according to the modified requirements analysis document , At the same time, the developer completes the outline design document , Detailed design documents . These two documents serve as supplementary materials for testers to write test cases .
After the test case is completed , Testing and development needs to be reviewed .
The tester builds the environment
The developer submits the first version , There may be unfinished functions , To be sure . The tester tests , Find out BUG Submit to BugZilla.
Development commit second version , Include Bug Fix And added some functions , The tester tests .
Repeat the above work , It's usually 3-4 After a version BUG Decrease in the number , Meet the requirements of shipment .
If there is a customer feedback question , Need the help of testers to reproduce and retest .
The testers found BUG, Submitted to the Bugzilla in , Status as new,BUG The recipient of is the developer interface .
The development interface will BUG Assigned to the developer of the relevant module , Status changed to assigned , Developer and test validation BUG, If it's my own BUG, Set to receive ; If it's another developer's problem , Then forward it , It's up to the next developer to do this ; If you don't think it's a problem , We need to discuss and confirm , Refuse this BUG, Then the tester turns off the problem .
If the developer accepts BUG, And after that , take BUG Status changed to fixed , And tell you in which version the test can be tested .
Testers test in the new version , If you find that the problem still exists , The verification is rejected ; If it's fixed , Then close BUG.
Try to communicate face to face , The second is to be able to communicate directly by phone , If only through Email If it's not a timely communication tool , Emphasize that you must have a deep understanding of the characteristics and be able to express them clearly .
Use some test management tools such as TestDirector Management is also a more effective method , At the same time, pay attention to TestDirector Chinese vs BUG There is an accurate description .
Pay attention to the following points in establishing good communication between testers and developers in the team ：
Of course, you can also point out some small problems directly , Instead of entering BUG Tracking System To increase the favor of each other .
Answer this interview question , There is no fixed answer , But maybe many enterprises will ask . Provide the following answers ：
The biggest interest , It feels like a challenging job ;
Testing is an experience industry , The longer you work, the more difficult and fun it is to do a good test
Through their own work , It can make software products more and more perfect , It's fun
Pay attention to the following aspects when answering such questions ：
Express your interest as much as possible in line with the technical route of the recruitment enterprise , For example, the enterprise is a database application enterprise , So show your interest in database testing , And hope to improve their ability to master the database through testing .
Show that the purpose of your test is to improve your ability , It's also for better testing ; Improving capability is not for future development or other purposes , Unless the employer has such an arrangement .
Don't over express your interest in the field of recruitment enterprises . For example, recruitment companies do financial software , But what you show is your interest in game software ; Or recruitment is to do JAVA Developed , And your interest is in C Class language program development .
Finally, for the convenience of everyone to learn the test , I specially prepared a 13G Super practical dry goods learning resources , The content involved is very comprehensive .
Include , Software learning Roadmap ,50 Video of class for many days 、16 It's a real assault project ,80 More than one software for testing ,37 A test document ,70 A software testing related problem ,40 Test experience level article , Thousands of test questions to share , also 2021 Software testing interview Dictionary , There's also a selection of resumes for software testing jobs , I hope that's helpful ……
Follow my official account ：【 Programmer two black 】 You can get this information ！