For any abelian category $\mathcal{A}$, an object $M\in\mathcal{A}$ is called a generator if, given an injective nonsurjective morphism $U\to V$ in $\mathcal{A}$, there always exists a morphism $M\to V$ that cannot be factorized as $M\to U\to V$.
In particular, an object $M$ in the abelian category of left $A$-modules is a generator provided that the left $A$-module $A$ is a direct summand of a direct sum of copies of $M$. The converse is not true, however (there are also generators of other types sometimes).
Given a generator $M$ of an abelian category $\mathcal{A}$ and a sequence $X\to Y\to Z$ in $\mathcal{A}$, exactness of the sequence of abelian groups $Hom_{\mathcal A}(M,X)\to Hom_{\mathcal A}(M,Y) \to Hom_{\mathcal{A}}(M,Z)$ at the middle term $Hom_{\mathcal A}(M,Y)$ implies exactness of the sequence $X\to Y\to Z$ at the middle term $Y$.
One can easily prove this claim by considering the injective morphism from the image $U$ of the morphism $X\to Y$ to the kernel $V$ of the morphism $Y\to Z$.