Book contents
- Frontmatter
- Contents
- Preface
- I Why Z?
- 1 Formal methods
- 2 Why Use Formal Methods?
- 3 Formal methods and project management
- Further reading
- II Introducing Z
- III Elements of Z
- IV Studies in Z
- V Programming with Z
- Further reading
- A Glossary of Z notation
- B Omitted features
- C Operator precedence
- D The Z mathematical tool-kit
- E Selected Laws
- F Solutions to selected exercises
- G Other formal notations
- Bibliography
- Index
2 - Why Use Formal Methods?
Published online by Cambridge University Press: 06 July 2010
- Frontmatter
- Contents
- Preface
- I Why Z?
- 1 Formal methods
- 2 Why Use Formal Methods?
- 3 Formal methods and project management
- Further reading
- II Introducing Z
- III Elements of Z
- IV Studies in Z
- V Programming with Z
- Further reading
- A Glossary of Z notation
- B Omitted features
- C Operator precedence
- D The Z mathematical tool-kit
- E Selected Laws
- F Solutions to selected exercises
- G Other formal notations
- Bibliography
- Index
Summary
Why study formal methods? This chapter describes the predicament that formal methods were invented to solve and presents a vision of what programming should be.
Software frequently disappoints us. As users, we find that many programs are a poor match to our real needs and frustrate us with unrepaired defects. As programmers, our disappointment is especially keen. We expect to find the joy of creation in our work and the satisfaction of providing something useful. But all too often our expectations are dashed, our joy is spoiled, and our job becomes a dispiriting slog, churning out shapeless code and patching up bugs.
What's wrong? Is there something inherent in the nature of software that makes our troubles as inevitable as bad weather?
I argue that creating software is not intrinsically more difficult than any other kind of engineering. Many of our difficulties result from avoidable mistakes and poor programming practices.
A central problem is that people feel it is acceptable to create software without fully understanding what they are doing — they believe they can produce software and then understand it later by running tests and observing users' experience. It is this attitude, rather than any inherent difficulty in the task, that results in so many software problems.
This error can be made at any stage. Designers specify products when they don't fully understand customers' real needs. Programmers write code when they don't fully understand what it will do, and so on.
- Type
- Chapter
- Information
- The Way of ZPractical Programming with Formal Methods, pp. 14 - 20Publisher: Cambridge University PressPrint publication year: 1996