Question

Investigate and discuss the main principles of Design By Contract and in which programming languages are...

Investigate and discuss the main principles of Design By Contract and in which programming languages are these supported.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • Design By Contract is one of the approach that is used to design software.
  • Design by contract programming, contract programming is the same as Design by Contract.
  • This technique is developed by Bertrand Meyer .
  • The main idea behind this design is assertion which is a Boolean statement and its value should be always true .
  • The value of assertion can be false only when there is bug in the program.
  • The assertions are mainly checked during the stage of debugging.
  • Mainly there are three kinds of assertions.
  • They are post-conditions, pre-conditions, and invariant.
  • Post-condition is a statement that says that what it should be after an operation.
  • An example of post-condition is sum = object_1 + object_2 .
  • Pre-condition is a statement that contains some conditions. This statements gives some condition that are to be checked before executing an operation.
  • An example of Pre-condition is, something should be greater than or equal to zero. It decide which data is meaningful.
  • Invariant is based on the instances of class. It should be always true for the the instances of a class.
  • Programming languages that support Design By Contract : Java, C#, Ruby, Python, JavaScript etc...
Add a comment
Know the answer?
Add Answer to:
Investigate and discuss the main principles of Design By Contract and in which programming languages are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT