add designpattern test codes