简体   繁体   English

您如何组织/布置测试脚本

[英]How do you organise/layout your test scripts

I'm interested in how others organise their test scripts or have seen good test scripts organised anywhere they've worked. 我对其他人如何组织他们的测试脚本感兴趣,或者看到了在他们工作过的任何地方都组织好的测试脚本。 Also, what level of detail is in those test scripts. 此外,这些测试脚本中的详细程度是多少。 This specifically relates to test scripts created for manual testing as opposed to those created for any automated test purposes. 这特别涉及为手动测试而创建的测试脚本,而不是针对任何自动化测试目的而创建的测试脚本。

The problem as I see it is this, there is a lot of complexity in test scripts but without the benefit of the principles used in organising a complex or large code base. 我所看到的问题是,测试脚本有很多复杂性,但是没有从组织复杂或大型代码库所使用的原理中受益。 You need to be able to specify what a piece of code should do but without boring someone to death as they read it. 您需要能够指定一段代码应该执行的操作,但又不要在阅读某人时让他们感到无聊。

Also, How do you layout test scripts, I'm not keen to create fully specified scripts suitable to be run by data entry types as that isn't the team we have and the overhead of maintaining them seems too high. 另外,如何布局测试脚本,我也不希望创建适合于由数据输入类型运行的完全指定的脚本,因为这不是我们的团队,并且维护它们的开销似乎太高了。 Also, it feels to me that specifying the process in such detail removes responsibility from the person actually doing the testing for the quality of the product. 同样,我感觉如此详细地指定过程免除了实际进行产品质量测试的人员的责任。 Do people specify every button click and value to be entered? 人们是否指定每个按钮的单击次数和要输入的值? If not then what level of detail is specified. 如果不是,则指定详细程度。

Tests executed by humans should be at a very high level of abstraction. 人工执行的测试应该处于很高的抽象水平。

Eg a test case for stackoverflow registration: 例如,用于堆栈溢出注册的测试用例:

Good: 好:

A site visitor with an existing OpenId account registers as a stackoverflow user and posts an answer. 具有现有OpenId帐户的站点访问者注册为stackoverflow用户并发布答案。

Bad: 坏:

1) Navigate to http://stackoverflow.com 2) Click on the login link 3) Etc... 1)导航到http://stackoverflow.com 2)单击登录链接3)等等...

This is important for several reasons: 这很重要,原因如下:

a) it keeps the tests maintainable. a)使测试可维护。 So you don't have to update your test script every time navigation elements are relabeled (eg 'login' changes to 'sign in'). 因此,您不必在每次重新标记导航元素时都更新测试脚本(例如,将“登录”更改为“登录”)。

b) it saves your testers from going insane from the tedium of minute details. b)它可以避免测试人员从繁琐的细节中发疯。

c) writing detailed manual test scripts is a poor use of your finite test resources. c)编写详细的手动测试脚本会浪费您有限的测试资源。
Detailed manual test scripts will divert your testers into writing bugs for minor documentation issues. 详细的手动测试脚本将使您的测试人员转移编写一些次要文档问题的错误。 You want to use your time to find the real bugs that will impact customers. 您想利用自己的时间来找到会影响客户的真正的错误。

Tests can be grouped by priority. 可以按优先级对测试进行分组。 The BVT/smoke tests could have the highest priority with functional, integration, regression, localization, stress, and performance having lower priorities. BVT /烟雾测试的优先级最高,而功能,集成,回归,本地化,压力和性能的优先级较低。 Depending on your test pass you would select a priority and run all tests with that or higher priorities. 根据您的测试通过,您将选择一个优先级并以该优先级或更高的优先级运行所有测试。 All you need to do is determine which priority a particular test is. 您需要做的就是确定特定测试的优先级。

Matt Andresen has provided good answer, in general case, but there are situations, when you can't do it that way. 在一般情况下,马特·安德森(Matt Andresen)提供了很好的答案,但是在某些情况下,您不能那样做。 For example when you are working on validated applications, that must comply with regulations form other parties like FDA, and it goes through very intensive audit, review, sign off, than 2 answer form your example is required. 例如,当您在经过验证的应用程序上工作时,必须遵守FDA等其他方面的法规,并且经过非常密集的审核,审查,签署,而不是您的示例要求提供2个答案。 Although I would opt for moving into automation with HP QuickTestPro or IBM RationaRobot in this case. 尽管在这种情况下,我会选择使用HP QuickTestPro或IBM RationaRobot进入自动化。

Maybe you should try with some tests repository? 也许您应该尝试使用一些测试库? There are again tools from HP QualityCenter and IBM products, but this can expensive. HP QualityCenter和IBM产品又提供了一些工具,但这可能很昂贵。 You could find some cheaper, that will let you organize them into tree structures, by requirement/feature, assign them priorities, group them into test suits for releases, group them into regression testing suits etc... 您可能会发现更便宜的产品,可以按需求/功能将它们组织成树状结构,为它们分配优先级,将它们分组为发布的测试套件,将它们分组为回归测试套件等。

I try to make manual tests fit into an automated structure---you can have both. 我尝试使手动测试适合自动化的结构-您可以同时拥有两者。

The organization schemes used by automated tests (eg, the xUnit frameworks) work for me. 自动化测试使用的组织方案(例如xUnit框架)对我有用。 In fact, they can be used to semi-automate the tests, by stopping and calling for a manual test to be run, or input put to be entered, or a GUI to be inspected. 实际上,通过停止并调用要运行的手动测试,输入的输入内容或要检查的GUI,它们可以用于半自动化测试。 The scheme usually is to mirror the directory structure of the production code, or to include the tests inside the production code, sometimes as inner classes. 该方案通常是镜像生产代码的目录结构,或将测试包括在生产代码内部,有时作为内部类。 Tests above the unit level can often be fit into the higher level directories (assuming you have a deep enough directory tree). 单元级别以上的测试通常可以适合更高级别的目录(假设您有足够深的目录树)。 These higher level tests can go in (mirrored) directories that have no production code, but are there for organizational purposes. 这些更高级别的测试可以进入没有生产代码的(镜像)目录,但出于组织目的而存在。

The level of detail---well, that depends, right? 详细程度-取决于,对吧?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM