add design pattern test code