Let $k$ be a field, $G$ be a finite group, and $\rho:G\hookrightarrow \operatorname{GL}_n(k)$ a faithful representation of $G$. For a $k$-vector space $V$ of dimension $n$, $G$ acts through $\rho$ on $k[V]$, the polynomial functions on $V$. Polynomials $h_1,\ldots,h_n\in k[V]^G$ are called primary invariants if $k[V]^G$ is a finitely generated module over $k[h_1,\ldots,h_n]$. Elements of a basis for this module $f_1,\ldots,f_m$ are called secondary invariants.
Suppose I'm trying to compute $k[V]^G$, and I'm able to write down invariants $h_1,\ldots,h_n$ and $f_1,\ldots,f_m$ that I suspect are primary and secondary invariants. Are there sufficient conditions I can use to check if in fact I've found all of $k[V]^G$?
For instance, it is true that the number of secondary invariants can be checked using the following formula: $$ m=\frac{\prod_{i=1}^n\operatorname{deg}(h_i)}{|G|} $$ Is it sufficient to show that the $h_i$ are algebraically independent, that $m$ satisfies the above formula, and that there are no dependence relations (over $k[h_1,\ldots,h_n]$) among the $f_i$? It seems like this still wouldn't be enough, because there could be some invariant $g$ such that $f_1=h_1g$. Perhaps I need to check some condition on the degrees of the $f_i$?
If you'd like more details on the setup, I'm working in the modular case, so the characteristic of $k$ divides $|G|$, but I know that $k[V]^G$ is still Cohen-Macaulay.