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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Falsifiability and Unit Testing

1 点作者 codingismycraft将近 9 年前

1 comment

dalke将近 9 年前
I disagree with the given metaphor of TDD as scientifically falsifiable. TDD posits the answers first, and builds a theory around it. As new answers&#x2F;unit tests are put into place, the theory&#x2F;program becomes more complicated.<p>Given enough parameters (or complications), it&#x27;s possible to fit any set of known data points.<p>What&#x27;s missing, to be falsifiable, is to pose a set of questions&#x2F;tests which you expect to succeed if the theory&#x2F;software is working. These might include new edge cases, scalability testing, and performance testing that fit better outside of TDD, which focuses on fast, short tests, and especially outside of red-green-refactor, since these validations tests are supposed to be green-green-green and never red.<p>I, for example, have a set of tests which require loading &gt;4GB of data, to test that I didn&#x27;t use a 32 bit offset in places where I should have had 64 bit offset. These tests take minutes to run, and are implemented as system tests through the command-line API, not unit tests.<p>&gt; Following this way of delivering software, TDD is one of the practices that is usually overlooked, as inexperienced and non technical PMs, like to believe that writing comprehensive tests is very time consuming and it does not really add lots of business value in the final solution!<p>To address that point more directly, &quot;testing&quot; is much more than TDD. I believe after-the-fact tests are more akin to tests for falsifiability than TDD is.<p>The ultimate test for many programs is, do users use it? (Or &quot;do people buy it?&quot;) That certain is one way to judge the validity of the program, with a way which is outside the TDD framework.
评论 #11780388 未加载