News for hackers. Stuff that matters.
Re:Write tests. Not too many. Mostly integration by TeMPOraL on Friday October 27, 2017 @03:54AM (#15566476)
I strongly agree with that, too. My current, experience-born belief is that if the only reason for introducing some architectural pattern is to accommodate testing better, the change is wrong and will likely hurt the code quality. Yes, you need to concede a little bit to allow for test points, but turning your code inside-out to have it go through three layers of indirection so that the middle one can be mocked easily? That's just stupid.
Re:Write tests. Not too many. Mostly integration by afarrell on Friday October 27, 2017 @06:46AM (#15567173)
yea, you should be changing code style to increase modularity in a way that is conceptually coherent in terms of what is easy to hold in your head. Increased testability should fall out of that because you can think through "What invariant should hold true about X under conditions/inputs Y1...Y4?"
Re:Write tests. Not too many. Mostly integration by hinkley on Friday October 27, 2017 @12:39PM (#15569980)
Code you can hold in your head usually has a smaller surface area. Fewer moving parts equals easier testing.