Скачать презентацию Software test automation with UML 2 0 Testing Скачать презентацию Software test automation with UML 2 0 Testing

31bf26fe5a5069c9be39755dd0781029.ppt

  • Количество слайдов: 38

Software test automation with UML 2. 0 Testing. Profile & TTCN-3 Maili Markvardt Software test automation with UML 2. 0 Testing. Profile & TTCN-3 Maili Markvardt

Topics for Master’s thesis! n Topics for master’s thesis in the Institute of Computer Topics for Master’s thesis! n Topics for master’s thesis in the Institute of Computer Science are introduced Februrary 21 st at 13. 30 in VI-224

We will learn. . n Introduction to software test automation n What is UML We will learn. . n Introduction to software test automation n What is UML 2. 0 testing profile n What is TTCN-3 – brief overview n UML 2 TP and TTCN-3 tools

Introduction n Manual testing – human tester conducts testing activities n Automated tests – Introduction n Manual testing – human tester conducts testing activities n Automated tests – tests are “written” in a (test) programming language and are conducted by special test automation tools n Automating must be carefully considered, because it can in some cases be less effective than manual testing

Test automation tools n Many different tools for functional and performance testing Jmeter, Fitnesse, Test automation tools n Many different tools for functional and performance testing Jmeter, Fitnesse, Mercury tools, Rational tools … n XUnit = unit testing tools for different languages n n UML 2. 0 Testing Profile – language for modeling testing n TTCN-3 – language for automating testing

Why UML 2. 0 TP and TTCN-3? n UML – de facto standard in Why UML 2. 0 TP and TTCN-3? n UML – de facto standard in software engineering n UML is a LANGUAGE, not a method or a tool! n Besides that, UML is a very powerful language n TTCN-3 and UML 2. 0 TP - created to support each other, but n They don’t require each other – separate usage is possible

UML and profiles n Profiles are meant for tailoring UML for specific application domains, UML and profiles n Profiles are meant for tailoring UML for specific application domains, for example Profile for CORBA n Profile for Qo. S and Fault tolerance n Profile for Scedulability, Performance and Time (Real-Time Profile) n UML Testing profile – since autumn 2005 n

UML 2. 0 Testing Profile n A language for designing, visualising, specifying, analysing and UML 2. 0 Testing Profile n A language for designing, visualising, specifying, analysing and documenting artifacts concernging testing systems Test architecture n Test dynamics n Test data n Test timing n Once more: UML TP is a language, not an method. It provides a notation rather than specifying the usage! n

Meta model? ! n Meta model is a language (set of rules) for describing Meta model? ! n Meta model is a language (set of rules) for describing models of some language n Example: book meta model

11 8 10 3 2 5 4 6 1 7 9 11 8 10 3 2 5 4 6 1 7 9

Test data = stimuli + observations ? -> OCL-> * -> Test data = stimuli + observations ? -> OCL-> * ->

Test timing n Timer n start(expires: Time) n Stop() n Read(): Time n is. Test timing n Timer n start(expires: Time) n Stop() n Read(): Time n is. Running: Boolean n Time. Out() : Time. Out. Message n Timezone n Get. Time. Zone n Set. Time. Zone Start(. . ) Stop() time. Out

Diagram types n Package, class, component diagrams for specifying the test system structure n Diagram types n Package, class, component diagrams for specifying the test system structure n Sequence and state machine diagrams for specifying the test system behaviour

Bank exampe – unit, integration and system tests in UML TP Bank exampe – unit, integration and system tests in UML TP

Unit test n Verify, that SUT (system under test) properly calculates the amount of Unit test n Verify, that SUT (system under test) properly calculates the amount of money added by the user

Unit test – Test Case Unit test – Test Case

The same unit test in JUnit public class Money. Test extends Test. Case { The same unit test in JUnit public class Money. Test extends Test. Case { public void add. Same. Money { Money money 1 = new Money(20, “USD”)); Money money 2 = new Money(50, “USD”)); money 1. add(money 2); } assert. True(money 1. equals(new Money(70, “USD”)) }

Integration test example Integration test example

Integration test example (2) Integration test example (2)

Integration test example (3) Integration test example (3)

