Functional Testing Testing against the Requirements

Slides:



Advertisements
Similar presentations
Chapter 4: Requirements Engineering
Advertisements

Withdrawal Transaction Use Case Primary Actor: Customer Pre-conditions: The customer must have a valid ATM card and PIN. Post-conditions: The customer.
Use Case & Use Case Diagram
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
Use Case Model. C-S 5462 Use case model describes what the user expects the system to do –functional requirements may describe only the functionalities.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
USE CASE – ATM EXAMPLE Actors: ATM Customer ATM Operator Use Cases: The customer can withdraw funds from a checking or savings account query the balance.
Requirement Analysis and Specification Mr. Manoj Kumar Kar.
Extending the Requirements Model - techniques for detailing use cases
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
Requirements and Design
ATM – requirements Team B Tom Hastjarjanto Martijn Nijenhof Ales Sturala Paul van der Ende.
ATM User Interface V3. I/O Devices Input: Keyboardfor input, option select Keyboardfor input, option select Or Touch screen Or Touch screenOutput: Screenfor.
CS3773 Software Engineering Lecture 03 UML Use Cases.
Unit 211 Requirements Phase The objective of this section is to introduce software system requirements and to explain different ways of expressing these.
Use Cases & Requirements Analysis By: Mostafa Elbarbary.
Object-Oriented Development Process Part I: Requirement Gathering Warsun Najib Department of Electrical Engineering Gadjah Mada University.
 A data processing system is a combination of machines and people that for a set of inputs produces a defined set of outputs. The inputs and outputs.
McGraw-Hill/Irwin Introduction to QuickBooks Pro, 2004 © 2005 The McGraw-Hill Companies, Inc., All Rights Reserved. Chapter 4 Bank Reconciliation.
2013.  Reconcile your checking account  Create bank reconciliation reports  Find errors during reconciliation  Correct errors found during reconciliation.
Object-oriented Design CSCI 5801: Software Engineering.
Requirements-based Testing SYSTTEXT 1 Testing against the requirements Extracting test cases from requirements Use cases and test cases Grammar types implying.
Big Java Chapter 12. Software Process - Waterfall Analysis Design Implementation Testing Deployment Does not work well when rigidly applied! established.
ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 2004.
Online Translation Service Capstone Design Eunyoung Ku Jason Roberts Jennifer Pitts Gregory Woodburn Kim Tran.
Chapter 14 System Testing.
UML basics UML distilled, a brief guide to the standard Modeling language, by Martin Fowler, 2000.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Bridging the Gap between logical requirements-based Test Cases and physical Test Data Generation Presentation for Swiss Testing Day by Harry M. Sneed,
1 Graph Coverage (6). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
CS212: Object Oriented Analysis and Design Lecture 32: Use case and Class diagrams.
System Test Planning SYSTTPLAN 1 Location of Test Planning Responsibilities for Test Planning Results of Test Planning Structure of a Test Plan Test Definitions.
System Test Design The Location of Test Design Test Design Structure
1 Intro stored procedures Declaring parameters Using in a sproc Intro to transactions Concurrency control & recovery States of transactions Desirable.
1 Requirements Engineering From System Goals to UML Models to Software Specifications Axel Van Lamsweerde.
Use Case Diagrams. Introduction In the previous Lecture, you saw a brief review of the nine UML diagrams. Now that you have the clear, you'll start to.
Bank Reconciliation Chapter 4. PAGE REF #CHAPTER 4: Bank Reconciliation SLIDE # 2 Objectives Reconcile your checking Create bank reconciliation reports.
UC Diagram & Scenario RKPL C & D. Using Use Case Diagram Use case diagrams are used to visualize, specify, construct, and document the (intended) behavior.
1 Object-Oriented Static Modeling of the Banking System - III Lecture # 33.
1 Case Study and Use Cases for Case Study Lecture # 28.
CENTURY 21 ACCOUNTING © 2009 South-Western, Cengage Learning Today’s Target! Tues., Jan. 26 th  Students will journalize sales and cash receipts using.
OPS Requirements Specification and Analysis Dustin Larson Bryan Campbell Charles Sears.
Alternative Software Size Measures for Cost Estimation
Using Use Case Diagrams
DFD(Data Flow Diagram)
Paul Ammann & Jeff Offutt
Requirements Spec Revisited
CMPE 280 Web UI Design and Development August 29 Class Meeting
Use Case Modeling - II Lecture # 27.
Structured Analysis and Design Technique
Foundations of Information Systems in Business
Oracle Subledger Accounting
Storyboarding and Game Design SBG, MBG620 Full Sail University
How to Redeem a Resource Manager Token in AIM
Dynamic Modeling of Banking System Case Study - I
Use Case Model.
Object-Oriented Static Modeling of the Banking System - I
Exercices & Corrections Week 3
Alternative Software Size Measures for Cost Estimation
SE-565 Software System Requirements IV. Use Cases
Use Case Modeling - techniques for detailing use cases
Concepts, Specifications, and Diagrams
Chapter 14 System Testing
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Paul Ammann & Jeff Offutt
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Requirements Management
Using Use Case Diagrams
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Online Translation Service Capstone Design
Presentation transcript:

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 1

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

