In Yang-Mills theory the field strength tensor $F_{\mu \nu}$ can be calculated as $$ \begin{equation} F_{\mu\nu} \equiv \frac{i}{g} [D_\mu,D_\nu] = \partial_\mu A_\nu - \partial_\nu A_\mu -ig[A_\mu,A_\nu], \end{equation} $$ where covariant derivative is defined as $$ D_\mu = \partial_\mu -ig A_\mu. $$ Can Yang-Mills field strength be defined as covariant derivative squared instead, rather than as the non-commutatibity of the covariant derivatives? The two definitions are essentially the same, but the former affords an alternative way of deriving the covariance properties of field strength (see below).
It's easier to demonstrate the idea in terms of differential forms. The field strength 2-form $F$ (also called curvature 2-form) is defined as (here the coupling constant and $i$ are absorbed into the definition of $A$ and $F$) $$ F = F_{\mu \nu}dx^\mu\wedge dx^\nu = d\wedge A + A\wedge A, $$ gauge field 1-form $A$ is defined as $$ A = A_\mu dx^\mu, $$ and the covariant derivative of the Dirac fermion field $\psi$ (spinor) is defined as $$ D\psi = (d+A)\psi. $$
Now the covariant derivative squared $D\wedge D$ of a spinor is $$ D\wedge D \psi = (d+A)\wedge (d+A)\psi $$ $$ = (d\wedge d + d\wedge A + A \wedge d + A\wedge A) \psi $$ $$ = 0 + d\wedge (A \psi) + A \wedge (d \psi) + (A\wedge A) \psi $$ $$ = (d\wedge A) \psi - A \wedge (d \psi) + A \wedge (d \psi) + (A\wedge A) \psi $$ $$ = (d\wedge A + A\wedge A) \psi $$ $$ = F \psi, $$ or in short $$ F = D\wedge D, $$ where we have used the fact that $d\wedge d = 0$ and 1-forms $d$ and $A$ anti-commute in wedge (outer) $\wedge$ product.
The beauty of the covariant derivative squared definition is that the covariance of field strength 2-form $F$ $$ F \rightarrow F' = gFg^{-1} $$ is an automatic outcome, since by definition of the covariant derivative we have $$ F\psi = D\wedge D \psi \rightarrow g D\wedge D \psi = g F \psi = g F g^{-1}g\psi = F'\psi', $$ where $$ \psi \rightarrow \psi' = g\psi. $$