Diagnosing Errors in DbC Programs Using Constraint Programming

  • R. Ceballos
  • R. M. Gasca
  • C. Del Valle
  • D. Borrego
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4177)


Model-Based Diagnosis allows to determine why a correctly designed system does not work as it was expected. In this paper, we propose a methodology for software diagnosis which is based on the combination of Design by Contract, Model-Based Diagnosis and Constraint Programming. The contracts are specified by assertions embedded in the source code. These assertions and an abstraction of the source code are transformed into constraints, in order to obtain the model of the system. Afterwards, a goal function is created for detecting which assertions or source code statements are incorrect. The application of this methodology is automatic and is based on Constraint Programming techniques. The originality of this work stems from the transformation of contracts and source code into constraints, in order to determine which assertions and source code statements are not consistent with the specification.


Source Code Basic Block Constraint Programming Conditional Statement Goal Function 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Meyer, B.: Applying design by contract. IEEE Computer 25, 40–51 (1992)Google Scholar
  2. 2.
    Traon, Y.L., Ouabdesselam, F., Robach, C., Baudry, B.: From diagnosis to diagnosability: Axiomatization, measurement and application. The Journal of Systems and Software 1, 31–50 (2003)CrossRefGoogle Scholar
  3. 3.
    Weiser, M.: Program slicing. IEEE Transactions on Software Engineering 4, 352–357 (1984)CrossRefGoogle Scholar
  4. 4.
    Mateis, C., Stumptner, M., Wieland, D., Wotawa, F.: Model-based debugging of java programs. In: AADEBUG (2000)Google Scholar
  5. 5.
    Groce, A., Visser, W.: Model checking java programs using structural heuristics. In: ISSTA 2002: Proceedings of the, ACM SIGSOFT international symposium on Software testing and analysis, Roma, Italy, pp. 12–21 (2002)Google Scholar
  6. 6.
    Cleve, H., Zeller, A.: Locating causes of program failures. In: 27th International Conference on Software Engineering (ICSE 2005), St. Louis, Missouri (2005) Google Scholar
  7. 7.
    Ceballos, R., Gasca, R.M., Valle, C.D., Rosa, F.D.L.: A constraint programming approach for software diagnosis. In: AADEBUG Fith International Symposium on Automated and Analysis-Driven Debugging, Ghent, Belgium, pp. 187–196 (2003)Google Scholar
  8. 8.
    Binder, R.: Testing Object-Oriented Systems: Models, Patterms, and Tools. Object Technology Series. Addison-Wesley, Reading (2000)Google Scholar
  9. 9.
    de Kleer, J., Mackworth, A., Reiter, R.: Characterizing diagnoses and systems. Artificial Intelligence 2-3, 197–222 (1992)Google Scholar
  10. 10.
    Alpern, B., Wegman, M., Zadeck, F.K.: Detecting equality of variables in programs. In: Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, San Diego, California, pp. 1–11 (1988)Google Scholar
  11. 11.
    Ceballos, R., del Valle, C., Gómez-López, M.T., Gasca, R.M.: CSP aplicados a la diagnosis basada en modelos. Revista Iberoamericana de Inteligencia Artificial 20, 137–150 (2003)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • R. Ceballos
    • 1
  • R. M. Gasca
    • 1
  • C. Del Valle
    • 1
  • D. Borrego
    • 1
  1. 1.Departamento de Lenguajes y Sistemas InformáticosUniversidad de SevillaSpain

Personalised recommendations