Learning to live with errors

Tomas Petricek

fsharpWorks & Alan Turing Institute
tomas@tomasp.net | @tomaspetricek | tomasp.net

Trivial problem or industry crisis?

If trials of three or four simple cases have been made, and are found to agree with the results given by the engine, it is scarcely possible that there can be any error.

Charles Babbage, On the mathematical
powers of the calculating engine (1837)

The ENIAC women would simply set up the machine to perform these predetermined plans; that this work would turn out to be difficult and require radically innovative thinking was completely unanticipated.

Nathan Ensmenger (2010)
The Computer Boys Take Over

By the end of [1960s] many were talking of a crisis (...).
For the next several decades, [managers, academics and governments] would release warnings about the desperate state of the software industry with ritualistic regularity.

Nathan Ensmenger (2010)
The Computer Boys Take Over

How can we explain the [seemingly perpetual] crisis
in what is considered one of the most successful and
profitable industries of all time?

Nathan Ensmenger (2010)
The Computer Boys Take Over

Living with errors

Errors as part of the process

COBOL and data processing crisis

Eliminate the need for skilled programmers

By late 1960s, the emerging software
crisis became defined as managerial.

NATO Conference on Software Engineering

The black art of programming has to make way for the science of software engineering.

Software engineering completes the turn toward managerial solutions to the software crisis.

Software craftsmanship

NATO conference (1968) started transition from computer programming as a craft to an engineering discipline

Software craftsmanship (2001) emphasizes skills of developers "individuals and interactions over processes and tools"

Test-driven development

In TDD we drive development with automated tests. We
1) write new code only if an automated test has failed
2) eliminate duplication.

Kent Beck, Test-Driven
Development by Example (2003)

Test-driven development

Error as part of the development process

  1. Introduce controlled isolated error
  2. Eliminate error by writing more code

Test-driven development

Error as a medium for information

Tests become the specification
Tests as a honest documentation

Errors as a contradiction

Meanwhile at the universities...

[ACM members] have read non-ACM articles on data processing and found them lacking. They suffer from one basic fault: They fail to report fundamental research in the data processing field.

Nathan Ensmenger (2010)
The Computer Boys Take Over

Algol language

"Remarkable computer science achievement"

  • "Object of beauty" and never widely adopted
  • Defines academic programming agenda

Algol research programme (1960s)

Formal language specification

One of the goals (..) was to utilize the resources of logic to increase the confidence (..) in the correctness of a program (..) "[Instead] of debugging a program, one should prove that it
meets its specifications (...)".

Mark Priestley (2011)
Science of Operations

Algol research programme (2010s)

Dependently typed programming

[T]oday most people who write software (...) assume that the costs of formal program verification outweigh the benefits. The purpose of this book is to convince you that the technology of program verification is mature enough today (...).

Adam Chlipala, Certified Programming
with Dependent Types (2013)

Error as a contradiction

Dream for the last 50 years

Logical goal for academic computer science
Sometimes useful, sometimes not?

Errors as the unavoidable

Erlang language

Distributed long-running systems

Created at Ericsson for telecommunications
Errors will happen because of scale

Miscomputations in Erlang

Exceptions occur when the run-time does not know what to do
Errors occur when the programmer doesn’t know what to do

Errors expected. Specification does not cover all cases.

Joe Armstrong (2003)
Programming reliable systems

Handling errors in Erlang

What kind of code must the programmer write when they find an error? (..) let some other process fix the error, but what does this mean for their code? The answer is let it crash.

Joe Armstrong (2003),
Programming reliable systems

Errors as the unavoidable

Erlang error is the opposite of test error

Errors are the lack of specification
They are expected - are they still errors?

Errors as an inspiration

Programmers and musicians

The notion [that programming was black art] was reinforced by personality profiles that suggested that programmers, had a uniquely creative ability like chess masters or musicians.

Nathan Ensmenger (2010)
The Computer Boys Take Over

Smalltalk ecosystem (1970s)

[Smalltalk approach] to the design of languages [is] quite different from what was familiar in the Algol [programme].

Programming was not thought of as the task of constructing a linguistic entity, but rather as a process of working interactively with the semantic representation of the program.

Mark Priestley (2011)
Science of Operations

Live coding

Environments for music

In musical genres that are not notated so closely (...), there are no wrong notes – only notes that are more or less appropriate to the performance.

Alan Blackwell and Nick Collins (2005)
The Programming Language as a Musical Instrument

Live coding

Errors in live coding

[Live coders] may well prefer to accept the results of an imperfect execution. [They] might perhaps compensate for an unexpected result by manual intervention, or even accept the result as a serendipitous alternative to the original note.

Alan Blackwell and Nick Collins (2005),
The Programming Language as a Musical Instrument

Errors as an inspiration

Enable quick human intervention

Make errors easier to hear or see
Not just live coded art performances

What are errors and how to deal with them?

Socio-technological entities

Live coder answer

It took 45 minutes to shut it down!

Erlang answer

New message, old server should crash!

Logician answer

Critical systems must be proved correct

Craftsman answer

What are the properties to test?

Prove or test properties

Identifying properties is the hard problem

Fix the system by hand

Needs to be designed for manual intervention!


Crisis narrative

The continued four-decades-long crisis in one of the largest and fastest-growing sectors of the US economy suggests an interesting dichotomy (..)

Nathan Ensmenger (2010)
The Computer Boys Take Over


Escaping the crisis narrative

  • Prove basic assumptions, live code the rest
  • Is it easier to write code or property?
  • Live coding the environment for faster response

Different ways of thinking

Use the same word, but in a different context!

Most economical description

Program code or program properties

Tell me what you think!
tomas@tomasp.net | @tomaspetricek | tomasp.net

N. Ensmenger (2010), The Computer Boys Take Over
M. Priestley (2011), A Science of Operations