Cnfzh 软件博客

单元测试的性价比边界

不是所有代码都值得测试,也不是测试越多越好。

值得测的

边界条件、金额计算、状态机。这些地方出错代价最高。

不值得测的

Get/Set、一次性的脚本、明天就要重写的原型。

集成测试

一条关键的端到端路径,胜过二十个 Mock 测试。

评论 0

还没有评论,来说两句吧。

提交前需验证邮箱,验证码 10 分钟内有效。

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.