Skip to main content

Questions tagged [design-by-contract]

Design by contract (DbC) prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants.

4 votes
4 answers
816 views

I read Bertrand Meyer's paper on design by contract yesterday and it is not very clear for me what is the relationship between DbC and testing, since it appears that without testing I cannot be ...
edalorzo's user avatar
  • 2,696
1 vote
0 answers
109 views

I am currently working on a project using Flask to make REST apis, blablabla. But, working with request validation tools that we use, I am thinking of whether it would be necessary to validate the ...
Damian Akpan's user avatar
-2 votes
1 answer
76 views

For systems that are built on top of diverse tech stacks, including both static and dynamic types languages, what is in practice some ways to have the API contracts published and enforced? Some wiki ...
Jim's user avatar
  • 359
2 votes
1 answer
223 views

I have a large project that is build contract based, where all functions verify input parameters and return values. But there are also cases where they for example verify that a call to a function is ...
munHunger's user avatar
  • 138
0 votes
1 answer
131 views

FIRST AND FOREMOST: Forgive me if the following question falls into the "off topic" category of this StackExchange, due to its slightly opinion polling nature. This is not my intention, I am simply ...
NJ Mercaldo's user avatar
4 votes
3 answers
1k views

An interesting question I've stumbled upon: Let's assume a java application creates a data model, converts this data to a json object with two fields and uploads it to a server: { "FirstName": "...
Samuel's user avatar
  • 789
6 votes
6 answers
2k views

I am writing a library for some data structures in C that will be used in embedded systems. I have had issues designing and coming up with a solid error handling plan. This API is only subject to ...
Michael Joseph's user avatar
4 votes
3 answers
554 views

According to LSP wiki: Substitutability is a principle in object-oriented programming stating that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with ...
inf3rno's user avatar
  • 1,259
2 votes
0 answers
231 views

I'm in the early stages of learning design-by-contract (DbC). And I think that if followed correctly, it can produce very high quality software. This gets me wondering though... why isn't it used a ...
Leon Carlo Valencia's user avatar
3 votes
2 answers
1k views

I'm writing a handler for download/import of data. After inserting data to the database, several import jobs can be called, but usually it is just one. So there are two methods to get the import job(s)...
GreenThor's user avatar
  • 201
4 votes
1 answer
2k views

Does an OOP design that uses a Design by Contract mean the designer is using interfaces to create a "contract." The term "contract" is used quite often when discussing OOP interfaces, so I didn't ...
johnny's user avatar
  • 3,679
2 votes
2 answers
1k views

I am trying to write Stack code using the two techniques i.e Design by Contract vs Defensive Programming but I am not sure if I am doing right or not.I am not throwing any kind of exception or error ...
Grad student's user avatar
4 votes
3 answers
967 views

I'd heard about Design by Contract a long time ago and always was confused by this question. The approach uses real-world client-supplier analogy to describe caller-callee relationships. It stays, ...
neoascetic's user avatar
5 votes
1 answer
361 views

I have a client that's requested a detailed Scope of Work/Statement of Work. Upon looking into it, it seems they want timelines, costs, features, the whole nine. In order to do a detailed SOW, one ...
jleach's user avatar
  • 2,692
3 votes
1 answer
190 views

Design by contract is based on Hoare logic where a proof of correctness of a program is established by reasoning over pre/post conditions and invariants. What are the means and prerequisites of a ...
Trident D'Gao's user avatar

15 30 50 per page