During the process of functional verification, we may encounter the problems of narrowing down the constraint to verify some corner cases times again. Usually we will need a children class and write down the constraint in it. If there are lots of corner cases, then we have to maintain lots of children classes. It’s painful and boring work.
And in another case, we have a class tree with 1 parent class and 4 children classes. If we want to add new constraint to the parent class in some test cases, in traditional way, that means another 4 grandchildren classes with the same constraint block. Continue reading “Dynamic constraint using decorator design pattern”