Properties of a Function TEST FUNC-2 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 X i f (Y ) = 3

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

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

Functional Hierarchy Business Function Main Function Use Case TEST FUNC-5 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

SOFSPEC Function Definition TEST FUNC-6 F U N C T I O N H E A D E R Name: This_Function Typ: ELEM Version: 1 Kategorie: 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

Potential Functional Test Oracles User- Requirement Doc Specification Langiuage System Prototype Usage Guide Z VDL RSL UML OCL Operational Profile According to William Howden "Functional Program Testing"

Testing against the User Guide FUNC-8 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:999 REL-TYPE = 1:1 / 1:N / M:1 / M/N COND = U for UNCONDITIONAL or C for CONDITIONAL TARGET-OBJECT = A Valid Object Name Testcase 1: Invalid Base Object name Testcase 2: Undefined Action ACT = Delete Testcase 3: Invalid LINE-NR < 1 or > 999 Testcase 4: Invalid Relation REL-TYPE = N:M Testcase 5: Invalid Condition COND = ' ' Testcase 6: Invalid Target Object Name Testcase 7: Add a 1:1 unconditional Relation Testcase 8: Add a 1:N conditional Relation Testcase 9: Change an M:1 unconditional Relation Testcase 10: Change an M:N conditional Relation 9

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

Extracting Test Cases from Decision Tables FUNC-10 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 11

Extracting Test Cases from Decision Trees FUNC-11.1 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)

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;

Extracting Test Cases from Business Rules FUNC-12 Service Function Test Case Generation Action Description If Account_Balance minus the withdrawal is more than the credit limit allow the withdrawal In case the withdrawal causes the Account_Balance to fall below the credit limit refuse the withdrawal. 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 treated separately and combined with the other conditions in the same action to give the number of testcases = nr_conditions2 Conditional keywords are scanned.

Testing against a Requirement Net (1976) FUNC-13 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

Testing a Patient Monitoring System FUNC-14 R-Net-Entry Measuring device Requirement Specification with RSL Patient Monitoring System Receive Message invalid Measure or Valid Measure and & 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

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

The Use Case Specification TEST FUNC-16 Use Case Name Purpose Description of Steps Pre- Conditions Post- Conditions Alternatives Error Handling

Sample Use Case Description TEST FUNC-17 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)

From Use Case to Test Cases FUNC-18 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

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

Extracting Test data from IT Production FUNC-20 Transaction Monitoring Data Capture User Interface Data Stream Dialog Recording Program Program Transaction Logging Prod. Data Base Trans. Log- File Test Data- base

Test Case Recording Transaction Order  Positions (n) Data entry FUNC-21 Transaction Order  Positions (n) Data entry Trans = ORDER OrderNr = 101 Customer = Smith Position (1) Pos_Nr = 1 ArticleNr = 4711 Amount = 3 Recording Transaction Store Test Cases Replay Production Program --------- --------- Test- data Batch Dialog Simulator 23

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

Functional Test Coverage Test Goals User Guide Requirement Specification Usage Profile Coverage of all defined Usages Coverage of all specified Requirements Coverage of all previously used Functions

Test the Business Rules of an Order Entry System FUNC-24 Objects Actions PreConditions Customer_Order reject accept if Customer is unknown or Customer Credit is bad if Customer is known and Customer Credit is good Order_Position fulfill reject postpone if Article is on stock and AmountonStock > OrderedAmount if Article is not on stock If AmountonStock not > OrderedAmount Delivery_Notice create if Order-Position is fulfilled Back_Order if Order_Position is postponed Invoice_Position if Order_Position is fulfilled Article change if AmountonStock > OrderedAmount Supply_Position if AmountonStock < MinimumLevel Supplier select if SupplierPrice = Minimum(SupplierPrices) Supply_Order write if Supplier is selected and Suppy_Position exits