1 / 28

Requirements-based Testing

SYST. TEXT. Requirements-based Testing. Functional test cases (1) Functional test cases (2) Test Case Table Boundary analysis test cases Non functional requirements Non functional test cases Properties of a test case Test case description (1) Test case description (2) Test Database

kamil
Télécharger la présentation

Requirements-based 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. SYST TEXT Requirements-based Testing Functional test cases (1) Functional test cases (2) Test Case Table Boundary analysis test cases Non functional requirements Non functional test cases Properties of a test case Test case description (1) Test case description (2) Test Database From Requirements to Test Scripts Generated Test Script Testing against the requirements Extracting test cases from requirements Use cases and test cases Grammar types implying test cases A requirement text Objects identified in the requiremnt text Actions on objects in the requirement text States of objects in the requirement text Conditions in the requirement text Action oriented test cases Conditional test cases State based test cases 13 1 2 14 15 3 16 4 17 5 18 6 19 7 20 8 21 9 10 22 23 11 24 12

  2. SYST TEXT-1 Testing against the requirements User Interface Application System Database

  3. SYST TEXT-2 Extracting Test Cases from Requirements Objects Actions States Conditions Test Cases Functional Non-Functional Requirements Text

  4. SYST TEXT-3 Use Cases and test Cases One Use Case can have one or more Test case Normally, there are at least 2 Test Cases Positive outcome Negative outcome Cash Withdrawal Use Case = Invalid Card Wrong PIN Number Not enough cash Account overdrawn Cash delivered Test Cases

  5. SYST TEXT-4 Grammar Types implying Test Cases Actions upon objects: The customer account should be deleted. The invoice should be sent within 30 days. Object states: The customer account is overdrawn. The customer is an employee. Conditions If the account is overdrawn a notice should be sent. Whenever someone fails to pay within 30 days, a reminder should be sent. Customer accounts should be deleted, if they are overdrawn more than 3 months. In case of a system crash, the recovery routine should be started.

  6. SYST TEXT-5 A Requirements Text For an Order Entry System The order entry system to be developed should process orders coming in from customers. Whenever an order comes in, the person placing the order should be checked if he is a known customer and if his credibility is adequate. Orders will only be processed for existing customers with adequate credit rating. Each order can contain up to 10 order positions. Each filled order position will contain the number, name and amount of the article desired. For each order it should first be checked if the article is on stock. If not, that position will skipped. If the article is on stock, it should be checked if the amount on stock is sufficient to cover the order. If not, a back order should be created for this position. Otherwise, the order position should be fulfilled and the amount on stock reduced by the amount ordered. In this case, both a dispatch order and a billing position are to be generated. When the amount on stock is reduced, the new amount on stock is to be checked against the minimum amount on stock. If it is less than the minimum amount, a supply order should be automatically generated and sent to the supplier with the lowest supplier price for that article. The billing positions are to be collected at the end of each week to be ordered by customer. The amounts of the ordered articles are to be multiplied by the current price of the article and the charge for each article computed. The charges for all articles ordered should then be totaled to give the total charge to the customer.

  7. SYST TEXT-6 Objects Identified in the Order Entry Requirement Text • Order_Entry_System • Orders • Customers • Persons_placing_orders • Credibility/Credit_Rating • Order_Positions • Number_of_Article • Name_of_Article • Amount_of_Article • Amount_on_Stock • Back_Order • Dispatch_Order • Billing_Position • Minimum_Amount_on_Stock • Supply_Order • Supplier • Supplier_Price • Current_Price_of_Article • Total_Charge • Value_Added_Tax • Article_Type • Bills • Days

  8. SYST TEXT-7 Actions on Objects in the Order Entry Requirement Text • Process orders • Check persons placing orders • Chack article on stock • Check amount on stock • Create back order • Fulfill order position • Reduce amount on stock • Generate dispatch order • Generate billing position • Check new amount on stock • Generate supply order • Send supply order • Collect billing positions • Multiply amounts • Compute charge • Total charges • Augment total charge • Pay bills

  9. SYST TEXT-8 States of Objects in the Order Entry Requirement Text • Orders coming in • Customer is known/not known • Credibility is adequate/not adequate • Customer exists/does not exist • Orders with up to 10 order positions • Order position fulfilled/not fulfilled • Article desired • Article is on stock/not on stock • Amount on stock is sufficient/not sufficient • Supplier with lowest price/not with lowest price • Positions ordered by customer • Pay within 30 days

  10. SYST TEXT-9 Conditions in the Order Entry Requirement Text • Whenever an order comes in • If he is a known customer • If his credibility is adequate • For each order position • If the article is on stock • If the amount on stock is sufficient • If not (sufficient) • Otherwise, fulfill order • In this case (order fulfilled) • When the amount on stock is reduced • If it (amount on stock) is less than minimum amount

  11. SYST TEXT-10 Action Oriented Test Cases • Process orders ← submit 1:n orders • Check persons placing orders ← submit order from unknown customer • Check article on stock ← order article not on stock • Check amount on stock ← set Order.Position.Amount > Article.Amount • Create back order ← order article with amount > amount on stock • Fulfill order position ← order article with amount < amount on stock • Reduce amount on stock ← order article with amount < amount on stock • Generate dispatch order ← order article with amount < amount on stock • Generate billing position ← order article with amount < amount on stock • Check new amount on stock ← order article with amount < amount on stock • Generate supply order ← amount on stock < minimum amount on stock • Send supply order ← amount on stock < minimum amount on stock • & supplier found with the lowest price • Collect billing position ← set time to trigger billing process • Multiply amounts ← have a customer with >0 billing positions • Compute charges ← have a customer with >0 billing positions • Total charges ← have a customer with >0 billing positions • Augment total charge ← set value added tax rate • Pay bills ← create billing positions for n customers

  12. SYST TEXT-11 Conditional Test Cases • Whenever an order comes in ← submit order • submit no order • If he is a known customer ← customer is known • customer is not known • If his credibility is adequate ← customer.credit adequate • customer.credit not adequate • For each order position ← submit order with > 1 positions • If the article is on stock ← Order.Position.Art_Nr = Article.Art_Nr • Order.Position.Art_Nr != Article.Art_Nr • If the amount on stock is sufficient ← Order.Position.Amount < Article.Amount • If not sufficient ← Order.Position.Amount => Article.Amount • Otherwise, fulfill order • In this case (order fulfilled) • When the amount on stock is reduced ← Order.Position.Amount < Article.Amount • If it (amount on stock) is less than ← Article.Amount < Minimum.Amount • minimum amount

  13. SYST TEXT-12 State Based Test Cases • Orders coming in ← submit 1:n order • Customer is known/not known ← Order.Cust_Nr ! e Set(Customer.Cust_Nr) • exist /not exist Order.Cust_Nr ! є Set(Customer.Cust_Nr) • Credibility is adequate/not adequate ← Customer.Credit => #Adequate • Customer.Credit < #Adequate • Order with up to 10 order positions ← Order.Position (1:10) • Order with more than 10 positions ← Order.Position (11) • Order position is fulfilled/not fulfilled ← Order.Position_Nr > 0 • Order.Position_Nr = 0 • Article on stock/not on stock ← Order.Position.Art_Nr є Set(Article.Art_Nr) • Order.Position.Art_Nr ! є Set(Article.Art_Nr) • Amount on stock is sufficient/not sufficient ← Order.Position.Art_Nr -> Article.Amount > Order.Amount • Order.Position.Art_Nr -> Article.Amount <= Order.Amount • Supplier with lowest price ← Article.Art_Nr є Set(Supplier.Art_Nr) & • Article.Art_Nr -> Supplier.Price = min(Supplier.Price) • Position ordered by customer ← Order.Position.Art_Nr = Article.Art.Nr • Payment within 30 days ← Bill.Due.Date = Bill.Date + 30

  14. SYST TEXT-13 The Functional Test Cases (1) • Order in which Order.Cust_Nr !є Set(Customer.Cust_Nr) → unknown customer • Order in which Order.Cust_Nr є Set(Customer.Cust_Nr) & • Customer.Credit < #Adequate → credit not adequate • Order in which Order.Cust_Nr є Set(Customer.Cust_Nr) & • Customer.Credit => #Adequate & • Order.Position_Nr = 0 → null positions • Order in which Order.Cust_Nr є Set(Customer.Cust_Nr) & • Customer.Credit => #Adequate & • Order.Position_Nr > 0 & • Order.Position.Art_Nr !€ Set(Article.Art_Nr) → article not on stock • Order in which Order.Cust_Nr є Set(Customer.Cust_Nr) & • Customer.Credit => #Adequate & • Order.Position_Nr > 0 & • Order.Position.Art_Nr є Set(Article.Art_Nr) & • Order.Position.Amount > Article.Amount → create back order

  15. SYST TEXT-14 The Functional Test Cases (2) • Order in which Order.Cust_Nr є Set(Customer.Cust_Nr) & • Customer.Credit => #Adequate & • Order.Position_Nr > 0 & • Order.Position.Art_Nr є Set(Article.Art_Nr) & • Order.Position.Amount < Article.Amount & • (Article.Amount – Order.Position.Amount) > Minimum_Amount • Order in which Order.Cust_Nr є Set(Customer.Cust_Nr) & • Customer.Credit => #Adequate & • Order.Position_Nr > 0 & • Order.Position.Art_Nr є Set(Article.Art_Nr) & • Order.Position.Amount < Article.Amount & • (Article.Amount – Order.Position.Amount) < Minimum_Amount & Art_Nr -> Supplier.Price = min(Supplier.Price) • Order in which Order.Position.Art_Nr є Set(Article.Art_Nr) & • Order.Position.Amount < Article.Amount & • (Article.Amount- Order.Position.Amount) < Minimum_Amount & • Art_Nr -> Supplier.Price > min(Supplier.Price)

  16. SYST TEXT-15 Test Case Table TEXT-14

  17. SYST TEXT-16 Additional Functional Test Cases With Boundary Analysis • Order.Position_Nr = 0, 1, 10, 11 • Order.Position.Amount <, =, > Article.Amount • Art_Nr -> Supplier.Price <, =, > min(Supplier.Price) • Nr_Billing_Positions <, =, > max(Bill.Position_Nr)

  18. SYST TEXT-17 Non-Functional Requirements The order entry system must be able to handle at least 1000 customer web pages at one time. A customer order must be processed within 2 seconds. The article database may contain up to 10.000 articles. The system should be able to produce as many as 25.000  bills in one billing run. A billing run should not take more than 2  hours. If the system crashes it should be back up and in operation within 15 minutes. Database backups should take place every 4 hours. Customers should be checked both by number and by password. Passwords should be rejected after 3 tries, customer number should be rejected after 2 tries.

  19. SYST TEXT-18 Non-Functional Test Cases • 999 customer orders at one time • >1000 customer orders at one time • response time per order < 2 sec. • response time per order >2 sec. • 9.999 article records • > 10.000 article records • 24.999 bills in one billing • >25.000 bills in one billing • run time of billing < 2 hours • run time of billing >2 hours • If system crash, recovery < 15 minutes • If > 4 hours, database secured • Submit 3 passwords where 3rd password is correct • Submit 3 passwords where all 3 are incorrect • Submit 2 customer number where 2nd number is correct • Submit 2 customer number where both are incorrect 

  20. SYST TEXT-19 Properties of a Test Case • A Test Case: • serves a purpose • refers to a Testobject • has a precondition state • has a postcondition state • has a set of required input parameters • has a set of expected results • has a unique identifier • has a given environment • tests a use case • has a status • has a date of execution

  21. SYST TEXT-20 Test Case Description (1) Test Case – ID: IC- Order.4 Test Case – Purpose: to test article not on stock Test Object: Customer – Order Precondition: Order.Position.Art.Nr. ! € set (Article.Art.Nr) Postcondition: Response = „Article not available” Article.Amounts = Last.Amounts Inputs: Order.Cust.Nr = 200100 Customer.Credit = ’A’ Order.Position.Nr = 2 Order.Position.Art.Nr.= 9999 Results: Text-Msg = „ Article not available” Environment: MS- Internet Windows – XP Usecase – tested: Customer.order.processing Status: tested Date: 25. 8. 2005.

  22. SYST TEXT-21 Test Case Description (2) TestCase ID: IC-Order-7 Test Case – Purpose: to test a fulfilled order Test-Object: Customer – Order Precondition: Ordered Article is on stock. Article. Amount is > Order.Position.Amount (Article. Amount - Order. Position.Amount ) > minimum – Amount Postcondition: Article.Amount = a Pre.Article.Amount – Order.Position.Amount No supply order Inputs: Order.Cust-Nr = 200100 Customer.Credit = ’A’ Order.Position-Nr = 2 Order.Position.Art – Nr = 4711 Order.Position.Amount = 3 Article.Amount = 10 Minimum – Amount = 7 Results: Text-Msg = „Article order fulfilled” Environment: MS – Internet, Windows – XP Usecase tested: Customer.Order.Processing Status: tested Date: 29. 8. 2005.

  23. SYST TEXT-22 Test Database Master Table Type Number Pos Source Use_Case Test_Object Test Case Description Func 101504 1 Req Open_Account Account Test the opening of an account Tech 101604 1 Req Deposit Account Test a deposit to an account Regr 101704 1 Data Withdrawal Account Test a withdrawal from an account

  24. SYST TEXT-23 From Requirements via Test Cases to Test Scripts Tester enhances & refines Test Cases Text Analysis Test Cases Repository Loader Test Case DB Text Analyzer generates Test Cases Test Test Scripts Repository Unloader Test Script Generator generates Test Scripts for Test Automation Tester executes Test Cases

  25. SYST TEXT-24 Generated Test Script DLG-AUFTR/HOR_Öffnen { { Filename = "\GEOS_EU.200\A_ORDER\DLG\GAOAUFTR.93C"; Funktionsbeschreibung = "H1"; Aktion = "OPEN"; Modul = "GAOAUFTR"; }; Edit EB_EF_ENTRYFIELD { Controlbeschreibung = ""; Aktion = "EING"; MandantSpez = "nein"; Eingabe = "61230551302"; MK = "nein"; Inaktiv = "nein"; ReadOnly = "nein"; Domainentest = ""; Domain = ""; Default = ""; Mussfeld = ""; Parameter = ""; }; ComboBox EB_KB_KEYBOX { Controlbeschreibung = ""; Aktion = "AUSW"; MandantSpez = "nein"; Eingabe = "Derivat"; MK = "nein"; Inaktiv = "nein"; ReadOnly = "nein"; Domainentest = ""; Domain = ""; Default = ""; SVZAnzahl = "0"; Mussfeld = ""; Parameter = ""; }; Edit EB_EF_ENTRYFIELD4 { Controlbeschreibung = ""; Aktion = "EING"; MandantSpez = "nein"; Eingabe = "CODAX5800MÄR02"; MK = "nein"; Inaktiv = "nein"; ReadOnly = "nein"; Domainentest = ""; Domain = ""; Default = ""; Mussfeld = ""; Parameter = ""; }; Funktionenmenü ~Kaufen... { Controlbeschreibung = ""; Aktion = "KLCK"; MandantSpez = "nein"; Eingabe = ""; MK = "nein"; Inaktiv = "nein"; ReadOnly = "nein"; Domainentest = ""; Domain = ""; Default = ""; Mussfeld = ""; Parameter = ""; }; };

  26. SYST REQT-22 Inputs to a Text Analyzer Object List Filter Text Document • Parameters • Files • Names Text Processor Pre Processor Object Scanner Text Parser

  27. SYST REQT-23 Function of a Text Analyzer TextAnal Text Analyzer Scan Objects Parse Text Create Entity Tables Generate Outputs Text Criteria Object Model Test Cases Rule Violations Metrics Repository Entries Sections Sentences Words Section Tab Object Tab Action Tab State Tab Condition Tab Object List

  28. SYST REQT-24 Outputs from a Text Analyzer Object List Text Pre Processor Text Processor TxtAnal TxtScan Object Model Test Cases Rule Violations Spec Metrics Repository Entries • Objects • Use Cases • - Actions • - States • - Rules Text Excel XML Format Rules Rupp Rules Size Quantity Complexity • Sections • Use Cases • - Objects • - Actions • - States • - Rules

More Related