Changes for page Testing Principles
Last modified by chrisby on 2024/04/01 12:52
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -12,7 +12,7 @@ 12 12 * **Single Action Execution**: The entire setup and testing process should require a single click or shell command. Otherwise, they will not be used regularly, which reduces the quality assurance of the production code. 13 13 * **Independence**: Tests should be independent and not influenced by other tests; the order in which tests are executed should not matter. 14 14 * **Clean Test Code**: Maintain the same high standards for test code as for production code. The only exception is execution speed - tests need to be fast, but not highly optimized. 15 -* **Easy Bug Tracing**: Failed tests should clearly indicate the location and reason for the failure. Measures to achieve this __could__include using only **one assertion per test**, using **error logs**, and using **unique exceptions and error messages** where appropriate.15 +* **Easy Bug Tracing**: Failed tests should clearly indicate the location and reason for the failure. Measures to achieve this could include using only **one assertion per test**, using **error logs**, and using **unique exceptions and error messages** where appropriate. 16 16 * **Test behavior, not implementation.** Always run tests against interfaces from production code to test the implementation behind them. The developer should be free to modify the code as long as it produces the correct results. This also reduces the coupling between test and production code, resulting in less work to adapt tests when the implementation changes. Avoid reflection and weakening encapsulation by making private things public. However, weakening encapsulation is a lesser evil than not testing at all. 17 17 * **'Program testing can be used to show the presence of bugs, but never show their absence!' **(Edsger W. Dijkstra). 18 18 ** Follow good testing practices to avoid a large number of bugs, but be aware that bugs may still occur and be prepared for them.