什么是 SUT?它从何而来?

发布于 2024-12-03 02:26:40 字数 482 浏览 2 评论 0原文

我看到很多人在谈论 SUT 这个术语,但不明白他们为什么使用这个术语。

SUT是你想测试的?

这个术语从何而来,含义是什么?

例如,在此测试中,我的 SUT 是什么?

[TestMethod]
public void UsersAction_should_return_IndexAction()
{
    const long id = 1;

    UsersViewModel viewModel = new UsersViewModel()
    {
        SelectedUsers = new long[] { 1, 2, 3, 4 }
    };

    ActionResult result = _controller.Users(id, viewModel);

    result.AssertActionRedirect().ToAction("Index");
}

I see many people talking about the term SUT, but do not understand why they use that term.

SUT is what you want to test?

Where does this term come from and what does it mean?

For example in this test, what is my SUT?

[TestMethod]
public void UsersAction_should_return_IndexAction()
{
    const long id = 1;

    UsersViewModel viewModel = new UsersViewModel()
    {
        SelectedUsers = new long[] { 1, 2, 3, 4 }
    };

    ActionResult result = _controller.Users(id, viewModel);

    result.AssertActionRedirect().ToAction("Index");
}

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

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

发布评论

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

评论(6

背叛残局 2024-12-10 02:26:40

从单元测试的角度来看,被测系统 (SUT) 代表测试中不是模拟或存根的所有参与者(即一个或多个类)。在您的示例中,这将是控制器。

The System Under Test (SUT) from a Unit Testing perspective represents all of the actors (i.e one or more classes) in a test that are not mocks or stubs. In your example that would be the controller.

仅此而已 2024-12-10 02:26:40

这个词从何而来?

DUT(被测设备)和 UUT(被测单元)是测试工程师(非软件测试工程师)中非常常见的缩写。这就是术语 SUT(被测系统)的来源
和CUT(测试中的代码)应该来自。

相关:
2008 年 MSDN 博客文章命名 SUT 测试变量

Where does this term come from?

DUT (device under test) and UUT (unit under test) are very common abbreviations among test engineers (non-software test engineers). That's where the term SUT (system under test)
and CUT (code under test) ought to have come from.

Related:
2008 MSDN blog post Naming SUT Test Variables.

不语却知心 2024-12-10 02:26:40

它很可能意味着“被测试的系统”,即正在测试的系统,而不是它可能与之交互的其他系统,但这些系统没有被明确测试(因为它们是其他人的责任)。

It most likely means "System Under Test", i.e. the system being tested, as opposed to other systems it may interact with, but which are not being explicitly tested (because they're someone else's responsibility).

计㈡愣 2024-12-10 02:26:40

我也从未听说过这个词,但快速搜索给出了

被测系统 (SUT) 是指正在测试正确操作的系统。 [...]该术语主要用于软件测试。

软件系统的一个特例是应用程序,经过测试后,称为被测应用程序。

术语 SUT 也可以指软件的成熟阶段,因为系统测试是测试周期中集成测试的后续。

来自古老的维基百科

I've never heard the term either, but a quick search gave

System under test (SUT) refers to a system that is being tested for correct operation. [...] The term is used mostly in software testing.

A special case of a software system is an application which, when tested, is called an application under test.

The term SUT can also refer to a stage of maturity of the software because system testing is the successor of integration testing in the testing cycle.

From good old Wikipedia.

南城旧梦 2024-12-10 02:26:40

被测系统SUT

在您的单元测试示例中,如果您确实想谈论 SUT,那么可能是 UsersAction。然而,我还没有遇到任何人在谈论单元测试时使用 SUT。对我来说,这听起来更像是适合集成/系统/性能测试等的东西。

例如,进行性能测试。在这里,您可能会说 SUT 是整个硬件/软件系统,也可能只是其中之一,具体取决于您在特定性能测试中测试的内容。

System Under Test SUT.

In your unit test example, if you really want to talk about SUT it's probably UsersAction. However, I have not come across anyone use SUT when talking about unit testing. To me this sounds more like something that would fit with integration/system/performance testing or alike.

For instance, take performance testing. Here you might say the SUT is the whole HW/SW system, or it might be just one of them depending on what you're testing in that specific performance test.

大姐,你呐 2024-12-10 02:26:40

区分 SUT 和测试系统是有好处的。
SUT 可以是测试系统的一部分,如下图所示:

在此处输入图像描述

It is good to distinguish SUT and Test System.
The SUT can be part of the test system, illustrated in below picture:

enter image description here

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