Jump to content
Wikipedia The Free Encyclopedia

Test vector

From Wikipedia, the free encyclopedia

In computer science and engineering, a test vector is a set of inputs provided to a system in order to test that system. In software development, test vectors are a methodology of software testing and software verification and validation.

Rationale

[edit ]

In computer science and engineering, a system acts as a computable function. An example of a specific function could be y = f ( x ) {\displaystyle y=f(x)} {\displaystyle y=f(x)} where y {\displaystyle y} {\displaystyle y} is the output of the system and x {\displaystyle x} {\displaystyle x} is the input; however, most systems' inputs are not one-dimensional. When the inputs are multi-dimensional, we could say that the system takes the form y = f ( x 1 , x 2 , . . . ) {\displaystyle y=f(x_{1},x_{2},...)} {\displaystyle y=f(x_{1},x_{2},...)} ; however, we can generalize this equation to a general form Y = C ( X ) {\displaystyle Y=C(X)} {\displaystyle Y=C(X)} where Y {\displaystyle Y} {\displaystyle Y} is the result of the system's execution, C {\displaystyle C} {\displaystyle C} belongs to the set of computable functions, and X {\displaystyle X} {\displaystyle X} is an input vector. While testing the system, various test vectors must be used to examine the system's behavior with differing inputs.

Example

[edit ]

For example, consider a login page with two input fields: a username field and a password field. In that case, the login system can be described as:

y = L ( u , p ) {\displaystyle y=L(u,p)} {\displaystyle y=L(u,p)}

with y { t r u e , f a l s e } {\displaystyle y\in \{true,false\}} {\displaystyle y\in \{true,false\}} and u , p { S t r i n g } {\displaystyle u,p\in \{String\}} {\displaystyle u,p\in \{String\}}, with t r u e {\displaystyle true} {\displaystyle true} designating login successful, and f a l s e {\displaystyle false} {\displaystyle false} designating login failure, respectively.

Making things more generic, we can suggest that the function L {\displaystyle L} {\displaystyle L} takes input as a 2-dimensional vector and outputs a one-dimensional vector (scalar). This can be written in the following way:-

Y = L ( X ) {\displaystyle Y=L(X)} {\displaystyle Y=L(X)}

with X = [ x 1 , x 2 ] = [ u , p ] ; Y = [ y 1 ] {\displaystyle X=[x_{1},x_{2}]=[u,p]\;;\;Y=[y_{1}]} {\displaystyle X=[x_{1},x_{2}]=[u,p]\;;\;Y=[y_{1}]}

In this case, X {\displaystyle X} {\displaystyle X} is called the input vector, and Y {\displaystyle Y} {\displaystyle Y} is called the output vector.

In order to test the login page, it is necessary to pass some sample input vectors { X 1 , X 2 , X 3 , . . . } {\displaystyle \{X_{1},X_{2},X_{3},...\}} {\displaystyle \{X_{1},X_{2},X_{3},...\}}. In this context X i {\displaystyle X_{i}} {\displaystyle X_{i}} is called a test vector.

Alternatively, the concatenation of X {\displaystyle X} {\displaystyle X} and Y {\displaystyle Y} {\displaystyle Y}, e.g., [ x 1 , x 2 , y 1 ] {\displaystyle [x_{1},x_{2},y_{1}]} {\displaystyle [x_{1},x_{2},y_{1}]}, can be called a test vector.

See also

[edit ]

References

[edit ]
  • Test Vector Guidelines. [1]
  • Test Vector Considered Harmful. [2]

AltStyle によって変換されたページ (->オリジナル) /