Præsentation er lastning. Vent venligst

Præsentation er lastning. Vent venligst

Cash dispenser VDM++ modellering Test af udvidet cash dispenser Peter Clausen Raghid Kawash Brian Gram Møller.

Lignende præsentationer


Præsentationer af emnet: "Cash dispenser VDM++ modellering Test af udvidet cash dispenser Peter Clausen Raghid Kawash Brian Gram Møller."— Præsentationens transcript:

1 Cash dispenser VDM++ modellering Test af udvidet cash dispenser Peter Clausen Raghid Kawash Brian Gram Møller

2 Agenda ► Opfølgning fra sidst ► Valg af test miljø ► Test scenarier ► Gennemgang af udvalgte test cases ► Spørgsmål

3 Opfølgning fra sidst ► Før ► Efter dcl numOfTrans: nat := numOfTransactions, i: nat := 0, i: nat := 0, tmpTrans: seq of Transaction := []; tmpTrans: seq of Transaction := []; if len transactions < numOfTransactions then if len transactions < numOfTransactions then numOfTrans:= len transactions; numOfTrans:= len transactions; i := len transactions – numOfTrans + 1; i := len transactions – numOfTrans + 1; while i <= numOfTrans do while i <= numOfTrans do ( tmpTrans := tmpTrans ^ [transactions(i)]; tmpTrans := tmpTrans ^ [transactions(i)]; i := i + 1; i := i + 1; ); ); return tmpTrans; return tmpTrans; return [ transactions(t) | t in set inds transactions & t+numOfTransactions >= len transactions ];

4 Valg af test miljø ► VDMUnit framework

5 Test scenarier ► Deposit to account  Successful deposit into account ► Deposit to another account  Successful deposit into another account ► New withdrawal  Cash balanced at till ► Insert cash into till  Cash balanced at till ► Empty till cash amount  Withdrawal unavailable

6 Test scenarier ► Add 5 transactions and print last 10  5 transactions printed ► Empty printer, ink and paper  Printer not functional

7 Gennemgang af udvalgte test cases protected Test: () ==> () Test () == ( till.InsertCard(card1); AssertTrue(till.Validate(card1.GetCode()) = ); AssertTrue(till.insertBill(validBill500) = nil); AssertTrue(till.insertBill(validBill1000) = nil); AssertTrue(till.insertBill(invalidBill200) = invalidBill200); till.makeDeposit(); AssertTrue(till.GetBalance() = 6500); );

8 Gennemgang af udvalgte test cases protected Test: () ==> () Test () == (... clock.SetDate("11. maj 2006");... AssertTrue(till.tillCashAmount = 2000); till.InsertCard(card2); AssertTrue(till.Validate(card2.GetCode()) = ); AssertFalse(till.MakeWithdrawal(2000, true)); AssertTrue(till.insertBill(validBill1000) = nil); till.makeDeposit(); AssertTrue(till.MakeWithdrawal(2000, true)); AssertTrue(till.tillCashAmount = 1000); till.ReturnCard(); AssertFalse(till.canWithdraw()); );

9 Gennemgang af udvalgte test cases protected Test: () ==> () Test () == ( printer.addPaper(2); printer.addInk(10); till.InsertCard(card1); AssertTrue(till.Validate(card1.GetCode()) = ); AssertTrue(till.insertBill(validBill1000) = nil); till.makeDeposit(); AssertTrue(till.insertBill(validBill1000) = nil); till.makeDeposit(); AssertTrue(till.insertBill(validBill1000) = nil); till.makeDeposit(); AssertTrue(till.MakeWithdrawal(100, true)); AssertTrue(till.GetBalance() = 7800); AssertTrue(till.tillCashAmount = 12800); --Using 5 lines of ink and 1 paper AssertTrue(till.printLastStatements()); AssertFalse(printer.isOperational()); );

10 Opsummering ► Forbedringer fra sidst ► Afgjorde valg af test miljø ► Vist test scenarier ► Gennemgået udvalgte test cases

11 Spørgsmål ►...


Download ppt "Cash dispenser VDM++ modellering Test af udvidet cash dispenser Peter Clausen Raghid Kawash Brian Gram Møller."

Lignende præsentationer


Annoncer fra Google