Incorrect statement example 2

De Software testing
Revisão de 23h56min de 10 de março de 2010 por Magsilva (discussão | contribs)
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)
Ir para: navegação, pesquisa

Consider the following software requirement: "The value of y should be a function of x and y, as defined by the expression y = (x - z) / 2". The programmer, when implementing the requirement, wrote:

	y = x - z / 2

I.e., the programmer wrote an incorrect data definition in the software (made a mistake) and introduced a fault . For x = 10 and z = 8, the expected output is y = 1, but the incorrect version's output is y = 6, thus characterizing an error (as the value of y is different from the expected).