How to write complex software

A general method