  We present a theory of the $b$-function (or Bernstein-Sato polynomial) in
positive characteristic. Let $f$ be a non-constant polynomial with coefficients
in a perfect field $k$ of characteristic $p>0.$ Its $b$-function $b_f$ is
defined to be an ideal of the algebra of continuous $k$-valued functions on
$\mathbb{Z}_p.$ The zero-locus of the $b$-function is thus naturally
interpreted as a subset of $\mathbb{Z}_p,$ which we call the set of roots of
$b_f.$ We prove that $b_f$ has finitely many roots and that they are negative
rational numbers. Our construction builds on an earlier work of Musta\c{t}\u{a}
and is in terms of $D$-modules, where $D$ is the ring of Grothendieck
differential operators. We use the Frobenius to obtain finiteness properties of
$b_f$ and relate it to the test ideals of $f.$
