~/talk

Unit testing patterns for Concurrent code

Talkat Update Conference Prague 2019 · 2019-11-14..11-15· [testing]
slides:none on file

Practical rules and concrete techniques for deterministic tests: prefer the humble object pattern to extract logic away from threads; replace System.Timers.Timer with a wrapped ITimer or a fake (demonstrated with TypeMock Isolator) to drive ticks deterministically; use a custom TaskScheduler trick or DI so tasks run synchronously in tests; coordinate with ManualResetEventSlim (signal pattern) or a busy-assert loop that polls until timeout. Slides and runnable examples live on the referenced GitHub.

AI-written summary · about

  1. 0:00Intro
  2. 2:40Meanwhile in the unit testing "world"
  3. 3:24The dark art of concurrent code
  4. 10:47Concurrency test smells
  5. 14:19Test smell – using "Sleep" in test
  6. 17:13Humble object pattern
  7. 18:45Concurrency as part of program flow
  8. 20:12"Avoid concurrency" Patterns
  9. 24:52Using Typemock Isolator to fake Timer
  10. 33:33Running code in "test mode"
  11. 34:33Run in single thread patterns
  12. 41:08Synchronized test patterns
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.