Questions tagged [formal-methods]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2
votes
2answers
118 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
3answers
138 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
1answer
125 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
1answer
86 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
0answers
35 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 ...
13
votes
3answers
1k 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
4answers
407 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
1answer
155 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
2answers
221 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
2answers
2k 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
2answers
329 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 ...
3
votes
2answers
1k 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
3answers
454 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 ...
12
votes
5answers
2k 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
3answers
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
0answers
93 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 ...
63
votes
22answers
6k 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
4answers
232 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:...
1
vote
1answer
325 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(); } ...
16
votes
7answers
2k 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? ...