1 / 26

Functional Testing

TEST. FUNC. Functional Testing. Testing against the Requirements Properties of a Function Functional Processes Nested Functions Functional Hierarchy SOFSPEC Function Definition Potential Functional Test Oracles Test against the User Documentation Testing against a Specification

ramla
Download Presentation

Functional 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. TEST FUNC Functional Testing Testing against the Requirements Properties of a Function Functional Processes Nested Functions Functional Hierarchy SOFSPEC Function Definition Potential Functional Test Oracles Test against the User Documentation Testing against a Specification Test Cases from Decision Tables Test Cases from Decision Trees Test Cases from Business Rules Testing against a Requirement Net Testing a Patient Monitoring System Testing Use Cases of an ATM The Use Case Specification Sample Use Case Description From the Use Case to Test Cases Testing against an operational Profile Extracting Test Cases from Production Testcase Recording Operational Profile as a Feedback Loop Functional Test Coverage Test the Business Rules of an Order Entry System 1 13 2 14 3 15 4 16 5 17 6 18 7 19 8 20 9 21 10 22 11 23 12 24

  2. TEST FUNC-1 Testing against the Requirements Requiremnt Specification (Oracle) Software System Functional Testing means testing the System against the Requirement Specification (functional & non-functional Requirements)

  3. TEST FUNC-2 Properties of a Function X f = (Y ) i i i Trigger (Pre Conditions) (Post Conditions) Function (f) Input domain Output domain Y X i Input States (1:N) Output States (1:N) Process- ing Rules Business Rule

  4. TEST FUNC-3 Functional Processes Y Y Y X X Y X X (1) (1) (2) (4) (2) (4) (3) (3) X Y (1:4) (1:4) Input Domain Output Domain Original State Function (1) Intermediate State Pre Conditions Function (2) Post Conditions Intermediate State Function (3) Final State

  5. TEST FUNC-4 Nested Functions General, abstract Functions detailed Basic function Basic function Functions Functional Hierarchy To what level of granularity should functions be tested?

  6. TEST FUNC-5 Functional Hierarchy Business Function Main Function Use Case Main Function Use Case Main Function Use Case Sub- function Sub- function Sub- function F F F The Goal is, to exercise every elementary Function in all variations Elementary Functions

  7. TEST FUNC-6 SOFSPEC Function Definition F U N C T I O N H E A D E R Name: This_Function Typ: ELEM Version: 1Kategorie: U Anzahl: N Purpose: Text Test Assertions Processing Rule ASSERT PRE EIN E RANGE (10+10); Read an Object EIN ASSERT PRE Y E RANGE (0:100); Compute X = Y - Z ASSERT PRE Z E SET (2,4,6,8); Set Object AUS to X ASSERT POST X = Y - Z Write AUS ASSERT POST AUS = X

  8. TEST FUNC-7 Potential Functional Test Oracles Functional Test User- Requirement Doc Specification Langiuage System Prototype Usage Guide ZVDLRSLUMLOCL Operational Profile According to William Howden "Functional Program Testing"

  9. TEST FUNC-8 Testing against the User Guide BASE-OBJEKT: XXXXXXXXXXXXXXXX ACT LINE-NR REL-TYPE COND TARGET-OBJEKT X 999 XXX X XXXXXXXXXXXXXX To create an Object/Object Relation, you must first submit the name of a valid base Object - a string of 32 characters starting with a letter. After that, you can submit a line for each target object with the action, line number, relation type, condition and name. ACT = A for ADD or C for CHANGE,LINE-NR = 1:999REL-TYPE = 1:1 / 1:N / M:1 / M/NCOND = U for UNCONDITIONAL or C for CONDITIONALTARGET-OBJECT = A Valid Object Name Testcase 1: Invalid Base Object nameTestcase 2: Undefined Action ACT = DeleteTestcase 3: Invalid LINE-NR < 1 or > 999Testcase 4: Invalid Relation REL-TYPE = N:MTestcase 5: Invalid Condition COND = ' 'Testcase 6: Invalid Target Object NameTestcase 7: Add a 1:1 unconditional RelationTestcase 8: Add a 1:N conditional RelationTestcase 9: Change an M:1 unconditional RelationTestcase 10: Change an M:N conditional Relation

  10. TEST FUNC-9 Testing against a formal Specification Specification Test = Function Tree Test Cases + Decision Logic Pre/Post-In/ Out- Data Domains Test Data

  11. TEST FUNC-10 Extracting Test Cases from Decision Tables Rules OrderedAmount = Valid N J J J OrderedAmount > AmountonStock - J N N AmountonStock < MinimumLevel - - N J Display “Invalid Order Amount"  Display “Insufficient Amount on Stock“ Fulfill Order & reduce Amount on Stock   Generate resupply order  Conditions Actions One Test case per Rule = 4 Test Cases

  12. TEST FUNC-11.1 Extracting Test Cases from Decision Trees Decision Tree Process_Order Check_Amount_Stock @ Display_Order_too_large_Error (1) PreCondiition: IF AmountonStock < OrderedAmount @ Reduce_AmountonStock (2) PreCondition: IF AmountonStock NOT < OrderedAmount @ Check_StockLevel (3) Precondition: IF AmountonStock NOT < OrderedAmount @ Generate_ResupplyOrder (3) Precondition: IF (AmountonStock < MinimumLevel)

  13. TEST FUNC-11.2 Test Cases 1 * Display_Order_too_large_Error IF (TESTCASE = 1) THEN ASSERT PRE AmountonStock < OrderedAmount; END; 2 * Reduce_AmountonStock IF (TESTCASE = 2) THEN ASSERT PRE AmountonStock > OrderedAmount; END; 3 * Generate_ResupplyOrder IF (TESTCASE = 3) THEN ASSERT PRE AmountonStock = OrderedAmount; ASSERT PRE AmountonStock < MinimumLevel; END;

  14. Extracting Test Cases from Business Rules Action Description If Account_Balance minus the withdrawal is more than the credit limit allow the withdrawalIn case the withdrawal causes the Account_Balance to fall below the credit limit refuse the withdrawal. TEST FUNC-12 Service Function Test Case Generation Test Case 1 2 3 4 Account_Balance minus the withdrawal is more than the credit limit Y Y N N Withdrawal causes the Account_Balance to fall below the credit limit Y N Y N Allow the withdrawal - X - - Refuse the withdrawal X - X - Each Condition is treatedseparately and combinedwith the other conditionsin the same action to givethe number of testcases = nr_conditions2 Conditional keywords arescanned.

  15. TEST FUNC-13 Testing against a Requirement Net (1976) R-Net Patient Monitoring Receive Message ASSERT Report Measurement Error Store Measurement Check Measurement ASSERT ASSERT Invalid Measure Valid Measure Report Patient ok Report Patient in danger Validation Points ASSERT ASSERT Safe Range Out of safe Range

  16. TEST FUNC-14 Testing a Patient Monitoring System R-Net-Entry Measuringdevice Requirement Specificationwith RSL Patient Monitoring System Receive Message invalid Measure or Valid Measureand & Report Measure Error Store Measure Check Measure Patient ok or Patient in danger System Display Message Log 1. Test Report ok Alarm Nurse on Duty 2. Test Alarm Display 3. Test

  17. TEST FUNC-15 Testing Use Cases of an ATM Deposit uses Withdrawal administer Account uses Transfer uses Account Status Print Balance Customer extends

  18. TEST FUNC-16 The Use Case Specification Use Case Name Purpose Description of Steps Pre- Conditions Post- Conditions Alternatives ErrorHandling

  19. TEST FUNC-17 Sample Use Case Description Name: Withdrawal Purpose: withdraw money from ATM Steps: 1) Customer submits Bank card and PIN-Nr. 2) Customer selects Amount 3) Account is checked if balance covers withdrawal 4) Balance is reduced by withdrawal Amount 5) ATM ejects the money Pre Condition: Bank Card is valid PIN-Number is correct Amount < (Balance + CreditLimit) Post Condition: Balance = Last.Balance - Amount if (Bank Card valid & PIN-Number correct & Amount < (Last.Balance + CreditLimit)

  20. TEST FUNC-18 From Use Case to Test Cases Pre Conditions: Functional Test Cases 1 2 3 4 5 PIN-Number B G G G G Bank Card - B G G G Amount > (Balance + CreditLimit) = (Balance + CreditLimit) < (Balance + CreditLimit) Post Conditions: Money N N N J J Message Incorrect PIN Invalid Card Account overdrawn ok ok G = Good B = Bad

  21. TEST FUNC-19 Testing against an operational Profile Software Product Application Monitor Monitor Monitor Transaction Data Profile Aggregation Test Database Software- test Software Product

  22. TEST FUNC-20 Extracting Test data from IT Production Transaction Monitoring UserInterface Data Capture Data Stream Dialog Recording Program Program TransactionLogging Prod. Data Base Trans. Log- File Test Data- base

  23. TEST FUNC-21 Test Case Recording ------------------ Test Cases TransactionOrder Positions (n) Data entry Trans = ORDEROrderNr = 101Customer = SmithPosition (1) Pos_Nr = 1 ArticleNr = 4711 Amount = 3 Recording Transaction Store Replay Production Program Test- data Batch Dialog Simulator

  24. TEST FUNC-22 Operational Profile as Feedback Loop Software-Evolution New Requirements Reusable Software Production Process Prototype Test Profile Product Test Process

  25. TEST FUNC-23 Functional Test Coverage Functional Test Goals Requirement Specification User Guide UsageProfile Coverage of alldefinedUsages Coverage of allspecifiedRequirements Coverage of allpreviously usedFunctions

  26. TEST FUNC-24 Test the Business Rules of an Order Entry System Objects Actions PreConditions Customer_Order rejectaccept if Customer is unknownor Customer Credit is badif Customer is knownand Customer Credit is good Order_Position fulfillrejectpostpone if Article is on stockand AmountonStock > OrderedAmountif Article is not on stockIf AmountonStock not > OrderedAmount Delivery_Notice create if Order-Position is fulfilled Back_Order create if Order_Position is postponed Invoice_Position create if Order_Position is fulfilled Article change if AmountonStock > OrderedAmount Supply_Position create if AmountonStock < MinimumLevel Supplier select if SupplierPrice = Minimum(SupplierPrices) Supply_Order write if Supplier is selectedand Suppy_Position exits

More Related