In the numerical solution of partial differential equations (PDEs), a central question is the one of building variational formulations that are inf-sup stable not only at the infinite-dimensional level, but also at the finite-dimensional one. These properties are important since they represent the rigorous foundations for a posteriori error control and the development of adaptive strategies. The essential difficulty lies in finding systematic procedures to build variational formulations for which these desirable stability properties are (i) provable at the theoretical level while (ii) the approach remains implementable in practice and (iii) its computational complexity does not explode with the problem size. In this framework, the so-called Discontinuous Petrov–Galerkin (DPG) concept seems a promising approach to enlarge the scope of problems beyond second order elliptic PDEs for which this is possible. In the context of DPG, the result for the elliptic case was proven by Gopalakrishnan and Qiu  and requires a p-enriched test space. Recently, the same type of result has been proven by Broersen et al.  for certain classes of linear transport problems using an appropriate hp-enrichment to build the finite dimensional test space. In the light of this new result, we present Dune-DPG, a C++ library which allows to implement the test spaces introduced in Broersen et al. . The library is built upon the multi-purpose finite element package Dune (see Blatt et al. ). In this paper, we present the current version 0.2 of Dune-DPG which has so far been tested only for elliptic and transport problems. An example of use via a simple transport equation is described. We conclude outlining future work and applications to more complex problems. Dune-DPG is licensed under the GPL 2 with runtime exception and a source code tarball is available together with this paper.