原文:http://www.testingexcellence.com/seven-principles-of-software-testing/
有翻译的错误,也有原文夸大的成分。但如果能通过它把握软件测试的要义也就足够了。
Seven Principles of Software Testing
软件测试的七个原则
Software testing is an extremely creative and intellectually challenging task.
软件测试是一个极有创造性的和挑战智力的任务。
When testing follows the principles given below, the creative element of test design and execution rivals any of the preceding software development steps.
当测试遵循下面的原则,测试设计和执行比其他软件开发步骤具有有创造性。
TESTING SHOWS THE PRESENCE OF BUGS
1. 测试揭示BUG的存在
Testing an application can only reveal that one or more defects exist in the application, however, testing alone cannot prove that the application is error free.
测试应用程序只能揭露在应用程序中存在的一个或多个缺陷,然而,测试通过不能证明应用程序无错。
Therefore, it is important to design test cases which find as many defects as possible.
因此,设计尽可能多地发现缺陷的测试用例是重要的。
EXHAUSTIVE TESTING IN IMPOSSIBLE
2. 彻底的测试是不可能的
Unless the application under test (UAT) has a very simple logical structure and limited input, it is not possible to test all possible combinations of data and scenarios.
除非测试过的应用程序(UAT)有非常简单的逻辑结构和有限的输入,它不可能测试所有可能的组合的数据和场景。
For this reason, risk and priorities are used to concentrate on the most important aspects to test.
出于这个原因,风险和优先被用于集中测试最重要的方面。
3. EARLY TESTING
3.早早测试
The sooner we start the testing activities the better we can utilize the available time.
越早开始测试活动我们就越能更好地利用可用的时间。
As soon as the initial products, such the requirement or design documents are available, we can start testing.
一旦最初的产品,这样的要求或设计文档可用,我们就可以开始测试。
It is common for the testing phase to get squeezed at the end of the development lifecycle, i.e. when development has finished, so by starting testing early, we can prepare testing for each level of the development lifecycle.
测试阶段被压缩在开发生命周期的结束即开发完成时是很常见的,所以尽早开始测试,我们可以准备测试为每个级别的开发生命周期。
Another important point about early testing is that when defects are found earlier in the lifecycle, they are much easier and cheaper to fix.
早早测试的另一个重要的一点是,当缺陷被发现在生命周期的早期,他们更容易和便宜。
It is much cheaper to change an incorrect requirement than having to change a functionality in a large system that is not working as requested or as designed!
在一个大系统中改变错误的要求比改变一个不是要求或设计的功能要便宜得多!
4. DEFECT CLUSTERING
4.缺陷聚类
During testing, it can be observed that most of the reported defects are related to small number of modules within a system.
在测试过程中,可以观察到的大部分缺陷与系统少数模块相关。
i.e. small number of modules contain most of the defects in the system.
即少数模块包含系统中大部分的缺陷。
This is the application of the Pareto Principle to software testing: approximately 80% of the problems are found in 20% of the modules.
这就是帕累托原则在软件测试的应用:大约80%的问题被发现在20%的模块。
5. THE PESTICIDE PARADOX
5.杀虫剂悖论
If you keep running the same set of tests over and over again, chances are no more new defects will be discovered by those test cases.
如果你继续一遍又一遍地运行相同的测试,用那些测试用例是没有机会发现更多的新缺陷的。
Because as the system evolves, many of the previously reported defects will have been fixed and the old test cases do not apply anymore.
因为随着系统的发展,许多以前报道的缺陷将会被修正和旧的测试用例就不再适用了。
Anytime a fault is fixed or a new functionality added, we need to do regression testing to make sure the new changed software has not broken any other part of the software.
随时修正错误或添加一个新的功能后,我们需要做回归测试,以确保新改变的软件没有破坏软件的任何其他部分。
However, those regression test cases also need to change to reflect the changes made in the software to be applicable and hopefully fine new defects.
然而,这些回归测试用例也需要根据软件本身的变化作出改变以反映更改软件的适用并找到新的缺陷。
6. TESTING IS CONTEXT DEPENDENT
6.测试是依赖于上下文的
Different methodologies, techniques and types of testing is related to the type and nature of the application.
不同的方法、技术和测试类型是根据应用程序的类型和性质有关。
For example, a software application in a medical device needs more testing than a games software.
例如,在一个医疗设备的软件应用程序比游戏软件需要更多的测试。
More importantly a medical device software requires risk based testing, be compliant with medical industry regulators and possibly specific test design techniques.
更重要的是医疗设备的软件需要基于风险的测试,符合医疗行业监管机构和特定测试设计技术。
By the same token, a very popular website, needs to go through rigorous performance testing as well as functionality testing to make sure the performance is not affected by the load on the servers.
同样,一个非常受欢迎的网站,需要经过严格的性能测试以及功能测试,确保性能不受服务器上的负载的影响。
7. ABSENCE OF ERRORS FALLACY
7.没有错误谬误
Just because testing didn’t find any defects in the software, it doesn’t mean that the software is ready to be shipped.
仅仅因为在软件测试中没有发现任何缺陷,但这并不意味着软件已准备好发布。
Were the executed tests really designed to catch the most defects? or where they designed to see if the software matched the user’s requirements?
执行测试是否真正地捕捉大多数缺陷?或者他们设计软件是否符合用户的需求?
There are many other factors to be considered before making a decision to ship the software.
在做决定软件发布之前有很多其他因素需要考虑。
Other principles to note are:
其他原则需要注意的是:
Testing must be done by an independent party.
测试必须由一个独立的方来完成。
Testing should not be performed by the person or team that developed the software since they tend to defend the correctness of the program.
测试不应由开发软件的个人或团队来执行,因为他们倾向于保护程序的正确性。
Assign best personnel to the task.
最好的人员分配任务。
Because testing requires high creativity and responsibility only the best personnel must be assigned to design, implement, and analyze test cases, test data and test results.
因为测试需要高度的创造力性和责任感只有最好地人员必须分配到设计,实现和分析测试用例,测试数据和测试结果上去。
Test for invalid and unexpected input conditions as well as valid conditions.
测试无效和意想不到的输入条件,以及有效的条件。
The program should generate correct messages when an invalid test is encountered and should generate correct results when the test is valid.
程序应该在无效的测试情况下生成正确的消息和有效的测试时要产生正确的结果。
Keep software static during test.
测试期间保持软件静态。
The program must not be modified during the implementation of the set of designed test cases.
在实施设计的测试用例集的期间不能修改程序。
Provide expected test results if possible.
尽可能提供预期测试结果。
A necessary part of test documentation is the specification of expected results, even if providing such results is impractical.
测试文档的必要组成部分是预期结果的规范,即使提供这样的结果是不切实际的。