Unit Testing

Description: Unit Testing Quiz
Number of Questions: 15
Created by:
Tags: software engineering unit testing
Attempted 0/15 Correct 0 Score 0

What is the primary goal of unit testing?

  1. To test the entire application as a whole

  2. To test individual units of code in isolation

  3. To test the user interface of the application

  4. To test the performance of the application


Correct Option: B
Explanation:

Unit testing focuses on testing individual units of code, such as functions or methods, in isolation from the rest of the application.

Which of the following is a common unit testing framework in Python?

  1. NUnit

  2. PyUnit

  3. JUnit

  4. MSTest


Correct Option: B
Explanation:

PyUnit is a popular unit testing framework for Python that provides a simple and flexible way to write and run unit tests.

What is the term for a test that checks if a function or method raises an exception when it is called with invalid input?

  1. Exception testing

  2. Error testing

  3. Boundary testing

  4. Negative testing


Correct Option: A
Explanation:

Exception testing involves testing a function or method to ensure that it raises the appropriate exception when it is called with invalid input.

What is the term for a test that checks if a function or method returns the expected output when it is called with valid input?

  1. Positive testing

  2. Happy path testing

  3. Functional testing

  4. Regression testing


Correct Option: A
Explanation:

Positive testing involves testing a function or method to ensure that it returns the expected output when it is called with valid input.

Which of the following is a common unit testing framework in Java?

  1. NUnit

  2. PyUnit

  3. JUnit

  4. MSTest


Correct Option: C
Explanation:

JUnit is a popular unit testing framework for Java that provides a simple and flexible way to write and run unit tests.

What is the term for a test that checks if a function or method returns the expected output when it is called with a variety of different inputs?

  1. Robustness testing

  2. Stress testing

  3. Load testing

  4. Performance testing


Correct Option: A
Explanation:

Robustness testing involves testing a function or method to ensure that it returns the expected output when it is called with a variety of different inputs.

What is the term for a test that checks if a function or method performs as expected under a heavy load?

  1. Stress testing

  2. Load testing

  3. Performance testing

  4. Endurance testing


Correct Option: A
Explanation:

Stress testing involves testing a function or method to ensure that it performs as expected under a heavy load.

Which of the following is a common unit testing framework in C#?

  1. NUnit

  2. PyUnit

  3. JUnit

  4. MSTest


Correct Option: D
Explanation:

MSTest is a popular unit testing framework for C# that provides a simple and flexible way to write and run unit tests.

What is the term for a test that checks if a function or method performs as expected over a long period of time?

  1. Endurance testing

  2. Soak testing

  3. Stability testing

  4. Reliability testing


Correct Option: A
Explanation:

Endurance testing involves testing a function or method to ensure that it performs as expected over a long period of time.

What is the term for a test that checks if a function or method performs as expected when it is called concurrently by multiple threads?

  1. Concurrency testing

  2. Multithreading testing

  3. Parallel testing

  4. Scalability testing


Correct Option: A
Explanation:

Concurrency testing involves testing a function or method to ensure that it performs as expected when it is called concurrently by multiple threads.

What is the term for a test that checks if a function or method performs as expected when it is called in a distributed system?

  1. Distributed testing

  2. Cluster testing

  3. Scalability testing

  4. Resiliency testing


Correct Option: A
Explanation:

Distributed testing involves testing a function or method to ensure that it performs as expected when it is called in a distributed system.

What is the term for a test that checks if a function or method performs as expected when it is called in a cloud environment?

  1. Cloud testing

  2. Elasticity testing

  3. Scalability testing

  4. Resiliency testing


Correct Option: A
Explanation:

Cloud testing involves testing a function or method to ensure that it performs as expected when it is called in a cloud environment.

What is the term for a test that checks if a function or method performs as expected when it is called in a mobile environment?

  1. Mobile testing

  2. Device testing

  3. App testing

  4. Usability testing


Correct Option: A
Explanation:

Mobile testing involves testing a function or method to ensure that it performs as expected when it is called in a mobile environment.

What is the term for a test that checks if a function or method performs as expected when it is called in an embedded system?

  1. Embedded testing

  2. Device testing

  3. Hardware testing

  4. Firmware testing


Correct Option: A
Explanation:

Embedded testing involves testing a function or method to ensure that it performs as expected when it is called in an embedded system.

What is the term for a test that checks if a function or method performs as expected when it is called in a safety-critical system?

  1. Safety testing

  2. Reliability testing

  3. Resiliency testing

  4. Fault tolerance testing


Correct Option: A
Explanation:

Safety testing involves testing a function or method to ensure that it performs as expected when it is called in a safety-critical system.

- Hide questions