Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [formal-methods]

The tag has no usage guidance.

0
votes
1answer
84 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
31 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 ...
4
votes
3answers
304 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
0answers
65 views

Automatic Test Case Generation

I enjoy writing unit tests when building software. Recently I have been learning about Model Checking to help show that a system matches a specification. Now I am returning to testing to see if it has ...
1
vote
4answers
293 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
139 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
210 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
319 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
943 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
443 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 ...
11
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 ...
9
votes
3answers
1k 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
91 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 ...
62
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
229 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
289 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(); } ...
15
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? ...