What is the relation between orthogonal arrays and orthogonal matrices? In software testing, there is this concept of orthogonal arrays. It is said that these arrays are actually matrices but when I google "orthogonal matrix", it says it is a square matrix. These orthogonal arrays are certainly not square, e.g. this one:
111
122
212
221

Is there a  relation between orthogonal arrays and orthogonal matrices, and if so, what is it?

Orthogonal array testing consists in taking a subset of all the possible inputs such that the  inputs are orthogonal in some sense. The sense is not always the same. It depends on the context. 
If the space of inputs were, say sound waves, then you could take as orthogonal test harmonics, which are orthogonal certain scalar product.
For a more combinatorial input the sense in which they are orthogonal is also more combinatorial.
For the example of a $3$-variable input that can take the values $1$ or $2$, as in your example, they are taking 
$$\begin{array}{ccc}x&y&z\\1&1&1\\1&2&2\\2&1&2\\2&2&1\end{array}$$
The name orthogonal is being used to mean that the rows are orthogonal in some sense. This is the same that happens with orthogonal matrices in which the rows (or columns are orthogonal in the standard inner product/ dot product).
In our case they are choosing the input in such a way that the pairwise combinations do not repeat. Therefore we can see the orthogonality in the following way:
Consider vectors, which size is equal to the number of possible pairwise combinations for each pair in a vector of size $3$. So, in an input $xyz$ of size $3$ we have $3$ pairs $xy,xz,yz$. For each of them we have $2\cdot2=4$ combinations for the input $11,12,21,22$. So, consider vectors of size $3\cdot4=12$ with components being $0$ or $1$. We will put a $1$ if the combination is used in the input for the corresponding pair, and a $0$ if not. Something like this:
$$(\underbrace{\underbrace{a_1}_{11},\underbrace{a_2}_{12},\underbrace{a_3}_{21},\underbrace{a_4}_{22}}_{xy};\underbrace{\underbrace{a_5}_{11},\underbrace{a_6}_{12},\underbrace{a_7}_{21},\underbrace{a_8}_{22}}_{xz};\underbrace{\underbrace{a_9}_{11},\underbrace{a_{10}}_{12},\underbrace{a_{11}}_{21},\underbrace{a_{12}}_{22}}_{yz})$$
So, for example in the third input $xyz=212$ the vector would be
$$(\underbrace{0,0,1,0}_{xy};\underbrace{0,0,0,1}_{xz};\underbrace{0,1,0,0}_{yz})$$
because the pair $xy$ is using the combination $21$ which is the third combination, the pair $xz$ is using the combination $22$ which is the fourth combination, and the pair $yz$ is using $12$ which is the second combination.
The thing is now that these $12\times1$ vectors are orthogonal in the usual dot product, just because by construction they never have a $1$ in the same position. 
