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 technology testing
  1. a.) Test a single unit of code

  2. b.)Test a one module of the application

  3. c.)Test a whole application

  4. d.)Test the data, stored in database.

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

Unit testing specifically focuses on testing the smallest testable part of an application - a single unit of code such as a method, function, or class (Option A). It does NOT test entire modules (Option B), whole applications (Option C), or database data directly (Option D) - those are integration or system testing levels.

Multiple choice technology testing
  1. a.) Name of the Class must end with “Test”

  2. b.) Name of the method must start with “test”

  3. c.) Return type of the test method must be “void”

  4. d.) Test method must not have any parameter.

  5. e.) All of the above

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

JUnit framework conventions require: test class names ending with 'Test', test method names starting with 'test', test methods returning void, and test methods having no parameters. All of these conventions (Options A-D) are standard JUnit practices, making Option E correct. These conventions help test runners identify and execute test methods correctly.

Multiple choice technology testing
  1. True

  2. False

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

JUnit does support both static (using test suites and test runners) and dynamic (using JUnit 4's @Test annotation and JUnit 5's @TestFactory) approaches to run single unit tests. The static approach involves explicit test suite creation, while the dynamic approach uses runtime test discovery and execution through annotations.

Multiple choice technology testing
  1. a.) Using the Mock class, related to corresponding Test class

  2. b.) Using the reflection if using Jdk 1.3 or higher version

  3. c.) Both a.) & b.)

  4. d.) No way to test it

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

Private methods can be unit tested using Java Reflection to bypass access modifiers, or by using mocking frameworks and testing subclass/helper structures. Thus, both options are valid approaches.

Multiple choice technology testing
  1. a.) There is no option to test it in Junit

  2. b.) Modifying the testcase to run with SecurityManager that prevents calling System.exit, then catch the SecurityException.

  3. c.) Remove the System.Exit() line then continue the testing with that methods.

  4. d.) Test it everything as-is.

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

To test methods containing System.exit(), you can configure a custom SecurityManager that throws a SecurityException when checkExit is called. The test case can then catch this exception to verify that the exit was triggered without terminating the JVM.

Multiple choice technology testing
  1. a.) Reflection provides the option to do this.

  2. b.) Copy the method content into the testcase methods.

  3. c.) Place your tests in the same package as the classes under test.

  4. d.) Can't do the testing for protected methods.

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

Protected methods can be tested by placing test classes in the same package as the classes under test (Option C), giving tests access to package-protected members. Reflection (Option A) is possible but not the recommended approach. Copying method content (Option B) defeats the purpose of testing. Option D is incorrect because protected methods are testable.

Multiple choice technology testing
  1. The JUnit JAR file.

  2. b.) Location of your JUnit test classes.

  3. c.) Location of classes to be tested.

  4. d.) JAR files of class libraries that are required by classes to be tested

  5. e.) All of the above

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

To run JUnit tests, the CLASSPATH must include: the JUnit JAR file itself (Option A), the location of JUnit test classes (Option B), the location of classes being tested (Option C), and any dependent library JARs (Option D). All four components (Option E) are essential for the test runner to find and execute tests properly.

Multiple choice technology testing
  1. a.) Container class, which used to group multiple test cases into a collection and run them together.

  2. b.) defines test fixture, which contains all the test methods.

  3. c.) interface, which contains the declaration of all the methods, needs to be implemented by Testcases.

  4. d.) None of the above

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

A JUnit TestSuite is a container class (Option A) used to group multiple test cases into a collection and run them together. It does NOT define test fixtures (Option B) - that's the purpose of @Before/@BeforeAll methods. It is NOT an interface (Option C) - TestSuite is a concrete class. Option D is incorrect because Option A accurately describes TestSuite functionality.

Multiple choice technology web technology
  1. (A)Version

  2. (B)Update

  3. (C)Help

  4. (D)Patch

  5. (E)Syntax

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

A patch is a small piece of software designed to fix bugs, defects, or security vulnerabilities. Unlike major version updates or upgrades, patches are typically focused fixes provided free of charge by software vendors to maintain software stability and security.

Multiple choice technology testing
  1. black-box testing

  2. white-box testing

  3. behavioural testing

  4. grey-box testing

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

White-box testing (also called glass-box, clear-box, or structural testing) examines the internal structure, design, and coding of software. It requires the tester to have knowledge of the internal code and logic to design test cases that exercise different paths, branches, and conditions within the module. This is in contrast to black-box testing, which focuses on inputs and outputs without knowledge of internal code.

Multiple choice technology testing
  1. Checking that we are building the right system

  2. Performed by an independent test team

  3. Making sure that it is what the user really wants

  4. Checking that we are building the system right

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

Verification is the process of checking that we are building the system right - meaning it meets the specified requirements and technical specifications. It answers the question: Are we building the product correctly? This is different from validation, which checks that we are building the right system (whether it meets user needs and expectations).

Multiple choice technology testing
  1. Path Testing

  2. Data flow testing

  3. Statement testing

  4. State Transition testing

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

State Transition testing is a black-box testing technique that models system behavior as states and transitions between them. It focuses on the system's external behavior rather than internal code structure. In contrast, Path Testing, Data flow testing, and Statement testing are all white-box techniques that require knowledge of the internal code logic and structure.

Multiple choice technology testing
  1. System Testing

  2. Smoke Testing

  3. Sanity Testing

  4. Performance Testing

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

Smoke Testing (also called build verification testing) is performed to verify that the most critical functions of an application work properly without failing, ensuring the build is stable enough for further detailed testing. It acts as a preliminary check to decide whether to proceed with more comprehensive testing. Sanity Testing is similar but focuses on a specific functional area after a regression.

Multiple choice technology testing
  1. One

  2. More than two

  3. Two

  4. Three

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

The two main techniques in Black-box testing are Equivalence Partitioning and Boundary Value Analysis. Equivalence Partitioning divides input data into groups expected to be treated similarly, while Boundary Value Analysis focuses on testing at the boundaries between these partitions. These are foundational black-box testing methods.