自动化验收测试使用真实视图还是模拟视图? [英] Automated Acceptance Tests use Real or Mocked View?

查看:133
本文介绍了自动化验收测试使用真实视图还是模拟视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是首选使用真实的UI还是应该在AAT中对其进行模拟?当前,我模拟了单元/集成测试的视图,但是我应该进行自动化测试吗?我似乎在网上找不到有关此的任何文章.

解决方案

这些只是不同的测试,您需要同时使用两者,以提高发现某些缺陷的机会.

b>越多越好.这样就可以得出完整的答案,但是让我们考虑一下这两种不同方法的背景是什么.

该应用程序具有一些内部层(数据层,业务层等)和UI.简而言之,一些通用部件功能(库),具有特定于应用程序的数据模型的特定于应用程序的层和业务层是内部层,而UI则位于其上.您可能会在内部层上发现一些缺陷,这些缺陷可能会在UI层上被清除:某些函数从不被调用,或者仅在一组更有限的参数中被调用.这可能会在内部层中隐藏一些实际存在的问题.因此,使用真实" UI进行测试不会发现这些问题.但是显然,您需要制作所有图层.首先,在每个层上的单元测试都应该解决这个问题,但是没有全面的测试之类的东西.因此,模拟UI"测试可以进行更多更接近实际情况的测试,但不仅限于真实" UI可用的测试用例集.

同时,以上所有这些可能还不够,因为您的真实" UI层本身可能存在错误.使用真实" UI进行的自动化测试也使您有机会展示它们.

这样,各种测试之间并不是完全替代它们是相当互补的.我希望这个逻辑推理示例可以帮助您评估测试方案以设计更有效的测试计划.

最后一点:这不是alpha或beta测试,这是开发过程中进行的测试.您应该专注于从中获得最大利益的测试方面:拥有系统架构,代码设计的所有知识,甚至每个开发人员的特定技能或缺点,您都可以找出最有问题的方面,并在测试计划中将更多的注意力放在它们上.您的问题只涉及其中的一小部分,但必不可少.

—SA


Is it preferred to use the real UI or should it be mocked in AAT? Currently, i mock out my view for my unit/integration testing, but should i for automated testing? I can''t seem to find any articles about this online. Mostly relates to Unit-testing specifically.

解决方案

Those are just different tests, and you need both, to improve your chances to reveal some flaws. The more the better. That would be enough to wrap up the complete answer, but let''s think what would be the background of these two different approaches.

The application has some inner layers (data layer, business, whatever) and the UI. To put it simple, some universal part functionality (libraries), application-specific layers with application-specific data model and business layer are inner layers, and UI just on top of it. You can have some flaws on inner layers which might be polished out on the UI layer: some functions are never called, or called only with more limited set of parameters. That may hide some actually existing problems in inner layers. So, testing with "real" UI won''t reveal these problems. But apparently, you need to make all layers. First and foremost, unit testing on each of the layers should address it, but there is no such thing as comprehensive testing. So, "mocked UI" testing can put more tests which are closer to the real-life situation, but not limited to the set of test cases available with the "real" UI.

At the same time, all of the above might not be enough, because your "real" UI layer itself can have bugs. Automated testing with the "real" UI give you the chances to reveal them, too.

This way, all kinds of tests are not completely alternative to each other, they are rather complementary. I hope this example of logical reasoning can help you to evaluate testing scenarios to devise more effective test plans.

One final note: this is not alpha or beta testing, this is the testing performed as a part of development process. You should focus on those aspects of testing where you get the most benefits of this involvement: having all the knowledge on the system architecture, code design, even on particular skills or downsides of each individual developer, you can identify the most potentially problematic aspects and put more focus in on them in you test plans. Your question is related to only a small but essential part of this.

—SA


这篇关于自动化验收测试使用真实视图还是模拟视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