您需要从测试工具中得到什么?

发布于 2024-07-05 01:49:12 字数 420 浏览 10 评论 0原文

我是 Test Anything Protocol (TAP) IETF 小组的成员之一(如果有兴趣,请随时加入邮件列表)。 许多编程语言开始采用 TAP 作为他们的主要测试协议,他们希望从中获得比我们目前提供的更多的东西。 因此,我们希望从具有 xUnit、TestNG 或任何其他测试框架/方法背景的人员那里获得反馈。

基本上,除了简单的通过/失败之外,您还需要从测试工具中获得哪些信息? 仅举一些示例:

  • 文件名和行号(如果适用)
  • 开始和结束时间
  • 诊断输出,例如您得到的内容与您期望的内容之间的差异。

等等 ...

I'm one of the people involved in the Test Anything Protocol (TAP) IETF group (if interested, feel free to join the mailing list). Many programming languages are starting to adopt TAP as their primary testing protocol and they want more from it than what we currently offer. As a result, we'd like to get feedback from people who have a background in xUnit, TestNG or any other testing framework/methodology.

Basically, aside from a simple pass/fail, what information do you need from a test harness? Just to give you some examples:

  • Filename and line number (if applicable)
  • Start and end time
  • Diagnostic output such as the difference between what you got and what you expected.

And so on ...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

﹂绝世的画 2024-07-12 01:49:12

最肯定的是每个单独项目的列表中的所有内容:

  • 文件
  • 名 行号
  • 命名空间/类/函数名称
  • 测试覆盖范围
  • 开始时间和结束时间
  • 和/或总时间(这对我来说比前两项更有用)
  • 诊断输出,例如作为
    你得到的和你得到的之间的区别
    你所期望的。

从我的头脑中没有太多其他的,但对于测试组,我想知道

  • 组名称
  • 总执行时间

Most definitely all things from your list for each individual item:

  • Filename
  • Line number
  • Namespace/class/function name
  • Test coverage
  • Start time and end time
  • And/or total time (this would be more useful for me than the top two items)
  • Diagnostic output such as the
    difference between what you got and
    what you expected.

From the top of my head not much else but for the group of tests I would like to know

  • group name
  • total execution time
梦与时光遇 2024-07-12 01:49:12

编写测试必须非常非常容易,运行它们也同样容易。 对我来说,这是测试工具最重要的一个功能。 如果有人必须启动 GUI 或跳过一堆麻烦才能编写测试,他们就不会使用它。

It must be very, very easy to write a test, and equally easy to run them. That, to me, is the single most important feature of a testing harness. If someone has to fire up a GUI or jump through a bunch of hoops to write a test, they won't use it.

本宫微胖 2024-07-12 01:49:12

任意一组标签 - 因此我可以将测试标记为“集成、UI、管理”。

(你知道我会问这个不是吗:-)

An arbitrary set of tags - so I can mark a test as, for example "integration, UI, admin".

