作业帮 > 英语 > 作业

英语翻译7 Program testing/debugging7.1 Introduction Although man

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/07/07 12:12:18
英语翻译
7 Program testing/debugging
7.1 Introduction
Although many authors attempt to draw a distinction between testing and debugging a program,in practical terms they amount to the same thing.Consequently,the term testing is used to cover this procedure.
Testing is the process of executing a program with the deliberate intent of finding errors.This definition is important because it specifies a state of mind on the part of the person performing the test.It is akin to the engineering practice of testing a mechanism or structure not only to verify that it can perform its designed task under ideal conditions but also to determine the point (if any) at which it fails.
7.2 Testing in its correct perspective
Diligent and exhaustive testing is no substitute for careful design.The time taken to test a program to satisfaction will be in proportion (with an inverse ratio) to the time taken in designing the program before its coding.Days spent in design will save weeks in testing.
The elegance of design of any program will directly affect both the ease of testing the program and the incidence of errors detected.Errors will not be referred to as ‘bugs’ because gracing them with a euphemism makes it easier for us as programmers to ignore the fact that they are errors.They are faults in the execution of a program which have been induced by the programmer through poor design or incorrect logic.
Most errors are the result of incorrect control functions in programs rather than incorrect computation or data manipulation.The latter types of error are usually the easiest to detect and correct; the former often go undetected and remain in programs after they have been approved to run in a production (or ‘live’) environment.Control functions are those which regulate the sequence in which tasks are performed,the selection of appropriate processing modules for a given situation,the number of times a loop is executed,and so on.
我的翻译如下,请参考:
7、程序测试/调试
7.1 导论
虽然许多著书者都试图在测试与调试程序之间进行区别,但是在实际操作中,这两者都指的一件事.因此,(我们)用“测试”一次用来代表这一过程.
测试就是用运行程序以发现错误.这个定义很重要,因为它指定了执行测试的人的头脑状态.这就像测试一台机器或建筑物那样的工程实践一样,目的不只是要证明它能在所有设想的条件下完成既定任务,还要找出它在什么情况下就不能完成任务.
7.2在正常情况下测试
用心和彻底的测试并不是仔细设计的替代品.用于测试直到满意的时间与用于在编码前编程的时间是成反比的.花在编程上的时间越多,测试所需时间就越少.
程序编得是否完美直接关系到测试程序费力是否费力以及错误的影响范围.错误不能理解为缺陷,因为对缺陷的修复往往使我们这些程序员忽视他们使错误的事实.错误就是由于程序员的糟糕设计或是错误逻辑导致的程序运行时的缺点.
许多错误是控制函数中的不正确引起的,而不是错误计算或是错误的数据操作引起的.后面这种错误往往很容易检测到并得到纠正,但前面那种错误经常不能检测到,而且在经批准生产后还存在于程序中.控制函数指的是对以下各项的控制:实施任务的顺序、在所给条件下对合适的处理模块的选择、循环次数等等.