Download presentation
Presentation is loading. Please wait.
Published byAshley Dixon Modified over 9 years ago
1
CEN 5070 -- Software V&V Spring 2002 Testing 103 -- Application Forms © 2001-2002, Dr. E.L. Jones
2
1/2002Testing 103 - Forms2 What is Testing? Executing a software element to determine whether it meets its specification Executing a software element to discover defects or anomalies Inspecting software element code to discover defects or anomalies.
3
1/2002Testing 103 - Forms3 Form Testing -- Introduction Form testing is a bottom-up process involving testing of visual properties, cursor movement, data entry and display, and actions triggered by buttons. Test patterns can be exploited to provide a systematic test process. With forms, certain properties can be tested immediately; others require varying degrees of system integration.
4
1/2002Testing 103 - Forms4 Examples of Units User-Visible software elements Fields on forms Buttons on forms Entire forms (reports) Program-Internal software elements Subprograms (procedures, functions, mains) Classes Databases
5
1/2002Testing 103 - Forms5 Elementary Units Form Field Navigation Button Operation Button Database Field Stored Procedure Query Program Code Main Method Function Script
6
1/2002Testing 103 - Forms6 WHY IS A FIELD A UNIT? Field has properties Data type and domain (size, value set, default) Visual appearance (color, case, alignment) Accesibility" Read-only, write-only, R/W Field has behavior Validation -- reject if property rule violated Messaging -- to report violation Global status -- bad field invalidates form
7
1/2002Testing 103 - Forms7 FIELD ATTRIBUTES and BEHAVIOR Data type Length Format Domain Default value Validation rules Error messages
8
1/2002Testing 103 - Forms8 TESTING AN INPUT FIELD An Error-Handling Approach A primary function of an input field is to validate data entered into a field, and to notify the user if an error occurs. Properties of the field determine error conditions and the correct response Input field testing ensures that only valid input is accepted, and proper error handling occurs.
9
1/2002Testing 103 - Forms9 RELATIONSHIP BETWEEN ATTRIBUTES and VALIDATION Validation rules perform self-checking at field, form, and/or database level Lotus Notes prevents some input errors Input masking prevents formatting and data type errors List boxes prevent input errors Certain "semantic" errors still must be checked (inconsistency)
10
1/2002Testing 103 - Forms10 BEFORE WE CONTINUE … A LOOK AHEAD We derive generic test case specifications for certain types of fields Text boxes -- string and numeric data List boxes -- string and numeric data These become worksheet templates for designing field test cases
11
1/2002Testing 103 - Forms11 WHERE IS THE WORK? … A LOOK AHEAD Developer must supply actual test cases for each test case specification Some specs expand into multiple test cases Developer may derive additional generic test case specs for new field types Developer combines test cases into a test worksheet.
12
1/2002Testing 103 - Forms12 Deriving Generic Test Case Specs for a Text Box a1: PREVENTED | Action a2: Data Type Error Msg | X a3: Length Error Msg | X a4: Format Error Msg | X a5: Domain Error Msg | X a6: Field set to Default | X a7: Truncated/padded | X a8: Input accepted | X a9: FIELD ERROR | X c1: Wrong Data type | Y N N N N Condition c2: Wrong Length | - Y N N N c3: Wrong format | - - Y N N c4: Illegal value | - - - Y N c5: Default value used | N Y c6: Wrong default value | Y
13
1/2002Testing 103 - Forms13 TEXT BOX Functional TEST CASES (Generic) CaseStimulusExpected Response 1 Wrong data typeData type error message 2 Length error message 3 Length error message, truncate 4* Format error message 5 Value error message 7 ACCEPT Default value. 6 ACCEPT value Default value selected Non-Default value entered Illegal value only. Good type, length; bad format Good type, too long Good type, too short 8 UNEXPECTED: FIELD Error. Wrong Default value displayed * Expand based on format syntax
14
1/2002Testing 103 - Forms14 TEXT BOX Boundary TEST CASES (Generic) CaseStimulusExpected Response 9 GOOD: Length = minimumACCEPT field 10 11 12 GOOD: value = "maximum" GOOD: value = "minimum" GOOD: Length = maximum Tester sees only the Generic Test Cases, not the process followed to derive them. ACCEPT field
15
1/2002Testing 103 - Forms15 DOSAGE CALCULATION FORM -- Specification Field/ButtonDescription (Specification) Patient Name Patient Age Dosage Calculate Dosage Button Clear Button Name. 1-20 alpha/comma chars. Format: Last, First Middle Computed output field. Whole number, in range 0-5. Action button. Compute dosage based on Age, Weight, and display in Dosage field. List box: {12 and under, 13-65 (default), 65-80, over 80 }. Form button. Clear all input and output fields. Patient WeightWeight in pounds. Whole number, in range 1-900. Save Button Action button. Save form data to Trials Database. GoBack ButtonNavigation button. Return to previous screen.
16
1/2002Testing 103 - Forms16 a) Fill in FIELD NAME b) Create TEST DATA for each row. c) Complete the expected result -- at minimum, issue a message if an error occurs. d) If a test condition does not apply for the field, delete the row from the worksheet. Your Turn -- Error Test Cases (Dosage Form Name Field) 1. Remove the Form Test Worksheet after Tab4 2. You will use Section A -- Field Unit Test 3. Complete the TextBox-Text Data template.
17
1/2002Testing 103 - Forms17 Name Field Test Worksheet Text Box (Text)
18
1/2002Testing 103 - Forms18 a) Fill in FIELD NAME b) Create TEST DATA for each row. c) Complete the expected result -- at minimum, issue a message if an error occurs. d) If a test condition does not apply for the field, delete the row from the worksheet. Your Turn -- Error Test Cases (Dosage Form Weight Field) 1. Use the Form Test Worksheet, Section A. 2. Complete the TextBox-Numeric Data template
19
1/2002Testing 103 - Forms19 Weight Field Test Worksheet Text Box (Numeric)
20
1/2002Testing 103 - Forms20 Deriving Generic Test Case Specs for a List Box a1: PREVENTED | X X X X Action a2: Field set to Default | X a3: Input accepted | X a4: FIELD ERROR | X Condition c1: Wrong Data type | N c2: Wrong Length | N c3: Wrong format | N c4: Invalid value | N c5: Default selected | Y N - c6: Wrong default value | N N Y List boxes prevent these input errors.
21
1/2002Testing 103 - Forms21 LIST BOX Functional/Boundary TEST CASES (Generic) CaseStimulusExpected Response 1 Select Default value.ACCEPT DefaultValue 2 ACCEPT ListValue_k 3 FIELD Error, no message. Wrong Default value displayed. Select k'th value from List. * Boundary test cases. 4 First list item ACCEPT first ListValue. 5 Last list item ACCEPT last ListValue
22
1/2002Testing 103 - Forms22 a) Fill in FIELD NAME b) Create TEST DATA for each row. c) Complete the expected result -- at minimum, issue a message if an error occurs. d) If a test condition does not apply for the field, delete the row from the worksheet. Your Turn -- Error Test Cases (Dosage Form Age Field) 1. Use the Form Test Worksheet, Section A. 2. Complete the ListBox template.
23
1/2002Testing 103 - Forms23 Age Field Test Worksheet List Box
24
1/2002Testing 103 - Forms24 Other Form-Field Attributes (verify using checklist *) Form-Level Test –Data source –Data destination –Correlated fields –Tab/Cursor sequence * Field-Level Test –Required Field –Input only access* –Output only access* –Input/Output access* –Visual appearance *
25
1/2002Testing 103 - Forms25 WHEN IS VALIDATION PERFORMED? At the field level, immediately upon changing focus from field (e.g., client side) Supports field build & test At the form level, upon clicking a button that requires the data (e.g., server side) Deferred field test, rolled into form test.
26
1/2002Testing 103 - Forms26 GOOD NEWS! A FIELD IS REUSABLE! Same field used on many forms Most attributes are the same, so are the validation rules Field implementation and test are reusable Only form-specific attributes may change Insight: There are reusable test patterns based on field attributes.
27
1/2002Testing 103 - Forms27 Objective Testing a button is testing a function that uses form input field data, and may produce form output fields. There may be additional stimuli and responses beyond those observable from the form. A button test is a black-box test.
28
1/2002Testing 103 - Forms28 Testing the SAVE Button Identify stimuli and responses Schematic diagram Develop decision table Ask questions about required behavior Identify conditions for certain behavior Develop test cases Functional and boundary test cases
29
1/2002Testing 103 - Forms29 SAVE Button Black-Box Schematic Stimulus TypeResponse Type SAVE Button Inputs Database Outputs Database Name, Age, Weight Trials DB Error Msg? Trials DB
30
1/2002Testing 103 - Forms30 Asking the Right Questions Preconditions? Trials database OPEN and available Form fields are valid Postconditions? Entry for patient in Trials database #entries per patient? How are entries stored? Errors Detected, Messages? Field data not valid Unable to update, given field data
31
1/2002Testing 103 - Forms31 SAVE Button DECISION TABLE c1: Trials DB open | N Y Y Y Y Y c2: Valid Age | Y Y N Y Y c3: Valid Weight | Y Y N Y c4: Valid Name | Y Y N c5: Name already in DB | N Y a1: "DB not ready" msg | X a2: Save | X a3: "Duplicate entry" msg | X a4: "Invalid Field" msg | X X X * Impossible to have invalid Age: list box with default. * (a4) Possibly a different message for each field.
32
1/2002Testing 103 - Forms32 SAVE Button Functional Test Cases CaseStimulusExpected Response 1 1a 3 5 6 Trials DB not ready, good fields"DB not ready" msg, no save. Trials DB not ready, bad Name field"??" msg, no save. DB ready, duplicate Name"Duplicate" msg, no save. DB ready, bad Weight only."Bad Field" msg, no save. DB ready, bad Name only"Bad Field" msg, no save. 2 DB ready, unique NameSAVED, no msg. 4x Impossible -- dropN/A * Multiple errors: which one takes precedence? * Infeasible test case, given list box!
33
1/2002Testing 103 - Forms33 Your Turn -- Testing the CalculateDosage Button Identify stimuli and responses Schematic diagram Develop decision table Ask questions about required behavior Identify conditions for certain behavior Develop test cases Functional and boundary test cases
34
1/2002Testing 103 - Forms34 Your Turn -- CalculateDosage Button Black-Box Schematic Stimulus TypeResponse Type Calculate Dosage Button Argument Inputs Globals Database Exception Argument Outputs Globals Database Exception
35
1/2002Testing 103 - Forms35 Errors Detected, Messages? Preconditions? Postconditions? patient? Your Turn -- CalculateDosage Button -- Questions
36
1/2002Testing 103 - Forms36 Your Turn -- CalculateDosage Button Decision Table c1: | c2: | a1: Dosage = calculated #pills | a2: | a3: | a4: | a5: | NOTE: This table deals with the activation of the button in terms of visible form elements (input/output fields and error messages). Detailed rules for calculating the value were treated in Unit Testing Concepts session.
37
1/2002Testing 103 - Forms37 Your Turn -- CalculateDosage Button Test Cases CaseTest Data/ActionsExpected Response 1 NOTE: These cases begin with form-level error handling for the CalculateDosage button, and contains functional test cases from the Concepts session. 2 3 4
38
1/2002Testing 103 - Forms38 Button Testing -- Summary Testing a button is easy when the test analysis has already been performed on the underlying function. The form expands the scope of the function to include visible fields and hidden effects (e.g., database updates). The basic question remains "what should happen, and where should I look for it?"
39
1/2002Testing 103 - Forms39 Form Testing -- Process Perform field tests Perform button tests Form buttons* Navigation* Action buttons Perform cursor tests* Initial position, tab sequence, position after data entry or button activation ------------------ * via checklist
40
1/2002Testing 103 - Forms40 Form Test Worksheet Cursor Movement & Navigation
41
1/2002Testing 103 - Forms41 Visual Properties Checklist
42
1/2002Testing 103 - Forms42 Form Testing -- Set Up Isolated Testing Form visual attributes Individual field testing -- validation Integrated Testing Form connected to other forms for navigation Buttons connected to underlying code Database connected
43
1/2002Testing 103 - Forms43 Form Testing -- Results Perform tests specified on Checklists and Worksheets created during design, and record results Form test checklist visuals cursor movement navigation Form test worksheet field test section* buttons test section ------------ * Generic based on field type.
44
1/2002Testing 103 - Forms44 Form Testing Worksheets Stored in Domino Master template Separate templates for each form element Construct Worksheet by including templates for form elements Preview Worksheets
45
1/2002Testing 103 - Forms45 Form Testing -- Summary Form testing is a bottom-up process involving testing of visual properties, cursor movement, data entry and display, and actions triggered by buttons. Certain properties can be tested immediately; others require varying degrees of system integration.
46
1/2002Testing 103 - Forms46 Name Field Test Worksheet
47
1/2002Testing 103 - Forms47 Weight Field Test Worksheet
48
1/2002Testing 103 - Forms48 Age Field Test Worksheet List Box
49
1/2002Testing 103 - Forms49 Your Turn -- Testing the CalculateDosage Button Identify stimuli and responses Schematic diagram Develop decision table Ask questions about required behavior Identify conditions for certain behavior Develop test cases Functional and boundary test cases
50
1/2002Testing 103 - Forms50 Your Turn -- CalculateDosage Button Black-Box Schematic Stimulus TypeResponse Type CALCULATE DOSAGE Button InputsOutputs Age, WeightErrorMsg? Dosage field
51
1/2002Testing 103 - Forms51 Your Turn -- CalculateDosage Button -- Questions Preconditions? Form fields are valid Initial value of Dosage field (e.g., blank)? Postconditions? Dosage field computed No other fields updated Cursor position Dosage blank if error Errors Detected, Messages? Form field data not valid Unable to calculate (Dosage field value: blank or ZERO?)
52
1/2002Testing 103 - Forms52 Your Turn -- CalculateDosage Button Decision Table c1: Weight = blank | Y N N c2: Valid Weight | - N Y* c3: Valid Weight | - N Y* a1: Dosage = calculated #pills | X* a2: Dosage field = blank | X X a3: Error msg = "can't compute" | X X a4: Cursor at Dosage field | X a5: Cursor at Weight field | X *NOTE: This table deals with the activation of the button in terms of visible form elements (input/output fields and error messages). Detailed rules for calculating the value were treated in Unit Testing Concepts session.
53
1/2002Testing 103 - Forms53 Your Turn -- CalculateDosage Button Test Cases NOTE: These cases begin with form-level error handling for the CalculateDosage button, and contains functional test cases from the Concepts session. CaseTest Data/ActionsExpected Response 1 2 3 4 Enter Name = "Doe, Joe" Enter Default Age Tab through BLANK Weight field Enter Name = "Doe, Joe" Enter Default Age Enter Weight = 925 Enter Name = "Test, Joe" Enter Age from functional test set Enter Weight from functional test set … Remaining functional test cases … 1." Invalid Weight" message 2. Dosage = blank 3. Cursor at Weight 1." Missing Weight" message 2. Dosage = blank 3. Cursor at Weight 1. Dosage = computed value (from test case) 2. Cursor at Dosage
54
1/2002Testing 103 - Forms54 Action Button Test Worksheet
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.