Tiny Programming Examples with a Software Engineering Perspective
1 Tiny.Tiny Examples of Spec/Design
- ./Dutch-National-Flag Correct by Design example by Dijkstra.
- ./Quick-Sort Why is it hard to understand and then remember?
- ./SmallSet A simple implementation of a set of integers. Shows
pre/post and class invariants.
- ./Condense-Num-Ranges E.g., given 2 - 9 and 3 -12, condense to
2 - 12. Spec and design.
- ./Magic-Squares Construct n x n matrix of numbers so that columns,
rows and diagonals add up to the same number.
- ./Tabulate-Equations such as a collection from algebra. Spec and design.
- ./Telegram-Problem The problem of Peter Naur. Famous people wrote
buggy solutions!
- ./Worms wiggly worms, some vegetarian, others cannibals. Presented
as (i) a software "maintenance" problem, and (ii) as an example of
writing assertions.
- ./TicTacToe-JavaFX-UnRedo Presented as a software "maintenance"
problem. Is it bug free?
- ./Game-Of-Life Conway's GoL. Presented as a software "maintenance"
problem. TBD Incomplete.
- ./Columnize-Words Part of /bin/ls spec.
- ./Mark-Error-Pos A required method within a compiler. Position an
arrow, and next to it print error numbers.
Copyright © 2015 •
www.wright.edu/~pmateti • 2015-06-15