盒装牛奶可以加热吗:谁能帮忙翻译一下这篇计算机文章?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 21:41:23
7.5 Data-driven versus logic-driven testing
Data-driven testing refers to the principle of regarding the program, or any segment of it, as a ‘black box’ and ensuring that it gives a correct output for all input data. This approach regards the algorithm as relatively unimportant provided that it executes correctly for the range of data that it is required to process.
The advantages of data-driven testing are:

 It requires empirical testing of an algorithm with real data rather than the forming of an opinion about the correctness of an algorithm by examining its construction.
 It can be done by a user of the program as an alternative to a programmer.
 It provides documentary evidence, by way of printed or displayed output, that an algorithm works correctly.

Its disadvantages are:

 The programmer may omit to supply test data which would have uncovered a flaw in the algorithm.
 ‘Correct’ results may sometimes be the consequence of compensating errors within an algorithm, errors which may cease to compensate one another as a result of a subsequent change in the operating environment.

Logic-driven testing relies on an examination of the algorithm of the program, or any segment of it, with the aim of detecting any flaw in its procedure.
The advantages of logic-driven testing are:

 A thorough walkthrough of the logic using desk-check procedures should uncover any weakness in the processing procedure; these weaknesses are often detected as a by-product of processing data which is itself handled correctly but indicates to the programmer doing the testing that a somewhat different choice of data would not have been handled correctly.
 If the testing is done by a programmer other than the author, suggestions may be made concerning the improvement of the structure, style or efficiency of the algorithm.

Its disadvantages are:

 Test data may be chosen to fit the algorithm and its author may either deliberately or subconsciously avoid causing an error.
 It requires a programmer to effect the test; a user cannot be relied upon to have sufficient knowledge of the programming language.
 A programmer, whether the original author or another, may bring to the testing procedure the same preconceptions about the operation of the coded instructions as were brought to the coding operation; for example, the programmer who wrote the instruction

Will be just as convinced of the correctness of this test during the checking of the program as during its coding and will be at a loss to explain later on why the program rejects all SEX_CODEs (including M and F!)

7.5数据驱动与逻辑驱动测试 数据驱动测试的原则,是指对节目或任何部分,因为'黑匣子',保证让所有的投入产出正确的数据. 这种方法在比较不重要的算法只要执行正确的各种数据,它需要过程. 优点数据驱动测试: 要有一种算法实验测试数据,而不是真正形成了一个正确的判断算法研究施工. 用户可以用它的另一项计划是程式. 所提供的书面证据,印刷或者展示生产方式,一个正确的工程算法. 其缺点是: 可程式不提供测试数据,就会发现破绽的算法. 「正确」的结果,有时可能是在一个错误的补偿算法,弥补错误,可能不再彼此后来由于经营环境的变化. 逻辑驱动测试依赖的算法研究的计划,或任何部分,以任何侦查程序的缺陷. 优点逻辑驱动测试: 彻底式的逻辑用材料核对程序处理程序找出任何缺点; 这些弱点往往发现作为副产品加工处理本身是正确的数据表明,这样的测试程式,选择不同的数据就没有正确处理. 如果试验是由作者以外的程式,可以建议有关改善结构、风格和效率的算法. 其缺点是: 测试数据可以选择合适的算法,作者可能有意或潜意识避免造成错误. 必须进行测试的程式; 用户不能依赖熟悉的程式语言. 一个程式,无论是原作者或其他可能带来的先入为主的测试程序相同的编码运行的指令所带来的业务代码; 例如,他写的<编程语言 将同样深信这是正确的检测检验期间的计划是在编码和不知所措稍后解释为什么拒绝所有节目sex_codes(含M和F!)