阅读背景:

我的代码与其环境强烈交互。我应该打扰单元测试吗?

来源:互联网 

Code I'm working on collects performance data (eg CPU usage) from the operating system. I'm wondering if I should bother to attempt to unit test this code. It seems that to unit test code, you need to design code that is isolated into units. My code is so closely tied to the OS though that if I isolated the code out that interacts with the OS into a wrapper that I could mock out, there wouldn't be much left to test.Code I'm working on collects performance data (




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: