PDL-based requirements definition
l Requirements may be defined operationally using a language like a programming language but with more flexibility of expression l Most appropriate in two situations • Where an operation is specified as a sequence of actions and the order is important • When hardware and software interfaces have to be specified l Disadvantages are • The PDL may not be sufficiently expressive to define domain concepts • The specification will be taken as a design rather than a specification
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 43
Part of an ATM specification
class ATM { // declarations here public static void main (String args[]) throws InvalidCard { try { thisCard.read () ; // may throw InvalidCard exception pin = KeyPad.readPin () ; attempts = 1 ; while ( !thisCard.pin.equals (pin) & attempts < 4 ) { pin = KeyPad.readPin () ; attempts = attempts + 1 ; } if (!thisCard.pin.equals (pin)) throw new InvalidCard ("Bad PIN"); thisBalance = thisCard.getBalance () ; do { Screen.prompt (" Please select a service ") ; service = Screen.touchKey () ; switch (service) { case Services.withdrawalWithReceipt: receiptRequired = tru
PDL-based requirements definition
Posted on at