Questions tagged [formal-methods]
The formal-methods tag has no usage guidance.
21
questions
2
votes
1
answer
109
views
How could I programmatically generate a chart of interservice messaging flows before runtime?
My team is currently developing an application using a microservice architecture with publish/subscribe interservice communication over a message bus. Certain types of HTTP requests and messages ...
-2
votes
2
answers
130
views
How do I ensure my product is correct the first time? [closed]
I am working on a product that will not be able to be updated once released. Furthermore, if the product malfunctions, the results may include death, serious bodily harm, or major financial setbacks. ...
-2
votes
3
answers
140
views
What you can prove when making native HTTP calls from browser
From here it was advised:
Formal verification needs to have a goal: what precisely do you want to prove?
This is a good question. I am very intrigued by the idea of doing formal proofs in web ...
3
votes
1
answer
152
views
How can the `log` function be used for formal verification
In JavaScript I want to create a log function:
function log(string) {
console.log(string)
}
Obviously this causes side effects; it prints to the screen. And I have no control over its ...
0
votes
1
answer
93
views
How to Automatically Tell What is Not Tested [duplicate]
I feel like I've heard the phrase "Automated Test Coverage" but not really sure what it means. I am wondering if there is a way to do some sort of program analysis that will tell you which parts of ...
1
vote
0
answers
46
views
Integrating Testing with Model Checking
So with Model Checking you have a specification and the model checker automatically goes through your program's states and checks if it matches the specification. What I don't understand is where ...
17
votes
3
answers
2k
views
What are the barriers that prevent widespread adoption of formal methods? [closed]
Formal methods can be used to specify, prove and generate code for an application. This is less prone to errors - thus mostly used in safety/critical programs.
Why don't we use it more often for ...
1
vote
4
answers
733
views
How to prove a function returns a value
Say I have the following 2 JavaScript functions for demonstration purposes:
function colorize(integer) {
if (integer === 1) return 'red'
if (integer === 2) return 'blue'
if (integer === 3) ...
-5
votes
1
answer
578
views
How to map an API into another one?
After some google search, I feel still in the mud.
I am wondering whether what is the best approach for writing wrappers mapping two similar APIs that offer similar semantics but perhaps in different ...
1
vote
2
answers
239
views
Can a purely declarative language cause runtime exceptions?
Let us consider a purely declarative language such as SQL, XQuery, or a logic language like Prolog, or a purely functional language without variable mutability.
Considering that the interpreter or ...
7
votes
2
answers
3k
views
Is "Unit testing" a form of formal method?
After some research, I understand that:
Formal method contribute to the reliability and robustness of a design. (ref : Wikipedia - Formal method)
Unit testing ensures us of the absence of errors ...
8
votes
2
answers
437
views
Is it common practice to transform requirement specifications into predicate logic for functional programming?
I've recently been assigned to work on a small project which is being implemented in Haskell. Coming from an OO/imperative background, I'm used to converting requirements/user-stories into use-cases ...
4
votes
2
answers
2k
views
How "Best" to capture State Transitions in a formal software requirements specification
Suppose you have a state transition diagram. What is the best way to "Formally" write requirement(s) that capture the state transitions depicted in the diagram. Over the years I have used two ...
1
vote
3
answers
500
views
Are functional languages a kind of program derivation?
Program derivation is defined as the derivation of a program from it's specifications. Usually this specification language is some form of propositional logic, but from what I understand, it need not ...
13
votes
5
answers
3k
views
Are there any formalized/mathematical theories of software testing?
Googling "software testing theory" only seems to give theories in the soft sense of the word; I have not been able to find anything that would classify as a theory in the mathematical, information ...
10
votes
3
answers
2k
views
What would help when refactoring a large method to ensure that I don't break anything?
I'm currently refactoring a part of a large codebase with no unit tests whatsoever. I tried to refactor code the brute way, i.e. by trying to guess what the code is doing and what changes wouldn't ...
1
vote
0
answers
94
views
Is there a formal enumeration of the ways that components can be coupled / depend on eachother?
Say you have
class A {
}
class B {
}
One type dependency is "method parameter":
class A {
}
class B {
public void M(A a) {
}
}
Another is "method returns":
class A {
}
class B {
public ...
64
votes
22
answers
7k
views
Why do some programmers think there is a contrast between theory and practice? [closed]
Comparing software engineering with civil engineering, I was surprised
to observe a different way of thinking: any civil engineer knows that
if you want to build a small hut in the garden you can just ...
1
vote
4
answers
237
views
Preferred form for error detection and loop termination conditions?
In this Stackoverflow anwer I dimly recall being taught that it's better to use as "wide" a condition as possible to terminate a loop, rather than testing for an exact termination condition.
i.e. use:...
2
votes
1
answer
415
views
is there a formal algebra method to analyze programs?
Is there a formal/academic connection between an imperative program and algebra, and if so where would I learn about it?
The example I'm thinking of is:
if(C1) { A1(); A2(); }
if(C2) { A1(); A2(); }
...
19
votes
8
answers
3k
views
If you learned formal methods for software, how useful have you found it?
If you have been trained in the use of formal methods (FM) for programming:
How useful have you found it?
What did your FM training involve (e.g. a course, a book)?
What FM tools do you use?
...