(you knew I was going to ask for this didn't you :-)

尸血腥色 2024-07-12 01:49:12

对于你所说的,我要添加:

  • 方法/函数/类名称
  • 覆盖率计数工具,有例外(不计算这些方法)
  • N 最后一次运行的结果可用
  • 强制必须存在轻松解析测试结果的方法

To what you said I'd add:

  • Method/function/class name
  • Coverage counting tool, with exceptions (Do not count these methods)
  • Result of N last runs available
  • Mandate that ways to easily parse test results must exist
情仇皆在手 2024-07-12 01:49:12

任何类型的诊断输出 - 尤其故障输出都是至关重要的。 如果测试失败,您不希望总是在调试器下重新运行测试以查看发生了什么 - 输出中应该包含一些内容。

我还喜欢查看关键系统变量(例如可用内存或硬盘空间)的前后快照,因为这些也可以提供很好的线索。

最后,如果您在任何测试中使用随机种子,请将种子写入日志文件,以便在必要时可以重现测试。

Any sort of diagnostic output - especially on failure is critical. If a test fails, you don't want to always have to rerun the test under a debugger to see what happened - there should be some cludes in the output.

I also like to see a before and after snapshot of critical system variables like memory or hard disk space available as those can provide great clues as well.

Finally, if you're using random seeds for any of the tests, write the seed out to the logfile so that the test can be reproduced if necessary.

太傻旳人生 2024-07-12 01:49:12

我想要连接和嵌套 TAP 流的能力。

I'd like the ability to concatenate and nest TAP streams.

白芷 2024-07-12 01:49:12

能够识别单个测试的唯一 ID(uuid、md5sum)——例如,在将测试结果插入数据库时​​使用,或者在错误跟踪器中识别它们以使 QA 能够重新运行单个测试。

这也使得在产品多个修订的整个生命周期中跟踪单个测试的行为成为可能。 这最终可能允许“历史”事件(新员工、产品发布、硬件升级)与因此类事件而失败的测试概况之间存在更大规模的关联。

我还认为 TAP 应该通过专用的侧通道发出,而不是与标准输出混合。 我不确定这是否属于协议定义的范围。

A unique id (uuid, md5sum) to be able to identify an individual test -- say, for use when inserting test results in a database, or identifying them in a bug tracker to make it possible for QA to rerun an individual test.

This would also make it possible to trace an individual test's behavior from build-to-build through the entire lifecycle of multiple revisions of a product. This could eventually allow larger-scale correlations between 'historic' events (new hire, product release, hardware upgrades) and the profile(s) of tests that fail as a result of such events.

I'm also thinking that TAP should be emitted through a dedicated side-channel rather than mixed in with stdout. I'm not sure this is under the scope of the protocol definition.

書生途 2024-07-12 01:49:12

我使用TAP作为一组简单的C++测试方法的输出协议,并且发现了以下缺点:

  • 测试步骤无法分组(只有分组为几个测试脚本;但是为了在我们的软件中运行所有测试,我需要至少多一级分组,以便通过“数据库连接”->“重新连接测试”->“测试步骤#3”来识别单个测试步骤,
  • 查看预期输出和实际输出之间的差异是有用的; 我要么将差异打印到 stderr(作为注释),要么实际启动图形差异工具,
  • 协议和工具必须真正独立于语言。 例如,到目前为止,我只知道用于运行测试的 Perl“证明”工具,该工具仅限于运行 Perl 脚本。

最后,测试输出必须适合作为轻松生成 HTML 报告文件的基础,其中列出了成功的测试简洁地给出失败测试的详细输出,并且可以快速跳转到 IDE 到失败的测试行。

I use TAP as output protocol for a set of simple C++ test methods, and have seen the following shortcomings:

  • test steps cannot be put into groups (there's only the grouping into several test scripts; but for running all tests in our software, I need at least one more level of grouping, so that a single test step would be identified by like "DB connection" -> "Reconnection Test" -> "test step #3")
  • seeing differences between expected and actual output is useful; I either print the diff to stderr (as comment) or actually launch a graphical diff tool
  • the protocol and tools must be really language-independent. For example, so far I only know of the Perl "prove" tool for running tests, which is limited to running Perl scripts

In the end, the test output must be suitable as basis for easily generating an HTML report file which lists succeeded tests very concisely, gives detailed output for failed tests, and makes it possible to quickly jump into the IDE to the failing test line.

枕头说它不想醒 2024-07-12 01:49:12
  • 可选的ascii彩色输出,绿色表示良好,黄色表示待处理,红色表示错误

  • 待处理事物的想法

  • 将运行各个测试的命令的测试报告末尾的摘要 其中

  • 列出项目

    • 出了点问题

    • 测试中的某些内容正在等待

  • optional ascii coloured output, green for good, yellow for pending, red for errors

  • the idea of things being pending

  • a summary at the end of the test report of commands that will run the individual tests where

  • List item

    • something went wrong

    • something in the test was pending

心作怪 2024-07-12 01:49:12

TAP 的扩展想法:

1..4
ok 1 - yay
not ok 2 - boo
ok 3 - yay #json:{...}
ok 4 - see my json

能够附加 #json 评论...
- 可以被现有代码安全地忽略
- 定义明确的标签可以在 testanything.org 上轻松保留
- 易于生成、解析和读取复杂类型
- yaml 很痛苦

Extension idea for TAP:

1..4
ok 1 - yay
not ok 2 - boo
ok 3 - yay #json:{...}
ok 4 - see my json

Ability to attach a #json comment...
- can be safely ignored by existing code
- well-defined tags can be easily reserved at testanything.org
- easy to produce, parse and read complex types
- yaml is a pain

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文