Presentation is loading. Please wait.

Presentation is loading. Please wait.

Towards Model-Driven Unit Testing Gregor Engels Baris Güldali Marc Lohmann 02. October 2006 3rd Workshop on Model design and Validation.

Similar presentations


Presentation on theme: "Towards Model-Driven Unit Testing Gregor Engels Baris Güldali Marc Lohmann 02. October 2006 3rd Workshop on Model design and Validation."— Presentation transcript:

1 http://s-lab.upb.de Towards Model-Driven Unit Testing Gregor Engels Baris Güldali Marc Lohmann 02. October 2006 3rd Workshop on Model design and Validation @ MoDELS 2006

2 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Model-driven Unit TestingUnit Testing Test CasesOperationComparator Test Case InputActual Result Expected Output Pass/No Pass Test Oracle Test Case Input Models generate 1 2 3 4

3 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Development Process

4 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing UML Class Diagrams & Visual Contracts

5 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Model-driven Unit Testing Test Cases Operation under Test Comparator Test Case InputActual Result Expected Output Pass/No Pass Test Oracle Test Case Input Models generate 1 2 3 4 

6 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing call operation under test execute original operation with call parameters Test Oracle Test driverSUT … check pre-condition check post-condition throw pre-condition exception throw post-condition exception return normally [pre-condition holds] [post-condition holds] [else] syste m state s k system state s k+1 return exception implemented by created by Programmer Designer Pass No Pass

7 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Model-driven Unit Testing Test Cases Operation under Test Comparator Test Case InputActual Result Expected Output Pass/No Pass Test Oracle Test Case Input Models generate 1 2 3 4   1.Which test cases are adequate for testing a system wrt. a testing criterion? 2.How can a SUT be set to a state where the test cases can be executed?

8 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Test case inputs: call parameters + system state 1.Generation of call parameters P = {cid=„abc“, prNo=„def“, num=1} 2.Generation of system state Test Case Generation Well-known test case generation techniques or random generation s input =

9 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Setting System State …

10 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing … Setting System State 3.Generation of system setting sequence s v ⊇ s input s0s0 s1s1 s2s2 stst susu svsv … … … … … … … … cartCreate operation n … Model checking techniques for computation of the system setting sequence: cartCreate, …, operation n

11 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Model-driven Unit Testing Test Cases Operation under Test Comparator Test Case InputActual Result Expected Output Pass/No Pass Test Oracle Test Case Input Models generate 1 2 3 4  

12 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Development Process + Testing VC Workbench JML Compiler JMLUnit JML

13 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Conclusion To do: Discussions on MoDeVa and other platforms Applying on a bigger case study Further reasearch with the aim of a dissertation Visual contracts for behavioral specification Generation of –Test oracles –Test cases Development Process and existing tools –Editor for visual contracts –Model checking tool –Test driver

14 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Thank you for your attention! Any questions?

15 © s-lab, University of Paderborn - http://s-lab.upb.de Engels, Güldali, Lohmann: Towards Model-Driven Unit Testing Contact Software Quality Lab University of Paderborn Warburger Str. 100 33098 Paderborn Germany http://s-lab.upb.de Baris Güldali baris@s-lab.upb.de@s-lab.upb.de Telefon: +49 5251-60 53 91 Fax: +49 5251-60 34 31


Download ppt "Towards Model-Driven Unit Testing Gregor Engels Baris Güldali Marc Lohmann 02. October 2006 3rd Workshop on Model design and Validation."

Similar presentations


Ads by Google