Formal methods: Just good engineering practice?
Formal methods in software engineering, highlighted by Marc Brooker from Amazon Web Services, optimize time and money by exploring designs effectively before implementation. They lead to faster development, reduced risk, and more optimal systems, proving valuable in well-understood requirements.
Read original articleFormal methods in software engineering are considered crucial for building efficient systems, especially in large-scale, distributed, and low-level applications. Marc Brooker, an engineer at Amazon Web Services, emphasizes the importance of formal methods in optimizing time and money in software development. By using tools like TLA+ and P, engineers can explore designs more effectively before implementation, leading to faster development, reduced risk, and more optimal systems. While formal methods may not be suitable for all software types, they prove valuable in systems with well-understood requirements. The debate between upfront design and agile methodologies often stems from different approaches to requirements gathering. Brooker suggests that formalizing requirements, although challenging for certain aspects like UI aesthetics, can prevent wasted time and conflicting directions. Overall, incorporating formal methods into the software engineering process is seen as a fundamental aspect of good engineering practice, enabling faster and more efficient software development.
Related
There's more to mathematics than rigour and proofs (2007)
The article explores mathematical education stages: pre-rigorous, rigorous, and post-rigorous. It stresses combining formalism with intuition for effective problem-solving, highlighting the balance between rigor and intuition in mathematics development.
Documenting Software Architectures
Documenting software architectures is crucial for guiding developers, facilitating communication, and capturing decisions effectively. The arc42 template and C4 model offer structured approaches to achieve this, balancing detail and clarity.
Exposition of Front End Build Systems
Frontend build systems are crucial in web development, involving transpilation, bundling, and minification steps. Tools like Babel and Webpack optimize code for performance and developer experience. Various bundlers like Webpack, Rollup, Parcel, esbuild, and Turbopack are compared for features and performance.
Software Engineering Practices (2022)
Gergely Orosz sparked a Twitter discussion on software engineering practices. Simon Willison elaborated on key practices in a blog post, emphasizing documentation, test data creation, database migrations, templates, code formatting, environment setup automation, and preview environments. Willison highlights the productivity and quality benefits of investing in these practices and recommends tools like Docker, Gitpod, and Codespaces for implementation.
No Matter What They Tell You, It's a People Problem (2008)
The article emphasizes the crucial role of people in software development, citing teamwork, communication, and problem-solving skills as key factors for project success. It highlights the importance of job satisfaction and team cohesion, underlining the significance of positive personal relationships within development teams.
Formal methods need to be like SPARK 2014, or DbC, actually part of the programming language, or being able to generate code in the target language, interop with its libraries ecosystem, and have good quality good with performance, that won't make people want to remove the generated code and rewrite it manually.
“It would be well if engineering were less generally thought of, and even defined, as the art of constructing. In a certain important sense it is rather the art of not constructing; or, to define it rudely but not inaptly, it is the art of doing that well with one dollar, which any bungler can do with two after a fashion.” Arthur Wellington
Where is the boundary between finance and engineering? And Engineering is also about making optimal tradeoffs in other dimensions (he mentions time, performance, scalability, sustainability, and efficiency).I consider bounded model checking to be "formal methods lite". It provides most of the benefits at a lower cost of entry than using a proof assistant or building constructive proofs. Really, there's little added overhead. Perhaps 30% to 40% more time to build out the function contracts and model checking. Given that this overhead more or less prevents errors that would likely be introduced without it, I think it's a reasonable investment.
TLA+ is certainly related, since it uses an SMT solver at its base. I see it as useful for designing algorithms and protocols. A tool like CBMC or Kani provides similar guarantees at the source code level. It's not perfect, as currently CProver does not have direct threading support, but with a reasonable application of method shadowing and function contracts, even things like threading can be anticipated. Using a bounded model checker effectively means changing the design of software to work best with it. This is little different than using concepts like TDD or continuous integration.
For instance, in electronic engineering, you don't use the most accurate model of a diode at all times. Sometimes it's just a one-way valve. Sometimes, it's just one-way valve with a 0.7V drop (if silicon).
In mass production, you will not get the accurate parts needed for the most formal model to be justifiable, and the cost of those parts would not be justified in most of the circuitry.
They made really, really good hardware, but it was extremely painful for us software schlubs.
That said, I don’t know if it’s really possible to do really big stuff, with a team, unless you have some degree of formality.
Best practices are usually a good place to start, and I would suggest that the degree of necessary formality, is inversely proportional to the experience of the team. If you have a lot of really experienced engineers, in a mature team that has been together a long time, the formality is still there, but doesn’t need to be written down.
I usually work alone, or as the sole technical person, in a diverse team. I’m really experienced, and don’t write much down.
But I’m also really, really formal. It just doesn’t look like it.
I am of the belief that we need to return to modifying live environments instead of sending code through a lengthy build pipeline. Instead of trying to make live environments secure and durable we got scared and now we have modern CI/CD.
Glenn Vanderburg - Real Software Engineering
Related
There's more to mathematics than rigour and proofs (2007)
The article explores mathematical education stages: pre-rigorous, rigorous, and post-rigorous. It stresses combining formalism with intuition for effective problem-solving, highlighting the balance between rigor and intuition in mathematics development.
Documenting Software Architectures
Documenting software architectures is crucial for guiding developers, facilitating communication, and capturing decisions effectively. The arc42 template and C4 model offer structured approaches to achieve this, balancing detail and clarity.
Exposition of Front End Build Systems
Frontend build systems are crucial in web development, involving transpilation, bundling, and minification steps. Tools like Babel and Webpack optimize code for performance and developer experience. Various bundlers like Webpack, Rollup, Parcel, esbuild, and Turbopack are compared for features and performance.
Software Engineering Practices (2022)
Gergely Orosz sparked a Twitter discussion on software engineering practices. Simon Willison elaborated on key practices in a blog post, emphasizing documentation, test data creation, database migrations, templates, code formatting, environment setup automation, and preview environments. Willison highlights the productivity and quality benefits of investing in these practices and recommends tools like Docker, Gitpod, and Codespaces for implementation.
No Matter What They Tell You, It's a People Problem (2008)
The article emphasizes the crucial role of people in software development, citing teamwork, communication, and problem-solving skills as key factors for project success. It highlights the importance of job satisfaction and team cohesion, underlining the significance of positive personal relationships within development teams.