On learning about TLA+, engineers
usually ask, “How do we know that the
executable code correctly implements
the verified design?” The answer is
we do not know. Despite this, formal
methods still help in multiple ways:
Get design right. Formal methods
help engineers get the design right,
which is a necessary first step toward
getting the code right. If the design is
broken, then the code is almost certainly broken, as mistakes during coding are extremely unlikely to compensate for mistakes in design. Worse,
engineers are likely to be deceived into
believing the code is “correct” because
it appears to correctly implement the
(broken) design. Engineers are unlikely to realize the design is incorrect
while focused on coding;
Gain better understanding. Formal
methods help engineers gain a better
understanding of the design. Improved
understanding can only increase the
chances they will get the code right;
and
Write better code. Formal methods
can help engineers write better “self-
diagnosing code” in the form of assertions. Independent evidence 10 and our
own experience suggest pervasive use
of assertions is a good way to reduce
errors in code. An assertion checks a
small, local part of an overall system
invariant. A good system invariant
captures the fundamental reason the
system works; the system will not do
anything wrong that could violate a
safety property as long as it continuously maintains the system invariant.
The challenge is to find a good system
invariant, one strong enough to en-
sure no safety properties are violated.
Formal methods help engineers find
strong invariants, so formal methods
can help improve assertions that help
improve the quality of code.
While we would like to verify that
executable code correctly implements the high-level specification or
even generate the code from the specification, we are not aware of any such
tools that can handle distributed systems as large and complex as those
being built at Amazon. We do routinely use conventional static analysis tools, but they are largely limited
to finding “local” issues in the code,
and are unable to verify compliance
with a high-level specification.
We have seen research on using the
TLC model checker to find “edge cases” in the design on which to test the
code, 21 an approach that seems promising. However, Tasiran et al. 21 covered
hardware design, and we have not yet
tried to apply the method to software.
On learning about TLA+, engineersusually ask, “How do we know that theexecutable code correctly implementsthe verified design?” The answer iswe do not know. Despite this, formalmethods still help in multiple ways:Get design right. Formal methodshelp engineers get the design right,which is a necessary first step towardgetting the code right. If the design isbroken, then the code is almost certainly broken, as mistakes during coding are extremely unlikely to compensate for mistakes in design. Worse,engineers are likely to be deceived intobelieving the code is “correct” becauseit appears to correctly implement the(broken) design. Engineers are unlikely to realize the design is incorrectwhile focused on coding;Gain better understanding. Formalmethods help engineers gain a betterunderstanding of the design. Improvedunderstanding can only increase thechances they will get the code right;andWrite better code. Formal methodscan help engineers write better “self-diagnosing code” in the form of assertions. Independent evidence 10 and ourown experience suggest pervasive useof assertions is a good way to reduceerrors in code. An assertion checks asmall, local part of an overall systeminvariant. A good system invariantcaptures the fundamental reason thesystem works; the system will not doanything wrong that could violate asafety property as long as it continuously maintains the system invariant.The challenge is to find a good systeminvariant, one strong enough to en-sure no safety properties are violated.Formal methods help engineers findstrong invariants, so formal methodscan help improve assertions that helpimprove the quality of code.While we would like to verify thatexecutable code correctly implements the high-level specification oreven generate the code from the specification, we are not aware of any suchtools that can handle distributed systems as large and complex as thosebeing built at Amazon. We do routinely use conventional static analysis tools, but they are largely limitedto finding “local” issues in the code,and are unable to verify compliancewith a high-level specification.We have seen research on using theTLC model checker to find “edge cases” in the design on which to test thecode, 21 an approach that seems promising. However, Tasiran et al. 21 coveredhardware design, and we have not yettried to apply the method to software.
การแปล กรุณารอสักครู่..
