Design by Contract for Python
R. Plösch
The idea of design by contract (DBC), realized in the statically typed object-oriented programming language Eiffel, can be viewed as a systematic approach to specifying and implementing object-oriented software systems. We believe that a statically typed programming language is not suitable in the analysis and design phase of a prototyping-oriented software life cycle. For this purpose, dynamically typed interpreted programming languages are better suited. Unfortunately, dynamically typed programming languages usually do not support the concept of DBC. Therefore we integrated DBC into the programming language Python by using a metapro- gramming approach, i.e., without changing the language or the run-time system. We adopted the DBC concept by adding mechanisms for dynamic type checking for method parameters and instance variables. The proposed combination of a more formal approach with a slim programming language provides a good basis for elicitation and documentation tasks in the analysis and design phase, especially in cases of a prototyping-oriented software development approach. Although the approach presented provides basic tool support for the analysis and design phase, further tool support, especially for browsing assertions, is desirable.
R. Plösch, Design by Contract for Python, IEEE Proceedings of the Joint Asia Pacific Software Engineering Conference (APSEC97/ICSC97), Hongkong, December 2-5, 1997.
Get Publication PDF, 68K TR-SE-97.24
Friday, 11 November 2011
Design by Contract for Python
Index of /publications/pdf
Check out this website I found at swe.uni-linz.ac.at
design by contract
http://www.swe.uni-linz.ac.at/publications/pdf/tr-se-97.24.pdf#
Thursday, 13 October 2011
R.I.P. Dennis Ritchie, another great man gone.
And again the mainstream media didn't notice.
http://forums.theregister.co.uk/forum/1/2011/10/13/dennis_ritchie_obituary/
Monday, 3 October 2011
Open email in browser when Pidgin notifies dbus (tags: Python, dbus, email, notification)
#! /usr/bin/pythonimport webbrowserdef open_email(em_subject, em_from, em_to, em_url): print(em_subject, em_from, em_to, em_url) # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(em_url)if __name__ == "__main__": import dbus, gobject from dbus.mainloop.glib import DBusGMainLoop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() bus.add_signal_receiver(open_email, dbus_interface="im.pidgin.purple.PurpleInterface", signal_name="DisplayingEmailNotification") loop = gobject.MainLoop() loop.run()
Immediately show email when Pidgin notifies DBus.
#! /usr/bin/pythonimport webbrowserdef open_email(em_subject, em_from, em_to, em_url): print(em_subject, em_from, em_to, em_url) # Open URL in a new tab, if a browser window is already open. webbrowser.open_new_tab(em_url)if __name__ == "__main__": import dbus, gobject from dbus.mainloop.glib import DBusGMainLoop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() bus.add_signal_receiver(open_email, dbus_interface="im.pidgin.purple.PurpleInterface", signal_name="DisplayingEmailNotification") loop = gobject.MainLoop() loop.run()
Subscribe to:
Posts (Atom)