Testing approach for multi-threaded software

前端 未结 6 1398
暖寄归人
暖寄归人 2020-12-25 08:43

I have a piece of mature geospatial software that has recently had areas rewritten to take better advantage of the multiple processors available in modern PCs. Specifically

6条回答
  •  我在风中等你
    2020-12-25 09:29

    As Len Holgate mentions, I would suggest refactoring (if needed) and creating interfaces for the parts of the code where different threads interact with objects carrying a state. These parts of the code can then be tested separate from the code containing the actual functionality. To verify such a unit test, I would consider using a code coverage tool (I use gcov and lcov for this) to verify that everything in the thread safe interface is covered.

    I think this is a pretty convenient way of verifying that new code is covered in the tests. The next step is then to follow the advice of the other answers regarding how to run the tests.

提交回复
热议问题