Larman’s approach | MODEWIS | |
Operation Contract | Postconditions | Controller Operations |
1―makeNewSale | 11―A Sale instance s was created 12―s was associated with a Register 13―Attributes of s were initialized | setNewSale(newSale, loggedRegister) |
2―enterItem | 21―A SalesLineItem instance sli was created 22―sli was associated with the current sale 23―sli.quantity became quantity 24―sli was associated with a ProductDescription based on itemID match | populateItemsTable(id, newItem) setNewItem(newItem) addToItemsTable(newItem) updateNewSale(newItem, newSale) |
3―endSale | 31―Sale.isComplete became true | setIsComplete(newSale, “true”) updateSale(newSale, isComplete, newPayment, items, subtotal, tax, balance) |
4―makePayment | 41―A Payment instance p was created 42―p.amountTendered became amount 43―p was associated with the current Sale 44―The current Sale was associated with the Store | handlePayment(newSale, items) |