这里没有软件测试的泛泛理论,只有博主的最佳实践。 博主的研究方向为静态分析和性能测试,致力于各种测试工具的引入、评估和开发。 本博的测试文章均为作者原创,转载请务必注明出处。

Verification and Validation

上一篇 / 下一篇  2008-08-25 10:34:38

以下英文节选自《Sams.Software.Testing.2nd.Edition》第三章第二节,形象的阐述了Verification和Validation的不同。

Verificationandvalidationare often used interchangeably but have different definitions. These differences are important to software testing.

Verificationis the process confirming that something software meets its specification.Validationis the process confirming that it meets the user's requirements.These may sound very similar, but an explanation of the Hubble space telescope problems will help show the difference.

In April 1990, the Hubble space telescope was launched into orbit around the Earth. As a reflective telescope, Hubble uses a large mirror as its primary means to magnify the objects it's aiming at. The construction of the mirror was a huge undertaking requiring extreme precision and accuracy. Testing of the mirror was difficult since the telescope was designed for use in space and couldn't be positioned or even viewed through while it was still on Earth. For this reason, the only means to test it was to carefully measure all its attributes and compare the measurements with what was specified. This testing was performed and Hubble was declared fit for launch.

Unfortunately, soon after it was put into operation, the images it returned were found to be out of focus. An investigation discovered that the mirror was improperly manufactured. The mirror was ground according to the specification, but the specification was wrong. The mirror was extremelyprecise, but it wasn'taccurate. Testing had confirmed that the mirror met the specverificationbut it didn't confirm that it met the original requirementvalidation.

In 1993, a space shuttle mission repaired the Hubble telescope by installing a "corrective lens" to refocus the image generated by the improperly manufactured mirror.

Although this is a not a software example, verification and validation apply equally well to software testing. Never assume that the specification is correct. If you verify the spec and validate the final product, you help avoid problems such as the one that hit the Hubble telescope.

从黑体的文字中,可以看出Verification(验证)做的是检查其是否满足specification(规格说明书),而Validation(确认)是检查其是否满足用户需求。

上面的例子中提到的就是,Hubble天文望远镜虽然经过Verification测试,保证镜子符合产品规格说明,但由于规格说明本身就是错的,所以经过Validation测试,发现其无法满足最根本的要求,即用户需求。

从其定义得出,黑盒的功能测试做的是Validation工作,白盒测试通常做的是Verification工作。换句话说,白盒测试做的再好再充分,只能说明被测程序符合你的软件设计,可靠性好,但不能保证它的功能一定是正确的。就好比,一栋大楼虽然盖得非常结实,可以抗8级地震,但它不一定能住人,如果它的图纸设计中没有设计楼梯。

还有更形象的,请参考http://bulo.hjenglish.com/question/15887/


TAG:

 

评分:0

我来说两句

Open Toolbar