DEV Community

Discussion on: Getting Started with Test Driven Development

Collapse
 
mattconway1984 profile image
Matthew Conway

Depends on the implementation, I write a lot of multi threaded code and functions which spawn threads to run control loops, they are very difficult to TDD, in fact, I would say, impossible! You end up writing tests that are more complex than the code itself and completely tie down the implementation, so they are not good tests. You can exploit encapsulation by exposing "hidden" implementation.

Collapse
 
danielfoxp2 profile image
danielfoxp2

Inside each thread there is sequential code, right? What is the impossibility to implement these sequentials code using TDD?