Let $\Omega$ be the half-space $\mathbb{R}^{n-1}\times \{ x_n>0 \}$, let $v \in L^2(\Omega)$ and $\phi\in \mathcal{C}^{\infty}(\overline{\Omega})$ with compact support in $\overline{\Omega}$, what is the lowest regularity that we need (on $v$) to say that
$$\frac{1}{2}\int_{\Omega} |v(x',x_n)|^2\partial_{x_n} \phi(x',x_n) = -\int_{\Omega} (\partial_{x_n}v,v) \phi-\int_{\mathbb{R}^{n-1}}|v(x',0)|^2\phi(x',0)dx'.$$