Requirement Engineering Exercise The POS System Solution

Transcription

Requirement engineering Exercise – the POS SystemsolutionProblem DescriptionA POS (Point-Of-Sale) system is a computer system typically used to manage the sales in retail stores. Itincludes hardware components such as a computer, a bar code scanner, a printer and also software tomanage the operation of the store.The most basic function of a POS system is to handle sales. When a customer arrives at a POS counterwith goods to purchase, the cashier will start a new sale transaction. When the barcode of a good is readby the POS system, it will retrieve the name and price of this good from the backend catalog system andinteract with inventory system to deduce the stock amount of this good. When the sale transaction isover, the customer can pay in cash, credit card or even check. After the payment is successful, a receiptwill be printed. Note that for promotion, the store frequently issue gift coupons. The customer can usethe coupons for a better price when purchasing goods.Another function of a POS system is to handle returns A user must log in to use the POS. The users of a POS system are the employees of the store includingcashiers and the administrator. The administrator can access the system management functions of thePOS system including user management and security configuration that cashiers can’t do.1. Context diagrams and interfaces.1-a Define the context diagram of the ystemCataloguesystemgood soldCredit cardsystemBar codereaderPrinter

Context diagram as UML class diagram

1-b Describe the interfaces of the application (to other systems/devices)PhysicalPrinterUSB 2.0Credit card systemInternet connectionCatalogue systemProceduralDataFormat of receiptURLwithweb Format of creditservice (SOAP – http card data sent, error xml), and SSLdescriptionsRPCbarcode : StringretrieveProduct(Stringbarcode)Inventory systemRPCdeduceAmount(Stringbarcode, int amount)1-c Describe the interfaces of the application (to users)Screenshot loginResult: boolean

Screenshot salesPaper receipt

1-d System designSystem design as free skecthThe POSsystemprinterBarcodereaderComputer swCredit cardreaderSystem design as UML class diagramPos System F1 Handle sales() F2 Handle Coupons() F3 Manage Users()BarCode ReaderComputerSoftwarePrinterCreditCardReader

2. User requirements.2-a Define the user requirements, notably using a table with functional and non functionalrequirements.Requirement IDDescriptionF1Handle salesF1.1Retrieve name and price of goodF1.2F1.2.1Handle paymentHandle payment cashF1.2.2Handle payment checkF1.2.3Handle payment credit cardF1.3Print receiptF1.4Read bar code of goodF1.5Deduce stock amount of goodF1.6Compute total amountF2Handle couponsF2.1Issue couponF2.2Make discount to coupon ownerF3Manage UsersF3.1Handle loginF3.2Handle logoutF3.3Define user, define user rightsNeeds more analysisF4Handle returnsNeeds more analysisNFEach function less than ½ secSecure payments (F1.2 to F1.2.3)Warranty access to functions only to authorized users f3

2-b Define the user requirements. As an alternative to the technique above described eachrequirement with the following form (from 03 requirements slides)NameF1.1 retrieve name and price of goodDescriptionInputBarcodeOutputName and price of productActionAccess backend catalogue system and given barcode find andretrieve product descriptionPreconditionValid barcode (consistent with standard correspondingproduct exists)PostconditionPrice and name of product availableNameDescriptionInputOutputActionPre conditionPost conditionF1.2.1 Handle payment cashNameF1.5 deduce stock amountAmount to be paid, cash receivedChange to be givenIf result ok, Add amount to be paid to total amount of cashCash received amount to be paidAmount of cash (after payment) amount of cash (beforepayment) amount to be paidDescriptionInputBarcodeOutputStock amount after this saleActionDeduce one from stock amount of productPreconditionValid code, at least one product in stockPostconditionProduct.stockAmount after Product.stockAmount before 1NameDescriptionInputOutputActionF2 – Handle couponCoupon (id of coupon, id of promotion, id of product)Discounted price for productRead bar code on coupon , find id of coupon, retrieve name ofpromotion and id of product, verify that promotion is stillvalid, verify that product is available, retrieve discount rate

2-c Define scenarios of use with the following template (from heating control system)Scenario name:Sale n productGeneral descriptionS0Use case: F1 Handle salesSale N products, payment cashStepDescriptionRequirement ID1Start sales transactionF12Read bar codeF1.13Retrieve name and price given barcodeF1.4Repeat 2 and 3 for all products4Compute totalF1.65Manage payment cashF1.2.26Deduce stock amount of productF1.57Print receiptF1.38Close transactionF1.4Scenario name:S1General descriptionStepDescriptionRequirement ID1Start sales transactionF12Read bar codeF1.13Retrieve name and price given barcodeF1.44Compute totalF1.65Manage payment cashF1.2.26Deduce stock amount of productF1.57Print receiptF1.38Close transactionF1.4Use case: F1 Handle salesSale 1 product

Scenario name:S2Step123General descriptionUse case: F1 Handle salesHandle sale , no credit, abort saleDescriptionStart saleRead bar codeRetrieve name and price given barcodeRequirement IDF1F1.1F1.4457Compute totalManage payment credit cardNo credit, abort saleF1.6F1.2.3F4Scenario nameGeneral descriptionUse case: F1 Handle salesS3: Sale of 3 goods, payment cashDescriptionStart new sale transactionRead bar code of goodRetrieve name and price of goodRead bar code of goodRetrieve name and price of goodRead bar code of goodRetrieve name and price of goodCompute total amount of saleHandle payment cashPrint receiptDeduce stock amount of goodS3Step012345678910Scenario nameS4Step012345678General descriptionUse case: F1 Handle salesS4: Sale of 2 goods, payment credit cardDescriptionStart new sale transactionRead bar code of goodRetrieve name and price of goodRead bar code of goodRetrieve name and price of goodCompute total amount of saleHandle payment credit cardPrint receiptDeduce stock amount of goodRequirement IDF1.7F1.4F1.1F111F1.6F1.2.1F1.3F1.5Requirement IDF1.7F1.6F1.2.3F1.3F1.5

