This screencast series shows how to go through the TDD Tetris Tutorial where you can learn Test-Driven Development by at first writing code to pass pre-written tests, so that it will be easier to write your own tests when the time for it comes.
With a generic piece rotation algorithm at hand, it'll be easier to implement rotating Tetris pieces.