FIT2024 Lecture Notes - Lecture 4: Programming Language, Function Point
Week 4 - Specification; Configuration Management
Design by Contract
● A class designer establishes a software contract between him/herself and the user(s) of
the class he/she designs
● The software contract provides
○ The documentation of the class for the technical user
○ The possibility of enforcing the contract by using exceptions and assertions
● The software designer tells the user what the class does by providing a specification for
the class
○ What the methods of the class need to operate correctly
○ What the class will guarantee to be true if it is used correctly
Specification
● Ideally part of the implementation
● Essential for supporting component reuse, and maintenance
● The user
○ Should be able to determine how to use the class by reading its specification
○ Should not have to look at implementation details
● Forms the public interface of the class
● Exceptions and Assertions
○ Preconditions
■ State the requirements for using the class
○ Postconditions
■ What the supplier guarantees to provide
○ Class Invariants
■ Conditions that must hold at all times for a class to be valid
Metric
● A quantitative measure of the degree to which a system, component, or process
possess a given attribute
Measures
● Provides a quantitative indication of the extent, amount, dimension, capacity, or size of
some attribute of a product or process
Indicator
● a metric or combination of metrics that provide insight into the software process, a
software project, or the product itself
Document Summary
A class designer establishes a software contract between him/herself and the user(s) of the class he/she designs. The documentation of the class for the technical user. The possibility of enforcing the contract by using exceptions and assertions. The software designer tells the user what the class does by providing a specification for the class. What the methods of the class need to operate correctly. What the class will guarantee to be true if it is used correctly. Essential for supporting component reuse, and maintenance. Should be able to determine how to use the class by reading its specification. Should not have to look at implementation details. Forms the public interface of the class. State the requirements for using the class. Conditions that must hold at all times for a class to be valid. A quantitative measure of the degree to which a system, component, or process possess a given attribute.