  We propose a novel approach to define and measure the statistics of work,
internal energy and dissipated heat in a driven quantum system. In our
framework the presence of a physical detector arises naturally and work and its
statistics can be investigated in the most general case. In particular, we show
that the quantum coherence of the initial state can lead to measurable effects
on the moments of the work done on the system. At the same time, we recover the
known results if the initial state is a statistical mixture of energy
eigenstates. Our method can also be applied to measure the dissipated heat in
an open quantum system. By sequentially coupling the system to a detector, we
can track the energy dissipated in the environment while accessing only the
system degrees of freedom.
