Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scripting Techniques Models and Analysis of Software Lecture 10 Copyright, 2003  Jerzy.

Similar presentations


Presentation on theme: "Scripting Techniques Models and Analysis of Software Lecture 10 Copyright, 2003  Jerzy."— Presentation transcript:

1 Scripting Techniques Models and Analysis of Software Lecture 10 Copyright, 2003  Jerzy R. Nawrocki

2 Plan wystąpienia Linear scripts Structured scripting Shared scripts Data-driven scripts Keyword-driven scripts

3 Linear scripts Linear script = A script obtained by recording a test case performed manually. Rational Robot & SQABasic User actions & result comparison 10’ manual test = 20’ – 120’ to automate (comparisons)

4 Linear scripts - Advantages No upfront work or planning. Quick starting. An audit trail of what was actually done. Programming skills not required. Good for demonstrations.

5 Linear scripts - Disadvantages Labor-intensive process (2-10 longer than manual testing. Low reusability and evolvability (‘from scratch’ each time). Low robustness (unexpected events).

6 Plan wystąpienia Linear scripts Structured scripting Shared scripts Data-driven scripts Keyword-driven scripts

7 Structured scripting Structured script = A script with structured programming instructions. Sequence, selection (if), iteration (for) SQABasic If Message = ‘Replace existing file?’ LeftMouseClick ‘Yes’

8 Structured scripts – Advantages and Disadvantages + More robust scripts (unexpected events under control). + Repeated things can be shortened with a loop statement. - More compicated (resemble programs and need debugging).

9 Plan wystąpienia Linear scripts Structured scripting Shared scripts Data-driven scripts Keyword-driven scripts

10 Shared scripts Shared script = A script used (shared) by more than one test case. SQABasic Call ScribbleOpen (‘countries’) FocusOn ‘Scribble’ SelectOption ‘List/Add Item’... Call ScribbleSaveAs (‘countries2’)

11 Plan wystąpienia Linear scripts Structured scripting Shared scripts Data-driven scripts Keyword-driven scripts

12 Data-driven scripts Data-driven scripting = Test inputs stored in a separate (data) file. countries, Sweden, USA, countries2 countries, France, Germany, test2 countries, Austria, Italy, test3

13 Data-driven scripts Data-driven scripting = Test inputs stored in a separate (data) file. OpenFile ‘ScribbleData’ For each record in ScribbleData Read INPUTFILE Read NAME1 Read NAME2 Read OUTPUTFILE Call ScribbleOpen (INPUTFILE) FocusOn ‘Scribble’ SelectOption ‘List/Add Item’ FocusOn ‘Add Item’ Type NAME1 LeftMouseClick ‘OK’... EndFor countries, Sweden, USA, countries2 countries, France, Germany, test2 countries, Austria, Italy, test3 ScribbleData Control script

14 A more sofisticated data-driven script OpenFile ‘ScribbleData’ Read INPUTFILE Call ScribbleOpen (INPUTFILE) Go to next record (ie row) For each record in ScribbleData Read ADDNAME If ADDNAME <> Blank Then { FocusOn ‘Scribble’ SelectOption ‘List/Add Item’ FocusOn ‘Add Item’ Type ADDNAME LeftMouseClick ‘OK} Read MOVEFROM Read MOVETO... EndFor ScribbleData countries Sweden USA 41 Norway 2 7 countries2 Control script

15 Data-driven scripts               Software under test Key automated regression test cases Additional automated regression test cases

16 Plan wystąpienia Linear scripts Structured scripting Shared scripts Data-driven scripts Keyword-driven scripts

17 Keyword-driven script = A data-driven scripts augmented with keywords representing user actions. SQABasic??? ScribbleOpen countries AddToList Sweden USA SaveAs countries2 For each TEST_ID OpenFile TEST_ID For each record in test file Read KEYWORD Call KEYWORD EndFor CloseFile TEST_ID EndFor Test file Control script ScribbleOpen... AddToList... SaveAs... Supporting scripts

18 Summary Most important: Keyword-driven scripting. Most important: Keyword-driven scripting. Self-documenting scripts Self-documenting scripts Script pre-processing: Script pre-processing: Beautifier Beautifier Static analysis Static analysis General substitution General substitution

19 Bibliography M. Fewster, D. Graham, Software Test Automation, Addison-Wesley, Harlow, M. Fewster, D. Graham, Software Test Automation, Addison-Wesley, Harlow, 1999.

20 Questions?

21 Quality assessment 1. What is your general impression? (1 - 6) 2. Was it too slow or too fast? 3. What important did you learn during the lecture? 4. What to improve and how?


Download ppt "Scripting Techniques Models and Analysis of Software Lecture 10 Copyright, 2003  Jerzy."

Similar presentations


Ads by Google