Questions tagged [design-by-contract]

Design by Contract (DbC) or Programming by Contract is an approach to designing computer software. It 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. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and

Design by Contract (DbC) or Programming by Contract is an approach to designing computer software. It 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. These specifications are referred to as "contracts", in accordance with a conceptual metaphor with the conditions and obligations of business contracts.

Because Design by Contract is a registered trademark of Eiffel Software in the United States, many developers refer to it as Programming by Contract, Contract Programming, or Contract-First development.

216 questions
0
votes
1 answer

Scala type constraints confusing error

This code: trait Base[+K <: Option[Int]] { val a: K = None } class GuaranteedA extends Base[Some[Int]] { override val a = Some(1) } produces an error: :8: error: type mismatch; found : None.type required: K val a: K =…
Lux Weidling
  • 135
  • 1
  • 1
  • 5
0
votes
1 answer

Ensure Memory Location of Variable hasn't Changed

This is a follow up of my previous question I'm working on writing some constraints for a class method using PyContract (not PyContracts). As a postcondition, I'd like to ensure that the memory address of some object hasn't changed i.e. id(myObj)…
inspectorG4dget
  • 110,290
  • 27
  • 149
  • 241
0
votes
1 answer

Referencing `self` in `__old__` in PyContract constraints

I'm working on writing some constraints for a class method using PyContract (not PyContracts). As a postcondition, I'd like to ensure that the memory address of the instance hasn't changed i.e. id(self) should be the same before and after calling…
inspectorG4dget
  • 110,290
  • 27
  • 149
  • 241
-1
votes
1 answer

When JSR-308 will become part of JDK?

See my blog post for excerpt from Java Posse #386 - Newscast for May 31st 2012 that expands this topic. Does JSR 308 promotes design-by-contract to Java? It is step further from assertions? When it will be part of JDK? When it is scheduled to be…
alexsmail
  • 5,661
  • 7
  • 37
  • 57
-2
votes
1 answer

Best practices for Design by Contract (DbC) and Test Driven Development

I'm interested in obtaining a concise recommendation on how best to use code contracts and tests in practise, across the board from development to production. I understand that both are different paradigms, both testing different things. On a…
AdrianGW
  • 143
  • 1
  • 8
-3
votes
2 answers

Can I rely to ISE Eiffel as a programming language to offer web services through a DB connection

I'm actually working for a little company of 10 people on the area of solar panels solutions in Chile. Am working on linux since 20 years now. When I studied programing I studied a lot with Eiffel which I found really a great language. Since, I'm…
Pipo
  • 4,653
  • 38
  • 47
1 2 3
14
15