Integration test example (4) n Testi konfiguratsioon Integration test example (4) n Testi konfiguratsioon

Integration test example (5) Integration test example (5)

Integration test example (6) Integration test example (6)

System test example System test example

System test example (2) System test example (2)

System test example (3) System test example (3)

System test example (4) System test example (4)

System test example (5) System test example (5)

System test example (6) System test example (6)

System test example (7) System test example (7)

System test example (8) System test example (8)

Mappings n UML TP -> TTCN-3 n Black/grey box unit, integration and system tests Mappings n UML TP -> TTCN-3 n Black/grey box unit, integration and system tests n Concepts used in UML TP and TTCN-3 are practically the same n UML TP -> JUnit n Only black box unit tests n Partial support of UML TP concepts in JUnit

TTCN-3: The Testing and Test Control Notation n Jet another test programming language? n TTCN-3: The Testing and Test Control Notation n Jet another test programming language? n For functional, interoperability, regression, unit, integration and system testing in reactive (feedbackenabled) systems and distributed systems n Telecom, mobile, internet ja CORBA-based systems n Almost full support of UML TP concepts n Founder: European Telecommunications Standards Institute (ETSI) 1999 – 2001, latest version from 2007 n TTCN-3 originates from Tree And Tabular Combined Notation (TTCN-1 ja TTCN-2)

TTCN-3 n Presentation formats: n Core language, n Graphical representation (MSC), n Table representation, TTCN-3 n Presentation formats: n Core language, n Graphical representation (MSC), n Table representation, n + Possibility to define your own presentation formats TTCN-3 Core Notation Tabular Format Graphical Format Presentation Format n

Example of a function invalid. PIN_hwe(integer invalid. PIN) runs on HWEmulator { activate(HWEmulator_classifierdefault()); hw. Example of a function invalid. PIN_hwe(integer invalid. PIN) runs on HWEmulator { activate(HWEmulator_classifierdefault()); hw. Com. call(store. Card. Data: {current}, nowait); t 1. start(2. 0); hw. Com. getreply(display_: {"Enter PIN"}); t 1. stop; hw. Com. call(is. Pin. Correct: {invalid. PIN}, 3. 0) { [] hw. Com. getreply(is. Pin. Correct: {? } value false) {} } hw. Com. getreply(display_: {"Invalid PIN"}); hw. Com. getreply(display_: {"Enter PIN again"}); arbiter. send(pass_); // local verdict to the arbiter }

Example of a Default altstep HWEmulator_classifierdefault()runs on HWEmulator_CType { var charstring s; [] t Example of a Default altstep HWEmulator_classifierdefault()runs on HWEmulator_CType { var charstring s; [] t 1. timeout {arbiter. send(fail_); } [] hw. Com. getcall(eject. Card: {}) {arbiter. send(fail_); } [] hw. Com. getcall(display_: {? }) -> param (s) { if (s == "Connection lost") { arbiter. send(inconc_) } else {arbiter. send(fail_)} }

Tools n UML TP n Sparx. Systems Enterprise Architect 6. 0 n Eclipse Hyades Tools n UML TP n Sparx. Systems Enterprise Architect 6. 0 n Eclipse Hyades Project CASE tool n Theoretically possible to use any CASE tool providing stereotyping (? ) n TTCN-3 n Elvior’s Message. Magic (commercial) n Eclipse Framework plug-ins - TTCN-3 core laguage editor and compiler (commercial) n Open. TTCN Tester for TTCN-3 (commercial) n Conformiq QTronic – TTCN-3 test generator (from UML models)

Further reading 1. 2. 3. 4. TTCN-3 Home Page [ www. ttcn 3. org] Further reading 1. 2. 3. 4. TTCN-3 Home Page [ www. ttcn 3. org] www. fokus. fraunhofer. de/u 2 tp OMG Unified Modeling Language [ http: //www. uml. org ] – UML 2. 0 Testing Profile Specification Schieferdecker, Grabowski, Rennoch. 2003. The UML 2. 0 Testing Profile and its relation to TTCN-3 [ http: //www. swe. informatik. unigoettingen. de/publications/IS_ZD_JG_AR/Test. Com 2003_UTP_Final. pdf ]