unit-testing - 下一步是编辑触发测试吗?

标签 unit-testing testing ide tdd infinitest

我刚读完 Michael C. Feathers 的好书 Working Effectively with Legacy Code ,将测试引入遗留代码的圣经。在这本书中,他描述了一种称为编辑触发的测试的东西:

If it isn't out by the time this book is released, I suspect that someone will soon develop an IDE that allows you to specify a set of tests that will run at every keystroke. It would be an incredible way of closing the feedback loop.

It has to happen. It just seems inevitable. There are already IDEs that check syntax on each keystroke and change the color of code when there are erros. Edit-triggered testing is the next step.

当我读到这篇文章时,我还没有听说过任何支持它的 IDE 或工具。但是,我刚刚找到一个名为 Infinitest 的项目支持 Java 的这一点。

我的问题是:

  1. 是否有任何其他工具/框架支持此功能(希望也适用于 Visual Studio)?
  2. 您对这种测试有什么经验(效率高,减慢 IDE 等)?
  3. 这是 TDD 的下一步吗?

更新:

最佳答案

Autotest对于 ruby 。它在您编辑文件时不断运行单元测试,使用一些简单的约定将源文件映射到测试文件。还有一个插件,我已经看到它在 emacs 中以交互方式将测试代码着色为红色或绿色。我认为这种在代码编辑器本身中通过/失败的即时视觉反馈的想法很棒。

关于unit-testing - 下一步是编辑触发测试吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1016841/

相关文章:

java - 单元测试和模拟工厂

javascript - 在 Jasmine 中,array.includes 不起作用(必须用其他函数代替)。为什么?

ruby-on-rails - 什么测试工具/框架可以测试 Rails 应用程序中的并发请求?

intellij-idea - IntelliJ IDEA 似乎忽略了代码格式

xml - 是否有用于XML文件编辑,验证和格式化的Delphi IDE插件?

unit-testing - "zef test ."返回的结果与使用 raku -Ilib 运行某些测试不同

java - 使用 gradle 为各个单元测试生成 Jacoco 代码覆盖率报告

testing - 在步骤定义类中包含非步骤方法是否可以接受?

android - 通过 Android Studio 将大型应用程序传输到 Android Wear

c++ - GitHub 将文件开源到不同的 IDE