Correctness example

Consider the following requirement:

  • It is required to write a program that inputs a sequence of integers and outputs the sorted version of this sequence.

This requirement is ambiguous. It is not clear from this requirement whether the input sequence is to sorted in ascending or descending order. The behaviour of sort program, written to satisfy this requirement, will depend on the decision taken by the programmer while writing sort.


  • <bib>mathur:2008, 11</bib>