Changes for page Test Speedup
Last modified by chrisby on 2025/03/08 11:39
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,9 +1,9 @@ 1 -Fast -executing testsrequirelesstimeandareexecutedmore frequently,contributing to improved code quality.Thereforeahigh test execution speedisbeneficial.1 +Fast testing not only saves time, but also enables more frequent execution, leading to improved code quality. Optimizing and managing the speed of test execution is therefore critical. While extensive and frequent testing is ideal, it shouldn't excessively slow the pace of development. 2 2 3 3 4 4 === Measures === 5 5 6 -* **Test type segregation**: ypicallyrun much faster than other types of tests. For large test suites, consider running unit tests regularly on the developer's local machine, while scheduling more resource-intensive teststorunat a fixedrate in acontinuous integration environment,for example.6 +* **Test type segregation**: Unit tests tend to run much faster than other types of tests. For large test suites, you should consider running unit tests regularly on the developer's local machine, while scheduling more resource-intensive tests in a CI environment. The CI environment can, for example, run the slower tests in parallel and notify you just in case something fails. If the tests take too long for this approach, you can run them at a fixed rate, usually once a day at midnight. 7 7 * **Partial testing**: You don't have to run all tests every time. Often, it is sufficient to run only the tests related to recently changed code. 8 8 * **Mock slow dependencies** to minimize code execution time, especially operations such as I/O, transaction management, and networking. 9 9 * **Prefer in-memory databases during testing** for cleaner and faster operations compared to standard databases.