Buffer data structures implemented with tests