Writing “unit testable” code?

2019-01-16 04:02发布

What kind of practices do you use to make your code more unit testing friendly?

19条回答
姐就是有狂的资本
2楼-- · 2019-01-16 04:54

The easiest way is don't check in your code unless you check in tests with it.

I'm not a huge fan of writing the tests first. But one thing I believe very strongly in is that code must be checked in with tests. Not even an hour or so before, togther. I think the order in which they are written is less important as long as they come in together.

查看更多
登录 后发表回答