It is well known that Aut($G$), the group of all automorphisms of a group $G$, is a group under function composition. Lets say that you know $n$ of the automorphisms (plus the identity isomorphism) on $G$, hence you have $$H=\{id, \phi_1, \phi_2,\dots,\phi_n\}$$ Lets also say we do not know if $H = \text{Aut}(G)$ yet. I thought of the following strategy to come up with new Automorphisms:
Check if $H$ is a group. If not, take some $\phi_i,\phi_j \in H$ and find $\phi_i \cdot \phi_j$. If $\phi_i \cdot \phi_j$ is not in $H$, we have found another automorphism on $G$; add it to $H$. If it is not a new automorphism, pick new $\phi_i, \phi_j$. Repeat this process until $H$ is a group.
My question is, is this even a good strategy? One clear problem is that if we arrive at a subgroup of $\text{Aut}(G)$, we are obviously not going to generate any more automorphisms of $G$. Is there any way to optimize this strategy? Another thought I had was to take $$\phi_i^2, \phi^3,\dots,id$$ to find new automorphisms instead of composing $2$ randomly chosen ones, but I am not sure if this is better or worse.
Stated somewhat differently: suppose you have some elements $h_1, \ldots, h_n$ of a finite group.
When done, $S$ will be the subgroup of your group generated by $h_1, \ldots, h_n$.