  The acceleration of the universe can be explained either through dark energy
or through the modification of gravity on large scales. In this paper we
investigate modified gravity models and compare their observable predictions
with dark energy models. Modifications of general relativity are expected to be
scale-independent on super-horizon scales and scale-dependent on sub-horizon
scales. For scale-independent modifications, utilizing the conservation of the
curvature scalar and a parameterized post-Newtonian formulation of cosmological
perturbations, we derive results for large scale structure growth, weak
gravitational lensing, and cosmic microwave background anisotropy. For
scale-dependent modifications, inspired by recent $f(R)$ theories we introduce
a parameterization for the gravitational coupling $G$ and the post-Newtonian
parameter $\gamma$. These parameterizations provide a convenient formalism for
testing general relativity. However, we find that if dark energy is generalized
to include both entropy and shear stress perturbations, and the dynamics of
dark energy is unknown a priori, then modified gravity cannot in general be
distinguished from dark energy using cosmological linear perturbations.
