The Context
The role of programmer (in this context) consists of a number of duties:
We don't practice PairProgramming, and don't have many unit or acceptance tests.
The requirements consisted initially of a few screenshots from Visio showing an example of each page in the application. The application is a Web front end to a content management and distribution server.
This design did not include:
The defacto design pattern in use was StandaloneJsp.
The Ranting
I am, for the most part, expected to turn out code which plugs straight into the existing platform. Whether it's a JSP-based report, custom Java or JSP plugin, or even a number of interrelated components, the standard way of testing is to add it to the platform, turn it on, and see if it works. I might get to do this a few times on my local machine before it gets deployed to the test server, after which any problem becomes a bug report which goes straight to my mailbox if I'm lucky. If it's a bad bug someone will tell me verbally instead.
On Testing
In extremeprogramming@yahoogroups.com, "J. B. Rainsberger"
CarolineFoster wrote [in http://groups.yahoo.com/group/extremeprogramming/message/67515] - I have the same problem, but with my unit tests. I get six lines in, realise how much set-up there is and give up. [I'm working mainly with servlets and JSPs. I've tried Catcus, but I spend five minutes, realise how much setup there is and give up. Shame on me.]
AcceptanceTests are a different story, and are perfect for TestDrivenDevelopment. An example:
Step 4 can (and should) lead to further refactorings, which can open up the possibility of having a reasonably defined "unit" which is capable of being tested independently. But if 5 passes then the pressure to move onto 3 (or maybe even straight to 4) for the next bit of functionality is very strong (at least in my world)...
In refactoring@yahoogroups.com, emily.bache@a... wrote [slightly edited]:
A couple of years ago I tried to refactor a large messy Java (partly J2EE) application, and it was a disaster. The code ended up so full of bugs it was unusable, after around 3 months of my time.
Reasons were:
I am happy to say that I think I learnt from this experience. I am currently refactoring another application, and everything is working well. Some things I have done differently:
It helped that the codebase didn't have many bugs in to start with.