Here is an example:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}\centering
\begin{tikzpicture}[extended line/.style={shorten >=-#1,shorten <=-#1}]
\draw [very thick, extended line=1cm] (0,0) -- (0,1);
\end{tikzpicture}
\caption{This is a test caption.}
\end{figure}
\end{document}
and its outcome:

How can I move the tikzpicture above the caption?

shortenpair doesn't update the bounding box. So you need to use something that does update it such as Qrrbrbirlbel's answer. – percusse Dec 3 '12 at 4:34