寻找创建测试的敏捷方法

发布于 2024-11-07 11:37:26 字数 270 浏览 0 评论 0原文

我实际上正在测试网络的网络服务。与 Nunit 和 Gallio 等单元测试人员合作。

其实我有一个问题。我想测试一项服务,我必须在 html 中填写大量数据,就像处方集一样。问题是我正在手动编辑 xml 来进行测试......它太费力和繁重,因此,我正在寻找一种敏捷方法来做到这一点。

我的老板告诉我做一个公式集,我可以在其中填写所有字段,例如 html,然后用它创建一个 xml。比手动编辑基本 xml 更有效。

有一个工具可以帮助我吗?

抱歉我的英语不好。

I'm actually testing web service of a web. Working with unit testers like Nunit and Gallio.

Actually, i have a problem. I want to test a service where i have to fill a lot of data in the html, like a formulary. And the problem is that i'm doing that editing an xml manually to do the tests... its too labored and heavy, and because this, i'm searching an agile method to do that.

My boss told me to do a formulary where i can fill all the fields, like the html, and then, create a xml with that. Is more efficient than editing a base xml manually.

There is a tool that can help me?

Sorry about my bad english.

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

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

发布评论

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

评论(3

飘过的浮云 2024-11-14 11:37:26

您应该尝试 Selenium健身

You should try either Selenium or Fitness.

昇り龍 2024-11-14 11:37:26

也许测试数据构建器可以为您工作?您可以编写类,以便可以在测试中编写

var xml = new WebServiceCallBuilder()
             .WithDefaultValues()              // this sets most common options
             .WithParamX("something")          // which You can then modify
             .WithParamY("something other")
             .WithParamZ("another thing")
             .Build();

var result = webService.Call(xml);

您还可以实现测试数据生成器,以便它能够实现像


var xyzBuilder = new WebServiceCallBuilder()
                 .WithDefaultValues()
                 .WithParamX("x")
                 .WithParamY("y")
                 .WithParamZ("z");
var xyzXml = xyzBuilder.Build();

// let's say now You want similar builder but with different Z param
// then You can do this to not copy/paste/modify code above
var xyzzzBuilder = new WebServiceCallBuilder(xyzBuilder)
                      .WithParamZ("zzz");
var xyzzzXml = xyzzzBuilder.Build();

我可能会使用它那样的功能。

Maybe test data builders could work for you? You could write classes so that You can write in Your tests

var xml = new WebServiceCallBuilder()
             .WithDefaultValues()              // this sets most common options
             .WithParamX("something")          // which You can then modify
             .WithParamY("something other")
             .WithParamZ("another thing")
             .Build();

var result = webService.Call(xml);

You can also implement test data builder so that it enables things like


var xyzBuilder = new WebServiceCallBuilder()
                 .WithDefaultValues()
                 .WithParamX("x")
                 .WithParamY("y")
                 .WithParamZ("z");
var xyzXml = xyzBuilder.Build();

// let's say now You want similar builder but with different Z param
// then You can do this to not copy/paste/modify code above
var xyzzzBuilder = new WebServiceCallBuilder(xyzBuilder)
                      .WithParamZ("zzz");
var xyzzzXml = xyzzzBuilder.Build();

I would probably use it.

花落人断肠 2024-11-14 11:37:26

我们决定不通过 Web 服务对我们的代码进行单元测试,因为模拟环境和 http 请求需要付出很大的努力。

相反,我们将尽可能多的代码移至“核心”组件中,该组件不依赖于 Web 框架(在我们的示例中为 ASP.NET,因此“核心”不引用诸如此类的程序集)系统.Web)。

依赖于Web框架的代码留在'web'组件中。我们尝试使其尽可能小 - 它通常处理身份验证、授权、转换请求并调用“核心”中的适当功能来处理它。

我们尝试对“核心”的公共接口进行完整的单元测试,但我们不会尝试对“Web”接口进行单元测试。我们计划使用不同类型的自动化测试来测试“网络”。

We decided not to unit test our code through the web service, because of the effort involved in mocking the environment and the http requests.

Instead we move as much of our code as possible into a 'core' component, which has no dependency on the web framework (in our case ASP.NET, so 'core' has no reference to assemblies like System.Web).

The code that is dependant on the web framework is left in the 'web' component. We try to keep this as small as possible - it typically handles authentication, authorization, translates the request and calls the appropriate functionality in 'core' to process it.

We try to unit test the public interface to 'core' completely, but we do not attempt to unit test the 'web' interface. We plan to test 'web' using a different kind of automated test.

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