Computer Knowledge

Software Testing and Quality Control

2,598 Questions

Software testing and quality control questions cover testing methodologies, unit testing, and defect management. These concepts are crucial for the computer knowledge sections of competitive exams. Practice these questions to understand verification and validation processes thoroughly.

Quality control typesUnit testing purposeSoftware vulnerability testingTest planning tasksLoop testing criteriaTest harness functions

Software Testing and Quality Control Questions

Multiple choice
  1. Fuzz testing

  2. Grey box testing

  3. White box testing

  4. Visual testing

  5. Black box testing

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

White box testing tests internal structures or workings of a program. In white box testing, an internal perspective of the system as well as programming skills are used to design test cases. The tester chooses inputs to exercise paths through the code and determine the appropriate outputs.

Multiple choice
  1. Requirement analysis

  2. Feasibility study

  3. Debugging

  4. Beta testing

  5. Designing

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

A debugger or debugging tool is a computer program that is used to test and debug other programs. Assertions provide a very powerful tool in debugging.

Multiple choice
  1. Black box testing

  2. White box testing

  3. Usability testing

  4. Stress testing

  5. Load testing

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Equivalence partitioning is generally related to black box testing, which is strictly checking a software component at its interface, without consideration of internal structures of the software.

Multiple choice
  1. test plan

  2. traceability matrix

  3. test case

  4. test script

  5. test suite

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

A test script is a procedure, or programing code that replicates user actions. Initially the term was derived from the product of work created by automated regression test tools. Test Case will be a baseline to create test scripts using a tool or a program.

Multiple choice
  1. System testing

  2. Compatibility testing

  3. Regression testing

  4. Load testing

  5. Security testing

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Regression tests can be broadly categorized as functional tests or unit tests. Functional tests exercise the complete program with various inputs. Unit tests exercise individual functions, subroutines, or object methods. Both functional testing tools and unit testing tools tend to be third-party products that are not part of the compiler suite, and both tend to be automated.

Multiple choice
  1. Developmental testing and evaluation

  2. Operational test and evaluation

  3. Decision support systems

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Operational testing and evaluation activities are typically conducted on large, complex systems such as aircraft and military acquirer activity systems.

Multiple choice
  1. Line 11

  2. Line 12

  3. Line 14

  4. Line 22

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Assert statements should not cause side effects. Line 22 changes the value of z if the assert statement is false. Option A is fine; a second expression in an assert statement is not required. Option B is fine because it is perfectly acceptable to call a method with the second expression of an assert statement. Option C is fine because it is proper to call an assert statement conditionally.

Multiple choice
  1. Assertion expressions should not contain side effects.

  2. Assertion expression values can be any primitive type.

  3. Assertions should be used for enforcing preconditions on public methods.

  4. An AssertionError thrown as a result of a failed assertion should always be handled by the enclosing method.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Option A is correct. Because assertions may be disabled, programs must not assume that the boolean expressions contained in assertions will be evaluated. Thus these expressions should be free of side effects. That is, evaluating such an expression should not affect any state that is visible after the evaluation is complete. Although it is not illegal for a boolean expression contained in an assertion to have a side effect, it is generally inappropriate, as it could cause program behaviour to vary depending on whether assertions are enabled or disabled. Assertion checking may be disabled for increased performance. Typically, assertion checking is enabled during program development and testing and disabled for deployment. Option B is wrong. Because you assert that something is "true". True is Boolean. So, an expression must evaluate to Boolean, not int or byte or anything else. Use the same rules for an assertion expression that you would use for a while condition. Option C is wrong. Usually, enforcing a precondition on a public method is done by condition-checking code that you write yourself, to give you specific exceptions. Option D is wrong. "You're never supposed to handle an assertion failure" Not all legal uses of assertions are considered appropriate. As with so much of Java, you can abuse the intended use for assertions, despite the best efforts of Sun's Java engineers to discourage you. For example, you're never supposed to handle an assertion failure. That means don't catch it with a catch clause and attempt to recover. Legally, however, AssertionError is a subclass of Throwable, so it can be caught. But just don't do it! If you're going to try to recover from something, it should be an exception. To discourage you from trying to substitute an assertion for an exception, theAssertionError doesn't provide access to the object that generated it. All you get is the String message.

Multiple choice
  1. This program will compile successfully.

  2. This program fails to compile due to an error at line 4.

  3. This program fails to compile due to an error at line 6.

  4. This program fails to compile due to an error at line 13.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Any method (in this case, the main() method) that throws a checked exception (in this case, out.close() ) must be called within a try clause, or the method must declare that it throws the exception. Either main() must declare that it throws an exception, or the call to out.close() in the finally block must fall inside a (in this case nested) try-catch block.