But here is the real killer! Writing tests for such code base sucks!
Every time I have to write a test I have to create a graph of objects (the haystack) which no one really needs or cares for, and into this haystack I have to carefully place the needles (the real object of interests) so that the code under test can go and look for them. I have to create the Context just so when I construct the Mechanic it can reach in the Context and get what it realy needs, the Engine. But context is never something which is easy to create. Since context is a kitchen sink which knows just about everything else, its constructor is usually scary. So most of the time I can't even instantiate Mechanic, not to mention run any tests on it. The testing game is over before it even started.
Ok, but today we have fancy tools such as JMock and EasyMock, surely i can mock out Context. Yes, you can! BUT: (1) typical setup of a mock is about 5 lines of code. So your test will contain a lot of junk which will mask the real purpose of the test. (2) These tests will be fragile. Every time you refactor something in context, or how context interacts, you are running the risk of breaking your tests. (False negatives) (3) What if you want to test the class Shop which needs a reference to Mechanic? Well then you have to mock out Context again. This mocking tax will be spread all over your tests. In the end the mocking setup will drown out your tests and make for one unreadable test base.
Please stop looking for the needle in the haystack and just ask for the things you directly need in your code. You will thank me later...
Atom Publishing Protocol, Testing a Server Implementation by David Calavera
JInjector: a Coverage and End-To-End Testing Framework for J2ME and RIM by Julian Harty, Olivier Gaillard, and Michael Sama
Advances in Automated Software Testing Technologies by Elfriede Dustin
Taming the Beast: How to test an AJAX Application by Markus Clermont and John Thomas
Automated Model-Based Testing of Web Applications by Oluwaseun Akinmade and Prof. Atif M Memon
Boosting Your Testing Productivity with Groovy by Andres Almiray
Practicing Testability in the Real World by Vishal Chowdhary
The New Genomics: Software Development at Petabyte Scale by Matt Wood
The Value of Small Tests by Christopher Semturs
Deployment and Test Automation: Extending the Notion of 'Done' to 'System Tested on a Production Deployment' by Marc-Elian Begin
No Registration Fees The GTAC conference has no registration fees. Once invitations have been sent to participate, full registration instructions will be sent to each invitee. Breakfast and lunch will be provided each day of the conference, as well as a reception the evening of October 23.
Cancellation If you register as a participant and will not be able to attend, please send email immediately to [email protected] to allow a wait list person the opportunity to participate in that slot.
Hotel Accommodations W Seattle (Conference Venue) 1112 Fourth Avenue Seattle, WA 98101 (206) 264-6000
Other Hotels in the Area Hotel Vintage Park 1100 5th Ave Seattle, WA (206) 624-8000
Madison Renaissance Hotel 515 Madison St Seattle, WA (206) 583-0300
Hotel Monaco 1101 4th Avenue Seattle, WA (206) 621-1770