Testing general relativity with present and future astrophysical observations