September 2016
Intermediate to advanced
336 pages
9h 33m
English
Structuring code so that it’s testable, whereby increasing its probability of being tested isn’t the only way to aim for correct software. Another approach would be to go down the road of formal methods, that is, mathematical proofs. In this chapter, we examine yet another alternative, which is modeling the software as transactions between a client and supplier, who agree on a contract that forces them to uphold certain obligations to each other (see Figure 5.1). In exchange, both get some benefits. If the contract is violated, the application stops. For such an approach to be effective, the contract must be constantly checked at runtime, as opposed to running a suite of tests now and then or proving a fact ...
Read now
Unlock full access