Final review of software testing (1) test questions and answers

1. Multiple choice questions (2 points for each blank, 40 points in total)

1. The purpose of software testing: (c)
A. Avoid errors in software development
B. Discover errors in software development
C. Find and eliminate potential errors in software as much as possible to improve software reliability
D. Modify software that occurs Mistake
2. Software testing is the activity of (a) executing software.
A.test case
b. input data
c. test environment
d. Input condition
3. The biggest cause of software defects is: (a)
A. Software requirements specification
b. Design plan
C. coding
D.Maintenance
4. In the following description, the error description about the complete change of a software defect state is (d)
A. Open——Repair——Close
B, Open——Close
C, Open—Reserve
D, Activate——Repair— —Reopen
5. In the following description, the statement about testing and debugging is wrong (d)
A. Testing is the act of showing errors; debugging is the process of reasoning;
B. Testing shows developers' mistakes. Debugging is for developers to defend themselves;
C, testing can be expected and controlled. Debugging requires imagination, experience and thinking;
D. The test must be started after the detailed design has been completed; debugging is impossible without detailed design information.
6. A certain program debugging did not produce the expected result, and the following (b) cannot be the cause of the error.
A.The variable is not initialized b. The writing format of the written statement is not standardized
C.Loop control error D. Incorrect code input
7. The most costly phase of software defect repair is (a)
A, release phase B, requirement phase
C, design phase D, coding phase
8, which does not belong to the logic coverage method (d).
A.Combined coverage b. Judgment coverage
C. condition coverage d. Interface coverage
9. (d) is to select several test cases and run the program under test so that each executable statement in the program is executed at least once.
A. Condition coverage B. Combination coverage
C. Decision coverage D. Statement coverage
10. (a) is to design enough test cases so that all situations (true/false) of each condition contained in each decision in the program occur at least once, and each decision's own decision result (true/false) also occurs at least once.
A. Judgment - condition coverage B, combination coverage
C, decision coverage D, condition coverage
11. Software testing is an important means of software quality assurance. Which of the following tests is the most basic part of software testing? ( b )
A. functional testing
b. unit test
c. Structural testing
d. Acceptance testing
12. The main task of unit testing does not include (b).
A.Error handling b. global data structures
c. independent path d. Module interface
13, the NS diagram shown in the figure below, at least (b) test cases are required to complete the logic coverage.

A.12 B.48
C.27 D.18
14. The unit test is used to simulate other functional modules that need to be called by the module under test (b).
A.drive module b. Pile module
C. Main control module D.The real called module
15 and the integration test plan should be submitted at the end of (b) stage.
A. Requirements analysis B. Outline design
C. Detailed design D. Unit test completed
16. Which of the following descriptions about program efficiency is wrong (c).
A.Increasing the execution speed of the program can improve the efficiency of the program
B. Reducing the storage space occupied by the program can improve the efficiency of the program
C. The efficiency of the source program is independent of the efficiency of the algorithm determined in the detailed design phase
D. Good program design can improve efficiency
17. The following (b) is obtained by simplifying the program flow chart, which can more prominently represent the structure of the program control flow, and does not contain compound conditions.
A.DD-path diagram B. control flow graph
c. MM-path map D. Module call Figure
18, bottom-up incremental integration test, the following (c) description is correct.
A.The test is controlled by the stub module
B. The top module is tested first
C. The parent unit is tested with the tested child unit
D. Include the depth-first or breadth-first traversal process of the tree
19. The number of bugs remaining in the program after testing is proportional to the number of bugs found in the program (d).
A.Unknown B.Inverse ratioC
. equal D.Proportional
20. For whether to test for invalid data, the equivalence class test can be divided into (b)
1) Standard (general) equivalence class test
2) Robust equivalence class test
3) Weak equivalence class test
4) Strong equivalence class test
A. 3) 4) b. 1) 2)
C.1) 3) D.2) 4)

2. True or false questions (1 point for each blank, 20 points in total)

1. The number of paths contained in a program is directly related to the complexity of the program. ( ∨ )
2. Structural testing is to design test cases according to software specifications. (x)
3. The wrong guessing method is to design test cases according to the dependence of the output on the input. (x)
4. Software defect attributes include defect identification, defect type, defect severity, defect possibility, defect priority, defect status, defect origin, defect source, and defect cause. (∨ )
5. For a program containing n variables, using the boundary value robustness test method to test the program will generate 6n+1 test cases. (∨)
6. The data flow test is mainly used for the authenticity check of the path test. The two forms are definition/use testing and program-based testing. (∨ )
7. As long as the software has passed strict and rigorous internal testing, it can be free from defects. (x)
8. The test case should consist of two parts: test input data and corresponding actual output results. (x)
9. The test can be exhausted. (x)
10. Test automation is omnipotent. (x)
11. Software defects may be repaired, retained or marked. (∨)
12. Each software project has an optimal test volume. ( ∨ )
13. Black-box testing often causes serious redundancy and untested functional loopholes between test cases. (∨)
14. Code review is a static test. (∨)
15. Software testing is a process that includes several activities, and running software for testing is only one of the activities. (∨ )
16. Regression testing is the test case used to execute the program to find errors before running again after the software is modified. ∨
17. Integration testing is to determine whether the software system meets the acceptance criteria and make the customer decide whether to accept it. Formal test for . ( x )
18. The test can be divided into unit test, integration test and system test according to the test level. (∨)
19. As long as 100% logic coverage can be achieved, the correctness of the program can be guaranteed. (x)
20. Always-defective types are found at one level of testing and are able to evade detection at another level. (∨ )

