# Test vector

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Test_vector
> Markdown URL: https://mediated.wiki/source/Test_vector.md
> Source: https://en.wikipedia.org/wiki/Test_vector
> Source revision: 1273690028
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

In [computer science](/source/computer_science) and [engineering](/source/computer_engineering), a '''test vector''' is a set of inputs provided to a system in order to test that system.  In [software development](/source/software_development), test vectors are a methodology of [software testing](/source/software_testing) and [software verification and validation](/source/software_verification_and_validation). 

==Rationale==

In computer science and engineering, a system acts as a [computable function](/source/computable_function).  An example of a specific function could be <math>y = f(x)</math> where <math>y</math> is the output of the system and <math>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>y = f(x_1, x_2, ...)</math> ; however, we can generalize this equation to a general form <math>Y = C(X)</math> where <math>Y</math> is the result of the system's execution, <math>C</math> belongs to the set of [computable function](/source/computable_function)s, and <math>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](/source/username) field and a [password](/source/password) field. In that case, the login system can be described as:
 
<math>
y = L(u,p)
</math> 

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

Making things more generic, we can suggest that the function <math>L</math> takes input as a 2-dimensional [vector](/source/vector_(mathematics_and_physics)) and outputs a one-dimensional vector ([scalar](/source/scalar_(mathematics))).
This can be written in the following way:-

<math>
Y = L(X)
</math>

with 
<math>
X = [ x_1, x_2 ]=[u,p] \; ; \; Y = [ y_1 ] 
</math>

In this case, <math>X</math> is called the input vector, and <math>Y</math> is called the output vector.

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

Alternatively, the concatenation of <math>X</math> and <math>Y</math>, e.g., <math>[ x_1, x_2, y_1 ]</math>, can be called a test vector.

==See also==
*[Automatic test pattern generation](/source/Automatic_test_pattern_generation)

== References ==

*Test Vector Guidelines.  [http://www.actel.com/documents/TestVector_AN.pdf]
*Test Vector Considered Harmful.  [http://fate.tttc-events.org/proceedings/5.1.pdf]

Category:Computer engineering
Category:Test items

---
Adapted from the Wikipedia article [Test vector](https://en.wikipedia.org/wiki/Test_vector) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Test_vector?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
