Was Ada Lovelace's first ever recognized program, an algorithm for producing Bernoulli numbers on Babbage's Analytical Engine, ever practically tested? Were there any bugs?

by LukeInTheSkyWith
Ractor85

Maybe a bit of a stretch, but it might be worth it to try /r/AskComputerScience if you don't find what you're looking for here.

king_in_the_north

So, the program has been practically tested to the extent possible, and there are definitely not any bugs in Lovelace's work. However, there are some assumptions in your question that aren't really true.

First off, Lovelace's "program" is actually an algorithm expressed in very precise, low-level pseudocode - it specifies very carefully what operations should be performed when on what variables, and what variables the respective results should be placed in. Anybody with a reasonable degree of familiarity with programming can translate it into most modern programming languages with no trouble, but it isn't actually in a form you could feed directly into the Analytical Engine, only a small portion of which was built during Lovelace's lifetime. Between Lovelace's pseudocode and actual execution on the Analytical Engine, there would be an additional step of encoding the program onto punch cards, during which a bug could be introduced.

Second, the Analytical Engine's programming interface was never worked out in enough detail to tell exactly what that encoding would look like. It would definitely have used two strings of punch cards a la the Jacquard Loom, one for specifying what variables to use and one specifying the operations to perform. Babbage never carried out the actual specification of what patterns on these punch cards would refer to which variables and operations, and even if a model is built according to as much of Babbage's plans as were fully developed, it would be missing the card-reading portions of the user interface. I suspect this would not be very difficult to design, but given that Babbage never had the funding to build his machine, he never felt the need to work it out in detail.

Third, Babbage wrote some simpler programs several years before Lovelace's program, but they aren't popularly known. For one thing, Babbage published very little work on the Analytical Engine himself, although he did give a lecture at Turin in 1840. Luigi Menabrea took notes on Babbage's lecture and published them in French, which Lovelace then translated into English. These notes include several small programs (presented in Lovelace's translation in the same style as her algorithm for calculating Bernoulli numbers), and Babbage's personal papers include more. The bulk of Lovelace's intellectual contribution is in her "Translator's Notes", which include, among other things, her famous program. As a result, when the primarily English-speaking computing pioneers rediscovered the Analytical Engine in the late 40s, they had access to Babbage's rather simple early programs and Lovelace's more impressive program in the same book and at the same time. Further, the later search for a female pioneer in computing led to a mythologizing of Lovelace as the "first programmer".

So, in summary: Lovelace's famous first computer program wasn't quite a program, wasn't first, and even if it had been the first and been a program, we don't have a full Analytical Engine design to compare it to or test it on. On the other hand, it is bug-free.