Research Article
Compositional Mining of Multiple Object API Protocols through State Abstraction
Algorithm 1
The algorithm to mine single object typestates annotated with interactions.
Input: as trace of events of an object | as interaction specification of type of | as the state abstract function | Output: as typestates for | initialize to be empty | (2) foreach event in the order in do | (3) | (4) | (5) create a transition | (6) | (7) foreach interacting object of when occurs do | (8) | (9) | (10) increment frequency of by 1 | (11) | (12) if runtime type of is different from that in IS then | (13) associate to and | (14) endif | (15) endfor | (16) endfor | (17) foreach do | (18) foreach do | (19) | (20) endfor | (21) endfor | (22) return |
|