Most proper usages of frameworks require you and enforce certain sequence or order in which you perform your activities. Some simple example could be call routine A before you call routine B. Subscribe before you publish, open before you close.
Is there research done in mining and automatically inferring such rules for using a framework.
Please update me if you do knw. If there isn't any, throw some light on how does one know what is the right order to perform those?
"Mining Specifications" - Look at this paper and George's thesis at CMU ISRI.