1 / 15

Unit Testing

Towards Model-Driven Unit Testing Gregor Engels Baris Güldali Marc Lohmann 02. October 2006 3rd Workshop on Model design and Validation @ MoDELS 2006. Unit Testing. Model-driven Unit Testing. 1. Models. 3. 2. generate. generate. 4. Test Case Input. Expected Output. Test Oracle.

svein
Télécharger la présentation

Unit Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TowardsModel-Driven Unit TestingGregor EngelsBaris GüldaliMarc Lohmann02. October 20063rd Workshop on Model design and Validation @ MoDELS 2006

  2. Unit Testing Model-driven Unit Testing 1 Models 3 2 generate generate 4 Test Case Input Expected Output Test Oracle Test Case Input Actual Result Test Cases Operation Comparator Pass/No Pass

  3. Development Process

  4. UML Class Diagrams & Visual Contracts

  5. Model-driven Unit Testing  1 Models 3 2 generate generate 4 Test Case Input Expected Output Test Oracle Operation under Test Test Case Input Actual Result Test Cases Comparator Pass/No Pass

  6. Test Oracle Designer created by Test driver SUT check pre-condition created by [else] throw pre-condition exception [pre-condition holds] … system state sk+1 execute originaloperation with call parameters system state sk implemented by call operation under test Programmer Pass check post-condition return [else] throw post-condition exception exception [post-condition holds] No Pass return normally

  7. Model-driven Unit Testing • Which test cases are adequate for testing a system wrt. a testing criterion? • How can a SUT be set to a state where the test cases can be executed?  1 Models  3 2 generate generate 4 Test Case Input Expected Output Test Oracle Operation under Test Test Case Input Actual Result Test Cases Comparator Pass/No Pass

  8. Test Case Generation Test case inputs: call parameters + system state • Generation of call parameters P = {cid=„abc“, prNo=„def“, num=1} • Generation of system state Well-known test case generation techniques or random generation sinput=

  9. Setting System State

  10. Setting System State • Generation of system setting sequence s0 cartCreate … … s1 s2 … … … … … … st su … operationn Model checking techniques for computation of the system setting sequence: cartCreate, …, operationn sv … sv⊇ sinput

  11. Model-driven Unit Testing  1 Models   3 2 generate generate 4 Test Case Input Expected Output Test Oracle Operation under Test Test Case Input Actual Result Test Cases Comparator Pass/No Pass

  12. Development Process + Testing VC Workbench JML JML Compiler JMLUnit

  13. 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 Conclusion

  14. Thank you for your attention!Any questions?

  15. 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 Telefon: +49 5251-60 53 91 Fax: +49 5251-60 34 31 Contact

More Related