I will discuss a novel protocol to define and measure the statistics of work, internal energy and dissipated heat in a driven quantum system. In this approach the presence of a physical detector arises naturally and work and its statistics can be investigated in the most general case. In particular, I show that the quantum interference effects are preserved during the evolution and the quantum coherence of the initial state can lead to measurable effects on the moments of the work done on the system. The method can also be applied to measure the dissipated heat in an open quantum system. By sequentially coupling the system to a detector, it is possible to track the energy dissipated in the environment while accessing only the system degrees of freedom.