Using design pattern and test driven development.