Scenario nameS5Step012345678General descriptionUse case: F1 Handle salesS5: Sale of one good, bar code unreadableDescriptionStart new sale transactionRead bar code of goodBar code not readableInput bar code manuallyRetrieve name and price of goodCompute total amount of saleHandle payment credit cardPrint receiptDeduce stock amount of goodRequirement IDF1.7F1.x (to be added)F1.6F1.2.3F1.3F1.5

2-d Define the use case diagramsSystemloginprint receipt include logout system catalog systemprocess saleEmployee extend include system inventory system include process gift coupon saleCashier include include handle returnshandle cash payment include handle credit payment include manager userAdministratorUSE CASEPrimary ActorPreconditionsSuccess EndConditionBasic FlowEXTENSIONShandle check paymentmanage securityProcess SaleCashierCashier is identified and authenticatedSale is saved. Receipt is printed. Stock data updated. Payment authorizationapprovals are recorded.Step1234ActionCustomer arrives at POS checkout with goods to purchase.Cashier starts a new sale.Cashier enters item identifier.System retrieve item information from the catalog system and,records sale line item and presents item description, price, andrunning total. Cashier repeats steps 3-4 until indicates done.5678System calculates and presents total price.Cashier tells Customer the total, and asks for payment.Customer pays and System handles payment.System records completed sale and sends sale information to theexternal Inventory system for stock update.System presents receipt.Customer leaves with receipt and goods.910Step*Branching ActionAt any time, System fails:To support recovery and correct accounting, ensure alltransaction sensitive state and events can be recovered from anystep of the scenario.1. Cashier restarts System, logs in, and requests recovery ofprior state.2. System reconstructs prior state.2a. System detects anomalies preventing recovery:1. System signals error to the Cashier, recordsthe error, and enters a clean state.

3a3b3-6a3-6b3-6c4a6a2. Cashier starts a new sale.Invalid identifier:1. System signals error and rejects entry.There are multiple of same item:1. Cashier can enter item category identifier and the quantity.Customer asks Cashier to remove an item from the purchase:1. Cashier enters item identifier for removal from sale.2. System displays updated running total.Customer tells Cashier to cancel sale:1. Cashier cancels sale on System.Cashier suspends the sale:1. System records sale so that it is available for retrieval on anyPOS terminal.The item’s price is not the customer wanted (e.g., Customercomplained that the item is offered at a lower price):1. Cashier enters override price.2. System presents new price.Customer says they intended to pay by cash but don’t haveenough cash:1a. Customer uses an alternate payment method.1b. Customer tells Cashier to cancel sale. Cashier cancels saleon System.7a7b7cPaying by cash: (UC Handle Cash Payment)Paying by credit: (UC Handle Credit Payment)Paying by check: (UC Handle Check Payment)1Touch screen Ul on a large flat panel monitor. Text must bevisible from 1 meter.Credit authorization response within 30 seconds 90% of thetime.Somehow, we want robust recovery when access to remoteservices such the invent tory system is failing.Language internationalization on the text displayed.Non-FunctionalRequirements234USE CASEEXTENSIONSProcess Gift Coupon Sale (extends UC Process Sale)Step Branching Action7aCustomer presents coupons:1. Before handling payment, Cashier records eachcoupon and System reduces price as appropriate.System records the used coupons for accountingreasons.1a. Coupon entered is not for any purchased item:1. System signals error to Cashier.A simpler and more efficient variant:

SystemCashierF1 Handle salesInventory System include include F1.1 Retrieve name and priceGoodF1.2 Handle paymentF2 Manage CouponsF3 Manage UsersAdministratorCatalogue SystemCreditCard System

2-e Define the sequence diagrams for some specific scenariosSequence diagram for S0

Sequence diagram for S3, no internals of POS System: Cashier: Pos SystemCatalogue SystemInventory System1 : start sale transaction()2 : read bar code()3 : retrieve name and price()4 : read bar code()5 : retrieve name and price()6 : read bar code()7 : retrieve name and price()8 : last good()9 : compute total amount()10 : payment by cash()11 : handle payment by cash()12 : print receipt()13 : deduce stock amount()

Sequence diagram for S1, with internals of POS System as described by System design diagram: Cashier: Pos System1 : start sales transaction(): BarCode Reader : Catalogue System2 : read bar code()3 : retrieve name and price of good()4 : read bar code()5 : retrieve name and price of good()6 : read bar code()7 : retrieve name and price of good()8 : last good()9 : compute total amount()10 : payment by cash()11 : handle payment by cash()12 : print receipt()13 : deduce stock amount()2f - Statechart of POS System classidleread bar code/retrieve name and pricestart sales transactionadding goodslast good/compute total amounthandle paymentpayment[payment is ok]/deduce stock amount, print receipt: Printer: Inventory System

A POS (Point-Of-Sale) system is a computer system typically used to manage the sales in retail stores. It includes hardware components such as a computer, a bar code scanner, a printer and also software to . 1 Touch screen Ul on a large flat panel monitor. Text must be visible from 1 meter. 2