Test vector

From HandWiki
Revision as of 20:41, 9 July 2021 by imported>Gametune (linkage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

In computer science and engineering, a system acts as a computable function. An example of a specific function could be [math]\displaystyle{ y = f(x) }[/math] where [math]\displaystyle{ y }[/math] is the output of the system and [math]\displaystyle{ x }[/math] 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 [math]\displaystyle{ y = f(x_1, x_2, ...) }[/math] ; however, we can generalize this equation to a general form [math]\displaystyle{ Y = C(X) }[/math] where [math]\displaystyle{ Y }[/math] is the result of the system's execution, [math]\displaystyle{ C }[/math] belongs to the set of computable functions, and [math]\displaystyle{ X }[/math] is an input vector. While testing the system, various test vectors must be used to examine the system's behavior with differing inputs.

Example

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:

[math]\displaystyle{ y = L(u,p) }[/math]

with [math]\displaystyle{ y \in \{ true , false \} }[/math] and [math]\displaystyle{ u,p \in \{ String \} }[/math], with [math]\displaystyle{ true }[/math] designating login successful, and [math]\displaystyle{ false }[/math] designating login failure, respectively.

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

[math]\displaystyle{ Y = L(X) }[/math]

with [math]\displaystyle{ X = [ x_1, x_2 ]=[u,p] \; ; \; Y = [ y_1 ] }[/math]

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

In order to test the login page, it is necessary to pass some sample input vectors [math]\displaystyle{ \{X_1, X_2, X_3, ...\} }[/math]. In this context [math]\displaystyle{ X_i }[/math] is called a test vector.

See also

  • Automatic test pattern generation

References

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