Ninth Annual IEEE International Conference and Workshop on the Engineering of Computer-Based Systems (ECBS 2002)
An Experimental Evaluation of Programming by Contract
Lund, Sweden
April 08-April 11
ISBN: 0-7695-1549-5
This paper presents an experiment designed to compare a contract-based programming method with a reference programming method based on exceptions. The purpose was to evaluate whether contracts would shorten development time, improve work satisfaction and increase the quality of the resulting software program. The experiment was carried out in a project work course for students in the computer science program at Karlstad University. The students were to solve an assignment in groups of four within a period of ten weeks. Half of the groups used the contract-based method and the other half the exception-based method. For statistical analysis we gathered data on time consumption and work satisfaction on daily report forms. The results show that there was a gain in the time spent on implementation of the assignment when the contract-based method is used but show no significant difference in total time consumption. The results give a weak indication that work satisfaction was slightly higher in the groups using the contract-based method. The resulting programs were analyzed for a range of quality metrics, but no significant differences were found that were directly related to the methods.
Index Terms:
Experiment, evaluation, contract, precondition, postcondition
Citation:
Martin Blom, Eivind J. Nordby, Anna Brunstrom, "An Experimental Evaluation of Programming by Contract," ecbs, pp.0118, Ninth Annual IEEE International Conference and Workshop on the Engineering of Computer-Based Systems (ECBS 2002), 2002