3. Short answer questions (5 points for each blank, 20 points in total) Score reviewers

1. What qualities should a good software testing engineer possess?
Answer: Have the spirit of exploration, have a good foundation in computer programming, be good at troubleshooting, persevere, have the spirit of innovation and advance awareness, pursue perfection, make accurate judgments, have an overall concept, be sensitive to details, have teamwork spirit, and have communication skills

2. There is a binary function f(x,y), where x∈[1,12], y∈[1,31]; please write a test case for this function designed using the basic boundary value analysis method.
Answer: { <1,15>, <2,15>, <11,15>, <12,15>, <6,15>, <
6,1>, <6,2>, <6,30> , <6,31> }

3. What are the advantages and disadvantages of black-box testing and white-box testing, and how should they be combined to solve the problems of loopholes and redundancy?
Answer: Functional testing has two advantages: functional testing has nothing to do with how the software is implemented; test case development can be carried out in parallel with implementation, so the total project development time can be compressed. Disadvantages: There may be serious redundancy between test cases, and there will be software vulnerabilities for bit tests. Structural testing is limited to the completed code behavior, too close to the code. Therefore, structural test indicators can be used to solve the problem of redundancy and vulnerability. If it is found that the same program path is traversed by multiple functional test cases, it can be suspected that this redundancy will not cause new defects. If a certain DD-path coverage is not reached, it can be known that there are loopholes in the functional test effort. Path testing can therefore provide a set of metrics that are cross-checked by functional testing.

4. There is a program as follows, please design a test case to meet the statement coverage requirements.

void  DoWork (int x,int y,int z)
{
    
    
   int  k=0,j=0;
   if ( (x>3)&&(z<10) )
   {
    
       k=x*y-1;  
       j=sqrt(k);  
   }               //语句块1 
   if ( (x==4)||(y>5) )d
   {
    
      j=x*y+10;   } //语句块2 
   j=j%3;          //语句块3
}

Answer: To achieve the statement coverage of the DoWork function, you only need to design a test case to cover all executable statements in the program. The test case input is: { x=4, y=5, z=5 }

4. Comprehensive questions (10 points for each blank, 20 points in total) Score reviewers

1. Use the basic path test method to design test cases for the following program segments.
(1) Draw the control flow diagram of the program, the number has been given.
(2) Calculate the cyclic complexity of the program, and derive the number of independent paths in the basic path set of the program.
(3) Deriving the basic path set to determine the independent path of the program.
(4) According to the independent path in (3), design the input data and expected output of the test case (to ensure the execution of each path in the basic path set).

       void Do (int X,int A,int B)
       {
    
    
 1       if ( (A>1)&&(B=0) )
 2           X = X/A;
 3       if ( (A=2)||(X>1) )
 4           X = X+1;
 5    }

Since the control flow graph assumes a single condition, for compound conditions, it can be decomposed into multiple single conditions and mapped into a control flow graph.
1: A>1; 2: B=0; 3: X = X/A; 4: A=2; 5: X>1; 6: X = X+1; 7: }

Answer:
1. Draw a control flow graph: as shown in the figure below
insert image description here

2. Calculate the circular complexity:
10 (edges) - 7 (nodes) + 2 = 5
3. Deriving an independent path (indicated by the statement number)
The independent path refers to the multiple executions from the entry to the exit of the program, each At least one statement is new and has not been repeated each time, that is, at least one arc that has never been traversed each time.
Path 1: 1→2→3→4→5→6→7
Path 2: 1→4→5→6→7
Path 3: 1→2→4→6→7
Path 4: 1→2→4→5 →7
path 5: 1→2→3→4→5→7
4. Test cases
insert image description here

2. Scenario requirements: "... For machines with a power greater than 50 horsepower, incomplete maintenance records, or machines that have been in operation for more than 10 years, priority maintenance treatment should be given..." . It is assumed here that both "incomplete repair records" and "priority repair processing" have been more strictly defined elsewhere. Please create a decision table.
(1) Determine the number of rules.
(2) List all condition stubs and action stubs.
(3) Fill in the condition items.
(4) Fill in the action items to get the initial decision table.
(5) Simplify the decision table and merge similar rules.
Answer:
(A && B)|| C
①Determine the number of rules: There are 3 conditions here, and each condition has two values, so there should be 2 2 2=8 kinds of rules.
② List all condition piles and action piles:
insert image description here

③ Fill in the condition item. It can be filled up line by line starting from the condition item in the last line.
For example, the third line is: YNYNYNYN
The second line is: YYNNYYNN
and so on.
④ Fill in the action item. In this way, the initial decision table in the form of the figure is obtained.

insert image description here

⑤ Simplify. The resulting graph is obtained after merging the similarity rules.

insert image description here

Guess you like

Origin blog.csdn.net/L6666688888/article/details/128479691
Recommended