@@ -85,7 +85,8 @@ Race conditions
85
85
` putAll() ` under the lock?] ( #synchronized-collection-iter )
86
86
87
87
Testing
88
- - [ Considered adding multi-threaded unit tests for a thread-safe classes?] ( #multi-threaded-tests )
88
+ - [ Considered adding multi-threaded unit tests for a thread-safe class or method?
89
+ ] ( #multi-threaded-tests )
89
90
- [ What is the worst thing that might happen if the code has a concurrency bug?
90
91
] ( #multi-threaded-tests )
91
92
- [ A shared ` Random ` instance is * not* used from concurrent test workers?] ( #concurrent-test-random )
@@ -747,12 +748,12 @@ collections.
747
748
748
749
<a name =" multi-threaded-tests " ></a >
749
750
[ #] ( #multi-threaded-tests ) T.1. ** Was it considered to add multi-threaded unit tests for a
750
- thread-safe classes ?** Single-threaded tests don't really test the thread safety and concurrency.
751
- Note that this question doesn't mean to indicate that there * must* be concurrent unit tests for
752
- every piece of concurrent code in the project because correct concurrent tests take a lot of effort
753
- to write and therefore they might often have low ROI.
751
+ thread-safe class or method ?** Single-threaded tests don't really test the thread safety and
752
+ concurrency. Note that this question doesn't mean to indicate that there * must* be concurrent unit
753
+ tests for every piece of concurrent code in the project because correct concurrent tests take a lot
754
+ of effort to write and therefore they might often have low ROI.
754
755
755
- ** What is the worst thing that might happen if this code has a concurrency bug?** is a useful
756
+ ** What is the worst thing that might happen if this code has a concurrency bug?** This is a useful
756
757
question to inform the decision about writing concurrent tests. The consequences may range from a
757
758
tiny, entirely undetectable memory leak, to storing corrupted data in a durable database or
758
759
a security breach.
0 commit comments