This document provides solution to the second final exam of the online course Software Testing offered by MHRD. The answers to each questions are marked in red. The pdf format can be downloaded from here.
Section A
- Pick the correct statement from the following:
- Every programming error causes a fault
- Every programming error is caused by a failure
- Every failure is caused by a fault
- Every bug causes a failure
- Why is it necessary to test a large program at three different levels: unit, integration, and system rather than testing only at the system level?
- Reduces the number of test cases that can be designed
- Reduces the test execution effort
- Reduces the debugging effort
- Reduces test case design effort.
- Which one of the following can be considered as a fault-based testing technique?
- Cause-effect graphing
- Data flow testing
- Orthogonal array testing
- Mutation testing
- Among the following test techniques, which one of the following is the strongest testing technique?
- Multiple condition testing
- Decision testing
- Basic condition testing
- MC/DC testing
- Why is all path testing rarely used in practice?
- Too many test cases are required
- Too weak a testing technique
- It is subsumed by basis path testing
- It is subsumed by statement coverage
- Customers typically carry out which of the following types of testing?
- Unit testing
- Integration testing
- Acceptance testing
- Regression testing
- Regression testing needs to be carried out at which of the following levels of testing?
- Unit
- Integration
- System
- At all levels, i.e. at unit, integration, as well as system testing level
- Which one of the following is a suitable unit for testing object-oriented programs?
- Statement
- Method
- Class
- Polymorphism
- If it is required that a a web based application needs to work seamlessly and satisfactorily with Chrome, Mozilla, and Explorer web browsers, which type of performance testing is applicable?
- Stress testing
- Recovery testing
- Compatibility testing
- Configuration testing
- Which one of the following techniques can a manager use estimate the number of errors still remaining in a program after all the testing is over?
- Mutation testing
- Error seeding
- Pair-wise testing
- Cause-effect graphing
Section B
- Code coverage analysis is used to measure:
- Thoroughness of testing
- Testing efficiency
- Quality of code
- Distribution of bugs
- Which one of the following attributes of a program can be inferred from its Cyclomatic complexity?
- Computational complexity
- Lines of code (LoC)
- Executable code size
- Testability
- Which one of the following types of bugs may not get detected in white-box testing, but are very likely to be get detected by white-box testing?
- Syntax errors
- Behavioral errors
- Trojans
- Performance errors
- Beta testing is usually performed by which one of the following?
- Test team
- Development team
- Friendly customers
- Customers
- Suppose a certain function takes 5 Integer input parameters. The valid values for each parameter form a range of integer values. What is the minimum number of test cases required for robust boundary value testing?
- 20
- 25
- 30
- 31
- During which phase of the V model of software development are the integration test cases designed?
- Requirements specification
- High-level design
- Detailed design
- Coding
- If MC/DC coverage has been achieved on a unit under test, which one of the following test coverage is implicitly implied?
- Path coverage
- Multiple condition coverage
- Condition/decision coverage
- Data flow coverage
- In which one of the following integration testing strategies are stubs redundant?
- Top-down
- Bottom-up
- Sandwich
- Both bottom up and Sandwich
- For the following program statement, which one of the following test suites would achieve basic condition coverage?
if (a>10 || b<50) p++;
- (a=20,b=10), (a=0,b=15)
- (a=20,b=10), (a=0,b=15), (a=5,b=45)
- (a=50,b=20), (a=0,b=35)
- (a=50,b=20), (a=1,b=85)
- Which one of the following problems is an obstacle in developing tools to make Mutation testing completely automatic?
- Too many mutants can result
- Some mutants can cause compilation error
- Some mutants may not cause compilation error
- Equivalent mutants
Section C
Consider the following “C” code segment and answer questions 1 to 5 based on this code segment.
int main (){
int a,b=0;
scanf(“%d”,&a);
if( a > 10 || a<0) {
b=b+10;}
else if( a == 20 ){
b=b+20;}
else if( a == 30 ){
b=b+30;}
else{
b=b+40; }
}
- At least how many test cases are needed for the given C code for achieving decision coverage?
- 3
- 4
- 5
- 6
- At least how many test cases are needed for the given C code for achieving basic condition coverage?
- 3
- 4
- 5
- Basic condition coverage is not achievable
- At least how many test cases are needed for the given C code for achieving multiple condition coverage?
- 4
- 6
- 8
- Multiple condition coverage is not achievable
- At least how many test cases are needed for the given C code for achieving MC/DC coverage?
- 3
- 5
- 7
- MC/DC coverage is not achievable
- At least how many test cases are needed for the given C code for achieving basis path coverage?
- 4
- 6
- 8
- Basis path coverage is not achievable
- Non-functional requirements are tested at which of the following levels of testing:
- Unit testing
- Integration testing
- System testing
- Both unit and integration testing
- Consider the following function that takes an integer a (that can assume values between 0 to 100) as argument and carries out the following actions involving setting the value of a variable b.
Condition
|
Action
|
(a<10)||(a>80)
|
b=b+10
|
(a== 30)
|
b=b+20;
|
(a==40)
|
B=b+30;
|
For all other cases
|
B=b+40;
|
During black box testing of the function, how many valid equivalence case test cases are required?
- 4
- 5
- 8
- 10
- Consider the following function that takes an integer a (that can assume values between 0 to 100) as argument and carries out the following actions involving setting the value of a variable b.
Condition
|
Action
|
(a<10)||(a>80)
|
b=b+10
|
For all other cases
|
B=b+40;
|
During black box testing of the function, how many boundary value test cases are required assuming that robust testing is not targetted?
- 4
- 5
- 13
- 17
- Which one of the following is a popular integration testing strategy for large object-oriented programs?
- Top-down
- Bottom-up
- Big-bang
- Use-based
- Suppose an untested program was determined to contain 640 bugs. Three different testing techniques were applied to test the code. Each testing technique is effective to detect 50% of the bugs that exist before the concerned testing technique is applied. While fixing a bug, there is a 50% chance of creating another bug. How many bugs would exist in the code after the three testing and bug-fix cycles are carried out?
- 200
- 270
- 350
- 448