Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | * **Ultimate Goal**: Reduce costs and increase productivity. | ||
| 2 | * **Definition 'Production Code':** Code that provides functionality to meet project requirements. | ||
| 3 | * **Definition 'Test Code':** Often referred to as "tests", it is written to verify the correct functionality of the production code. | ||
| 4 | |||
| 5 | === === | ||
| 6 | |||
| 7 | === Benefits of Testing === | ||
| 8 | |||
| 9 | * **Quality Assurance** | ||
| 10 | ** **Automated Testing**: Minimizes the need for human source code checking or manual testing, providing a cost-effective way to ensure continuous quality assurance and the correct functioning of software at all times. | ||
| 11 | ** **Early Feedback**: Tests provide immediate bug feedback. This is especially true for detecting accidentally introduced bugs caused by code changes. The earlier bugs are detected, the cheaper they are to fix. | ||
| 12 | ** **Bug Location Detection**: Tests identify bug locations, saving debugging time. | ||
| 13 | * **Testable Design** | ||
| 14 | ** Writing tests automatically enforces design best practices, resulting in a 'testable design' and higher quality code. Good code and architecture are testable, and vice versa. | ||
| 15 | * **Documentation** | ||
| 16 | ** Tests serve as the most current form of code documentation, capturing the expected behavior of the production code in its present state. | ||
| 17 | |||
| 18 | === === | ||
| 19 | |||
| 20 | === What should be tested? === | ||
| 21 | |||
| 22 | Every functionality you expect the software to provide at any moment. You should test: | ||
| 23 | |||
| 24 | * **User Cases** | ||
| 25 | ** Defined in project requirements | ||
| 26 | ** Use cases derived from the high-level project use cases. For example, expected behavior of functions, classes, modules and components that the user does not see. | ||
| 27 | * **Border cases** that could theoretically always occur, such as maximum/minimum values, nulls, invalid input, nulls, negative numbers, empty lists, values with special meaning, exceptions, etc. |