From tennessee at tennessee.id.au Thu Sep 1 03:08:55 2005 From: tennessee at tennessee.id.au (Tennessee Leeuwenburg) Date: Thu, 01 Sep 2005 11:08:55 +1000 Subject: [melbourne-pug] Introduction -- Me! Message-ID: <431654A7.5070704@tennessee.id.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello list, This is a little personal introduction, after which I will mostly likely just lurk. :) I am on the Melbourne Uni Computer Students' Association staff list, an organisation which sometime during the dark ages I was founding president of. Maurice Ling posted there to let people know about mpug. I've been increasingly using Python in my work, and I'm quite fond of it. It's very nice to use, especially server-side. The #python guys are all very skilled, and it blows me away how strong the online community is. It makes all the difference in the world when working on something difficult, and I do my best to help out others in turn, mostly by answering the easy questions. :) I work at the Bureau of Meteorology, mostly doing nerdy things with databases. Specifically, I'm working on a glorified version of inseting plug A into socket B, where plug A is a scientific data exchange server called OpenDAP, and socket B is an object-oriented database which not even Dilbert will have come across before. I have used Python as glue-layer code to write the communication server between our database and the OpenDAP server. The actual implementation is rather less complicated than one might expect, but it took a lot bad solutions before I got to where I am, and as always issues surrounding the actual systems in place took a lot of managing. Outside of work, I'm doing a diploma of philosophy, I maintain a blog melbournephilosopher.blogspot.com, and take part in regular life. That's about it, I think. I would be interested in hearing about what other people are doing with Python, esp. in professional contexts, what interesting projects people have on the go, etc etc. Cheers, - -T -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFDFlSnFp/Peux6TnIRArUeAJ9n0mFz73IcDK13Bw8o/ve8SHybRQCdHP5A JBCPGpVf3dk34hAfwuEVAMU= =LyJQ -----END PGP SIGNATURE----- From mauriceling at acm.org Thu Sep 1 04:07:28 2005 From: mauriceling at acm.org (Maurice Ling) Date: Thu, 01 Sep 2005 12:07:28 +1000 Subject: [melbourne-pug] Unit Testing (Following up TDD presentation) Message-ID: <43166260.3060702@acm.org> Hi all, Following from Bruce's presentation, I've been using TDD mainly on the new codes I'm writing. Are there any advice from the group for handling old codes that I've written but needs modification? Thanks Maurice -------------- next part -------------- A non-text attachment was scrubbed... Name: mauriceling.vcf Type: text/x-vcard Size: 324 bytes Desc: not available Url : http://mail.python.org/pipermail/melbourne-pug/attachments/20050901/eff92aae/mauriceling.vcf From miked at dewhirst.com.au Thu Sep 1 13:28:38 2005 From: miked at dewhirst.com.au (Mike Dewhirst) Date: Thu, 01 Sep 2005 21:28:38 +1000 Subject: [melbourne-pug] Unit Testing (Following up TDD presentation) In-Reply-To: <43166260.3060702@acm.org> References: <43166260.3060702@acm.org> Message-ID: <4316E5E6.3070100@dewhirst.com.au> Maurice Ling wrote: > Hi all, > > Following from Bruce's presentation, I've been using TDD mainly on the > new codes I'm writing. Are there any advice from the group for handling > old codes that I've written but needs modification? Old stuff which works doesn't need unit tests UNLESS you intend to modify it. If I was going to modify something old I would probably start again from scratch because I can't stand looking at my own old code. But if I was forced to I would try to break it into chunks of manageable size and keep it working - sort of an integration test suite - which produces known outputs with test data. I would then ... 1. find a bit of functionality I wanted to modify 2. define an interface via which that function can be used 3. write the TDD unit tests which fit that interface 4. write unit-tested software in a new class 5. modify the old code to call the new class for that functionality 6. see if it all still works together with the test data My bottom line is that it is almost impossible to retrofit unit tests to old code. Not because it can't be done but because when you sit down and look at it you get very dejected. It is very hard. It would generally be easier and quicker to write new unit-tested software. Wrong way - go back :) Cheers Mike > Thanks > Maurice > > > ------------------------------------------------------------------------ > > _______________________________________________ > melbourne-pug mailing list > melbourne-pug at python.org > http://mail.python.org/mailman/listinfo/melbourne-pug From cropleyb at yahoo.com.au Fri Sep 2 03:30:37 2005 From: cropleyb at yahoo.com.au (Bruce Cropley) Date: Fri, 2 Sep 2005 11:30:37 +1000 (EST) Subject: [melbourne-pug] Unit Testing (Following up TDD presentation) Message-ID: <20050902013037.25506.qmail@web60216.mail.yahoo.com> > From: Maurice Ling > > Hi all, > > Following from Bruce's presentation, I've been using TDD mainly on the new codes I'm writing. Are there any advice from the group for handling old codes that I've written but needs modification? > > Thanks > Maurice I'm glad to hear you're giving it a go! You could try writing a test for the functionality that you are finding needs to be added. Quite often you find that you want to write a unit test, but it isn't possible because of a dependency in that module that brings in a huge amount of the rest of the system. So then you want some unit tests to ensure you don't break stuff as you refactor that code to reduce the coupling. But you can't because of those same dependencies. etc... For some domains, system tests are fairly easy to write for older code, and they give you more confidence that everything is working together properly. Unfortunately, they run much slower than unit tests. But you probably need some system tests anyway. Another approach would be to try mocking out the unwanted module dependencies. I've been adding module/package mocking support to Dave Kirby's Python-Mock project (http://sourceforge.net/projects/python-mock/). Version 0.2 is coming out soon. It's still very early days for the module mocking functionality, but the main Mock class has been around for about 5 years. Let me know if you try it out. BTW, I've uploaded the presentation file and the source that we wrote to the MPUG wiki (http://wiki.python.org/moin/MelbournePUG). Bruce ____________________________________________________ Do you Yahoo!? The New Yahoo! Movies: Check out the Latest Trailers, Premiere Photos and full Actor Database. http://au.movies.yahoo.com From qubero at gmail.com Fri Sep 2 02:04:20 2005 From: qubero at gmail.com (Peter Galaxy) Date: Fri, 2 Sep 2005 10:04:20 +1000 Subject: [melbourne-pug] Unit Testing (Following up TDD presentation) In-Reply-To: <4316E5E6.3070100@dewhirst.com.au> References: <43166260.3060702@acm.org> <4316E5E6.3070100@dewhirst.com.au> Message-ID: Hi Maurice, I've also been trying out unit tests since seeing Bruce's presentation, and also been retro-fitting my old code. I've been working on a binary editor (Qubero) for sometime. I last worked on it six months ago and thought I'd have another play with it. Last time I worked on it, I'd just done a heap of fundamental modifications to make it work on a bit level, rather than a byte level -- (imagine an editor where you could delete a single bit and have everything after it shift up like deleting a character in a word processor). Anyway I'd done all these changes, and once I finally got the thing to actually compile (it's in Java), I left it like that: full of bugs. For six months. I've started to work on it again this week. My usual style of debugging is to make a big mess of print statements with debug info all over the code until i can narrow down the problem, fix it, and then comment out or delete the print statements. Instead I've been creating unit tests. So now I have a small but growing collection of unit tests for my project. They're not as thorough as if I'd started with TDD. I'm not sure how different my coding style would be if I had: i tend to think in terms of interfaces anyways. But at least I have some tests now, and I'll still have them later for regression testing. I've still resorted to the old fill-code-with-print-statements style a few times, but doing that has also benefitted from unit tests, as they make it easier to control what code is being executed for doing the debugging with. And you're left with a new test case in the end. By comparison, debugging by playing the program's GUI is pretty inefficient and can generate huge amounts of debugging output. I've been coping surprisingly well with my sparsely commented code, and fixed a heap of problems in a short time. It's working well for me. And the test cases also act as a form of documentation. Peter. From mauriceling at acm.org Tue Sep 13 07:11:37 2005 From: mauriceling at acm.org (Maurice Ling) Date: Tue, 13 Sep 2005 15:11:37 +1000 Subject: [melbourne-pug] meeting this thursday? Message-ID: <43265F89.3020703@acm.org> Hi, Just like to confirm if there is a meeting this thursday? Cheers Maurice -------------- next part -------------- A non-text attachment was scrubbed... Name: mauriceling.vcf Type: text/x-vcard Size: 324 bytes Desc: not available Url : http://mail.python.org/pipermail/melbourne-pug/attachments/20050913/8bef7504/mauriceling.vcf From abriggs at westnet.com.au Tue Sep 13 08:00:22 2005 From: abriggs at westnet.com.au (Anthony Briggs) Date: Tue, 13 Sep 2005 16:00:22 +1000 Subject: [melbourne-pug] meeting this thursday? In-Reply-To: <43265F89.3020703@acm.org> References: <43265F89.3020703@acm.org> Message-ID: <43266AF6.1000907@westnet.com.au> Maurice Ling wrote: > Hi, > > Just like to confirm if there is a meeting this thursday? Yes, there is - sorry, I had meant to post a reminder last week, but I must've forgotten to. There's always the calendar at , which will tell you what's coming up, too :) Anthony From daedalus at eigenmagic.com Wed Sep 14 05:06:50 2005 From: daedalus at eigenmagic.com (Justin Warren) Date: Wed, 14 Sep 2005 13:06:50 +1000 Subject: [melbourne-pug] meeting this thursday? In-Reply-To: <43266AF6.1000907@westnet.com.au> References: <43265F89.3020703@acm.org> <43266AF6.1000907@westnet.com.au> Message-ID: <1126667210.6515.0.camel@localhost.localdomain> On Tue, 2005-09-13 at 16:00 +1000, Anthony Briggs wrote: > Maurice Ling wrote: > > Hi, > > > > Just like to confirm if there is a meeting this thursday? > > Yes, there is - sorry, I had meant to post a reminder last week, but I > must've forgotten to. There's always the calendar at > , which will tell you what's > coming up, too :) I'll have to make my apologies for this meeting. Work's called a late meeting that I have to attend, unfortunately. -- Justin Warren From t_saveski at yahoo.com Wed Sep 14 06:35:12 2005 From: t_saveski at yahoo.com (Tony Saveski) Date: Tue, 13 Sep 2005 21:35:12 -0700 (PDT) Subject: [melbourne-pug] Thursday's meetup... Message-ID: <20050914043512.41392.qmail@web50611.mail.yahoo.com> Hi Guys, Has Richard confirmed for the PyGame presentation yet? I should be able to make it tommorow, and maybe bring a friend or two if the presentation is going ahead. Cheers, Tony __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From richardjones at optushome.com.au Wed Sep 14 06:41:18 2005 From: richardjones at optushome.com.au (Richard Jones) Date: Wed, 14 Sep 2005 14:41:18 +1000 Subject: [melbourne-pug] Thursday's meetup... In-Reply-To: <20050914043512.41392.qmail@web50611.mail.yahoo.com> References: <20050914043512.41392.qmail@web50611.mail.yahoo.com> Message-ID: <200509141441.18420.richardjones@optushome.com.au> On Wed, 14 Sep 2005 02:35 pm, Tony Saveski wrote: > Has Richard confirmed for the PyGame presentation yet? Consider me confirmed ;) Richard -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/melbourne-pug/attachments/20050914/4cd9ea71/attachment.pgp From tennessee at tennessee.id.au Wed Sep 14 06:43:15 2005 From: tennessee at tennessee.id.au (Tennessee Leeuwenburg) Date: Wed, 14 Sep 2005 14:43:15 +1000 Subject: [melbourne-pug] Thursday's meetup... In-Reply-To: <20050914043512.41392.qmail@web50611.mail.yahoo.com> References: <20050914043512.41392.qmail@web50611.mail.yahoo.com> Message-ID: <4327AA63.7060400@tennessee.id.au> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tony Saveski wrote: > Hi Guys, > > Has Richard confirmed for the PyGame presentation yet? I should be > able to make it tommorow, and maybe bring a friend or two if the > presentation is going ahead. > > Cheers, Tony I had thought of dropping by also. If it's definitely going to be on, or not, let me know either way. Cheers, - -T -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iD8DBQFDJ6pjFp/Peux6TnIRAn7ZAJ9GuVXi/qo5CKuPZHDc25bQAxu9RwCeO4aE +oZz0GWyzdtB0hAC7iVN9aM= =I4zX -----END PGP SIGNATURE-----