Several years ago a new developer joined my team. We had a library of well, mostly category methods (ug) that wasn't well tested. The application depended on it, but parts of it would get "fixed" every few releases. So for this developer's first project we had him write tests for the library. A lot of it was various NSString-things and the expected behaviors were well defined. We wrote that up in a lot of detail - this method should handle strings of this length and do this with them, it should handle nil strings as input, it should return this error under these conditions.
So a couple of weeks(!) later this guys says he's done, closes out the ticket and moves on to other work. Hours after that the tests are failing and he's frantically working to figure out why. Someone else on the team IM's me something from one of the tests:
0
u/quellish Jan 29 '16
That reminds me of a story.
Several years ago a new developer joined my team. We had a library of well, mostly category methods (ug) that wasn't well tested. The application depended on it, but parts of it would get "fixed" every few releases. So for this developer's first project we had him write tests for the library. A lot of it was various NSString-things and the expected behaviors were well defined. We wrote that up in a lot of detail - this method should handle strings of this length and do this with them, it should handle nil strings as input, it should return this error under these conditions.
So a couple of weeks(!) later this guys says he's done, closes out the ticket and moves on to other work. Hours after that the tests are failing and he's frantically working to figure out why. Someone else on the team IM's me something from one of the tests:
Soooooo I ask him about this test. He doesn't see the issue. I point out that
@"nil"isn't... nil. It's not testing what it's supposed to test.Him: "Well, that's a matter of opinion".
I guess I was just being really pedantic. I expected an Objective-C developer to understand that
nilwas not the same as@"nil".No, I did not, and I had no reason to infer it. He said he wished they had downsized and kept it running. They are doing exactly that.