什么是 SUT?它从何而来?
我看到很多人在谈论 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
从单元测试的角度来看,被测系统 (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.
DUT(被测设备)和 UUT(被测单元)是测试工程师(非软件测试工程师)中非常常见的缩写。这就是术语 SUT(被测系统)的来源
和CUT(测试中的代码)应该来自。
相关:
2008 年 MSDN 博客文章命名 SUT 测试变量。
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.
它很可能意味着“被测试的系统”,即正在测试的系统,而不是它可能与之交互的其他系统,但这些系统没有被明确测试(因为它们是其他人的责任)。
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).
我也从未听说过这个词,但快速搜索给出了
来自古老的维基百科。
I've never heard the term either, but a quick search gave
From good old Wikipedia.
被测系统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.
区分 SUT 和测试系统是有好处的。
SUT 可以是测试系统的一部分,如下图所示:
It is good to distinguish SUT and Test System.
The SUT can be part of the test system, illustrated in below picture: