What is the purpose of unit testing? Who performs it? How is the test data prepared?
What is the difference between unit testing and integration testing?
What are the objectives of integration testing?
What distinguishes integration testing from system testing? What kinds of tests can be included in
system testing?
The purpose of unit testing
Full Answer Section
How is the test data prepared?
The test data for unit testing is typically created by the developers who wrote the code. The test data should be representative of the data that the code will be used with in production. For example, if the code is a function that calculates the factorial of a number, the test data should include a variety of different numbers.
What is the difference between unit testing and integration testing?
Unit testing and integration testing are two different types of software testing. Unit testing focuses on testing individual units of code, while integration testing focuses on testing how different units of code interact with each other.
The main difference between unit testing and integration testing is the level of granularity. Unit testing is more granular, as it focuses on individual units of code. Integration testing is less granular, as it focuses on how different units of code interact with each other.
What are the objectives of integration testing?
The objectives of integration testing are to:
- Verify that different units of code can interact with each other correctly.
- Identify errors in the interaction between different units of code.
- Ensure that the system is working as expected.
- Functional tests: These tests verify that the system is working as expected.
- Performance tests: These tests verify that the system can handle the expected load.
- Security tests: These tests verify that the system is secure from unauthorized access.
- Usability tests: These tests verify that the system is easy to use.
Sample Answer
What is the purpose of unit testing?
Unit testing is a software testing method by which individual units of source code, such as individual functions or methods, are tested to determine whether they are working as expected. The purpose of unit testing is to find errors in the smallest units of code possible, so that they can be fixed before they cause problems in larger units of code.
Who performs it?
Unit testing is typically performed by the developers who wrote the code. This is because the developers have the best understanding of how the code is supposed to work. However, unit testing can also be performed by other members of the software development team, such as quality assurance engineers.