Title: What are Formal Methods
1What are Formal Methods?
- SE 420, Formal Methods
- Mark Ardis, RIT
2What are formal methods? (1/2)
- Formal methods are methods that use formal
language. - Formal methods use formal logic.
3What are formal methods? (2/2)
- Formal methods use formal specification
languages. That is, they use languages that have
a mathematically-defined static semantics. - Formal methods employ analysis that is
mathematically sound.
4When are formal methods most useful?
- When you have to get it right.
- When you cannot test it adequately, and you have
to get it right. - Examples
- safety-critical applications
- aviation
- medical equipment
- economically-critical applications
- Stock Exchange
- ATMs
5Why did Jonathan Jacky use formal methods?
- "I learned Z ... when I got tired of programming
by trial and error." - "I write large programs for a serious purpose."
- "We needed a complete and unambiguous description
of what our system would do."
6Can you compile Z specifications?
- No, that would not make sense.
- a Z specification is a design, not an
implementation - it describes what must be true, not how to do it
- But, you can
- check them for type errors with tools like ZTC
- review them (just like code inspection)
- prove assertions about them formally
- refine them into code by hand (just like refining
a UML design into code)
7Cartoon of the Day
86 Fallacies about Software
- Software is too complicated to get completely
right. - The only way to know whether software works is to
test it. - Users don't know what they want---only trial and
error will lead to the right solution. - Everything has bugs in it, so there is no point
in making anything better. - It costs too much to make highly-reliable
software. - Computing is still too immature to be reliable.
97 Myths About Formal Methods
- Hall work for Praxis Systems, a company that uses
formal methods in their work.
10Myth 1 Formal methods can guarantee that
software is perfect.
11Myth 2 Formal methods work by proving that
programs are correct.
12Myth 3 Only highly critical systems benefit from
their use.
13Myth 4 They involve complex mathematics.
14Myth 5 They increase the cost of development.
15Myth 6 They are incomprehensible to clients.
16Myth 7 Nobody uses them for real projects.