logoalt Hacker News

rramadass • today at 5:13 PM • 0 replies • view on HN

My previous comments already pointed to Meyer's "Applying Design by Contract" paper which shows how to integrate exception handling with DbC. Here it is directly - https://news.ycombinator.com/item?id=48358691

Basically, you have to keep your module internals "pure", distinguish between domain exceptions (i.e. checked) vs. environmental runtime exceptions (i.e. unchecked) and push all "impure" operations to the boundary of the module.

Also see the following paper which shows how to formally model hardware faults;

Faulty Logic: Reasoning about Fault Tolerant Programs - http://www.cs.princeton.edu/~dpw/papers/faultylogic_esop2010...