Software Testing Concepts: Difference between revisions
Line 9: | Line 9: | ||
=Unit Test= | =Unit Test= | ||
Unit testing is the testing of the smallest possible part of software, such a single method, a small set of related methods or a class. In reality we test logical units - which can extend to a method, a single class or multiple classes. | Unit testing is the testing of the smallest possible part of software, such a single method, a small set of related methods or a class. In reality we test logical units - which can extend to a method, a single class or multiple classes. A unit test has the following characteristics: | ||
* It should be [[#Automated_Test|automated]]. | |||
* It should be fast - not more that a few milliseconds to finish execution. | |||
* It should not depend on the result of another test or on the execution order. Unit test should be self-contained and runnable in isolation, and then in any order as part of the test suite. | |||
* It should not depend on database access, file access or any long running task. If the presence of external dependencies are necessary to test the logic, they should be provided as [[#Test_Double|test doubles]]. | |||
=Test Double= |
Revision as of 00:13, 16 July 2021
Internal
Overview
Automated testing provides an effective mechanism for catching regressions, especially when combined with test-driven development.
Test-Driven Development
Automated Test
An automated test verifies an assumption about the behavior of the system and provides a safety mesh that is exercised continuously, again and again, in an automated fashion, in most cases on each commit in the repository. The benefits of automated testing and that the software is continuously verified, maintaining its quality. Another benefit of tests is that they serve as documentation for code.
Unit Test
Unit testing is the testing of the smallest possible part of software, such a single method, a small set of related methods or a class. In reality we test logical units - which can extend to a method, a single class or multiple classes. A unit test has the following characteristics:
- It should be automated.
- It should be fast - not more that a few milliseconds to finish execution.
- It should not depend on the result of another test or on the execution order. Unit test should be self-contained and runnable in isolation, and then in any order as part of the test suite.
- It should not depend on database access, file access or any long running task. If the presence of external dependencies are necessary to test the logic, they should be provided as test doubles.