Test-driven implementation of a FIFO buffer