Improved Processing of Textual Use Cases Deriving Behavior
Improved Processing of Textual Use Cases: Deriving Behavior Specifications Jaroslav Drazan 1, Vladimir Mencl 1, 2 1 DISTRIBUTED SYSTEMS RESEARCH GROUP http: //dsrg. mff. cuni. cz/ CHARLES UNIVERSITY IN PRAGUE Faculty of Mathematics and Physics 2 INTERNATIONAL INSTITUTE FOR SOFTWARE TECHNOLOGY http: //www. iist. unu. edu/ UNITED NATIONS UNIVERSITY
Outline • Problem statement § Motivation § Use cases and actions • Conversion principle § Analyzing complex and compound sentences § Identifying multiple verbs, direct and indirect objects • Handling incorrect parse trees • Conclusion Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Motivation • Why to extract behavior from use cases? § Formal design and implementation validation/verification § Automatically created (GUI) prototypes / skeleton implementation § Use case visualization • UML diagrams (System Sequence Diagrams, activity diagrams) Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Textual Use Case Extensions: Use Case: #1 Seller submits an offer 2 a Item not valid Scope: Marketplace 2 a 1 Use case aborts Su. D: Marketplace Information System Sub-variations: Level: Primary Task 2 b Price assessment available Primary Actor: Seller 2 b 1 System provides the seller Supporting Actor: Trade Commission with a price assessment. Main success scenario specification: 1. Seller submits item description. 2. System validates the description. 3. … Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Actions • An action represents a clause of a use case step. • Can be used in conversion to event-based formalisms. § E. g. , pro-cases • Action types: § Operation request actions • Send (!) • Receive (? ) § § § Internal action (#) Terminate action GOTO action Condition action Illegal action Unknown action Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Mapping Steps to Actions … … 2. ? CAS. start. New. Sale 2. Cashier starts a new sale. 3. Cashier enters item identifier. 3. ? CAS. enter. Item. Identifier 4. System records sale line item 4. #record. Sale. Line. Item, and presents item description #present. Item. Description_Total and running total. … … 8. System logs completed sale 8. #log. Sale, !AS. send. Sale. Payment. Information, and sends sale and payment !IS. send. Sale. Payment. Information information to the external Accounting system and Inventory system Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Parse Trees • Compound sentence parse tree Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Compound and Complex Sentences • Complex sentence parse tree • If more reports are available in this session, advertiser than … Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Independent Clause • Independent clause with more than one verb Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Multiple Direct and Indirect Objects • System logs completed sale and sends sale and payment information to the external Accounting system and Inventory system • First Object is the left most noun phrase containing child noun nodes. Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Handling Incorrect Parse Trees • • Correct and incorrect parse tree Limited precision (90%) and recall (80%) of statistical parsers Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Metric to Select Best Parse Tree I • The score of an action set is the sum of scores of individual actions included in the set. • unknown action : = -1000 • illegal action : = -100 • condition action : = 1, • terminate action: =5 • goto action : = 6 • direct-objects-score : = number of words in all action’s direct objects + number of direct objects. • internal action: = 3 + direct-objects-score • receive action : = 3 + direct-objects-score • send action : = 4 + direct-objects-score + number of words in its indirect object. Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Metric to Select Best Parse Tree II • Correct direct object sub-tree is selected Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
Evaluation & Summary • Major Achievements § § Complex/compound sentences Multiple verbs, direct / indirect objects Premises violation detection Best parse tree selection • Evaluated on Use Cases from RUP, Larman (307 use case steps) • Error rate about 10% Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
References Plasil, F. , Mencl, V. : Getting “Whole Picture” Behavior in a Use Case Model, in Transactions of the SDPS: Journal of Integrated Design and Process Science, vol. 7, no. 4, pp. 63 -79, Dec. 2003. § also in Proceedings of IDPT 2003, Austin, TX, Dec. 2003 Mencl, V. : Deriving Behavior Specifications from Textual Use Cases, in Proceedings of Workshop on Intelligent Technologies for Software Engineering (WITSE 04, part of ASE 2004), Linz, Austria, Oesterreichische Computer Gesellschaft, Sep. 2004. Mencl, V. : Use Cases: Behavior Assembly, Behavior Composition and Reasoning, Ph. D. Thesis, advisor: Frantisek Plasil, Charles University, Prague, Jun. 2004. Drazan, J. : Natural Language Processing of Textual Use Cases, Master’s thesis, advisor: Vladimir Mencl, Charles University, Feb. 2006. http: //dsrg. mff. cuni. cz/procasor Jaroslav Drazan, Vladimír Mencl Improved Processing of Textual Use Cases: Deriving Behavior Specifications
- Slides: 15