bottom next

Incremental Software Construction

Tutorial

consists of two parts and explores the fundamentals of the incremental software construction process using the Shunting Yard algorithm as a reference.

In the first part of the tutorial we will use the Shunting Yard algorithm to create a fully functional Arithmetic Expressions Calculator, AEC, that accepts numbers is its input.

In the second part of the tutorial we will adapt the Shunting Yard algorithm to accept human-readable strings as its input by developing a fully functional Boolean Expressions Evaluator For Strings, BEEFS.

Both Shunting Yard algorithm implementations, in AEC and in BEEFS, are non-recursive and both use a linear container as their processing medium.

Work through AEC first.


Principles

Some of the fundamental principles of incremental software construction process are:

  • Wholesome vision
  • Deductive workflow
  • Simultaneous comparison


Wholesome Vision

is an ability to capture in one's mind the whole problem in its entirety, at once. Ideally the understanding of the essence of a problem at hand should be acquired before the keyboard is touched.

Wholesome vision is applicable recursively to a collection of projects, a single project, which is a collection of applications and libraries, a single application or a single library, either of which is a collection of native and custom data types, functions and other language-specific constructs, a single custom data type, a single function, a single statement, a single expression and so on.


Deductive Workflow

mimics the deductive reasoning process discovered by the ancient Greeks circa \(500-300\) BC, vividly demonstrated by Euclid in his "Elements", and proceeds as follows:

  • from outside in
  • from whole to part
  • from large to small
  • from generic to specific
  • from abstract to concrete

Capturing the above workflow algorithmically:

parts = container of all parts (including whole) sort parts by size in descending order - from largest (whole) to smallest for ( i = 0; i < parts count; i++ ) { implement parts[ i ]; }

we obtain some of its consequences:

- the scope of work is fixed ahead of time

- the scope and cost of mistakes should diminish with time

- the likelihood that the final result and the original idea coincide should increase with time


Simultaneous Comparison

is the process of juxtaposing of a part against the whole with the purpose of verifying that the former is chosen correctly and occupies the place that it should within the latter. Wholesome vision may come at the expense of temporary loss of narrow focus on minor details. The process of simultaneous comparison ensures that these details fall into place naturally.

\(\blacksquare\)

top next