Discussion about this post

User's avatar
John Thompson's avatar

I'm curious about how the coding agents do with multi-threaded programming and testing, and then, multi-process system testing. I've done a lot of both of these, and both the writing and the testing. In fact, I've authored (and taught a lot of) C++ classes on both and you see a lot doing that. Once, I had a colleague tell me his solution for a tricky multi-threading challenge _was_ _correct_ he said "because I tested it". I had to point out to him that you really cannot _prove_ correctness of multi-threaded code by testing -- you can only "prove" that you were unable to break it under controlled circumstances :) Literally, multi-threaded code will fail because of milli-second (ok, micro?) differences in conflicting data access by competing threads often (usually) under OS control, and NOT your own. In addition to thread-conflict causing logic errors, mutexed code can straight-up deadlock. Oops. And yet, the last thing you want is heavily, needlessly mutexed code due to its performance penalties. (Which is one reason, in Java, I shy away from the synchronized collections - they promise to be thread-safe, but I feel it's often possible to encapsulate such actions in one's own crafted "owner thread" and judiciously manage the mutexing. Mutexing is expensive, did I say?) So, referring back to my "teaching" days -- I always told my students they must master these concepts because "you cannot prove multi-threaded code to be error-free through testing -- the quality has to be designed in from the start." (That said, nothing wrong with driving the logic through a million iterations or so looking for trouble!) So, as I began, I wonder how the agents handle all this, especially standing up multi-process system testing.

No posts

Ready for more?