문제

I have a few methods that are impacted by concurrency. Specifically "Rush" (a.k.a Race) conditions. Should I unit test them or integrate/black-box test them?

I think that setting up a unit test might be a rather difficult task, but also is integration test...

도움이 되었습니까?

해결책 2

i've found this article and its quite instructive about my question: https://testing.googleblog.com/2014/02/minimizing-unreproducible-bugs.html

다른 팁

Unit tests must be deterministic, so concurrency doesn't belong there. (I keep my unit tests completely synchronous.)

Go for integration tests to sniff out race conditions — but be prepared for false positives. In other words, the tests passing is no proof that you don't have a race condition. But a failure will alert you to something you need to fix.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top