Changes for page Test Speedup

Last modified by chrisby on 2025/03/08 11:39

From version 1.6
edited by chrisby
on 2023/10/28 10:57
Change comment: There is no comment for this version
To version 1.7
edited by chrisby
on 2023/11/04 10:56
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -4,12 +4,12 @@
4 4  === Measures ===
5 5  
6 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 -* **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.
7 +* **Selective Testing**: You don't need to run all tests every time. It can be sufficient to run only the tests related to recently changed code, or only the fast tests, and then run all the tests when you finished a major implementation step.
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.
10 10  * **Identify performance bottlenecks** by increasing the number of threads:
11 11  ** If execution time remains constant, CPU is the bottleneck. Mitigate with faster CPUs, more cores, or additional machines.
12 -** If execution time decreases, I/O is the bottleneck. Use more threads, faster storage (such as SSDs), or additional storage for concurrent persistence operations.
12 +** If execution time decreases, I/O is the bottleneck. Use more threads, faster storage (such as SSDs), or additional storage for concurrent filesystem operations.
13 13  * **Improve I/O speed by using RAM disks**, such as Linux's tmpfs tool. Configure your tests to direct all file interactions to the RAM disk.
14 14  * **Parallelize test execution.** Multiple threads can improve execution speed even on single-core processors by keeping the CPU busy while other threads wait for disk I/O.
15 15  * **Offload CPU-intensive tasks** to cloud-based computing resources: