TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why should we even do testing?

3 点作者 yoouareperfect大约 3 年前

1 comment

nh23423fefe大约 3 年前
A good test suite shows the right &quot;perspective&quot; to have on code. All code is read 100x more than written. But most code is written in a way that doesn&#x27;t encode enough context.<p>Class hierarchies, method layout, pattern use. These things are all invisible at a high level, but testing can make those patterns surface easily and can encodes lots of semantic expectations about what the code is for.<p>It&#x27;s much easier to make a change when you can force a test to fail and single step through the test, rather than setup a local environment, try to create a reproduction and then setup a trail of breakpoints to get the system into some &quot;known&quot; state.