Posts Tagged javascript

Testing anti-patterns for developers

I’ve been saving this rant for a while now:

1. Test everything at the front-end, in exquisite detail – every project sponsor understands what tooltip 0 really means. Also a great idea if you like long-running and fragile tests that require deployments, browsers, testing frameworks and the kitchen sink. Testing at different layers, and perhaps even without a browser or (in java) a servlet container is for the weak.

2. Perform a database cleanup before and after every test, whether it needs to be done or not. For the truly adventurous add something about clearing out JMS queues and stopping scheduled tasks while you are running the cleanup tasks.

3. Always use the same data for tests, and better still use the same data for different tests. That way you will have do perform anti-pattern 2 with no questions asked. If anyone does ask about random or unique data just scoff sagely.

4. For those tied to java, run each test in its own JVM. If you happen to use a DI framework with lots of XML make sure it is initialised completely for each test. If anyone mentions forkmode=once just pretend to ignore them until they go away.

5. Write your application so that you need a JavaScript enabled browser before you can test anything at all. Progressive enhancement is only for those who cannot see.

Catharsis.

Tags: , , , , ,

JPasskeep and Command-Q on Mac

I’ve released a new version of my long-running password keeper application: JPasskeep. This new release is now able to handle a Command-Q keystroke on the Mac, giving a user (i.e. me) an chance to save any updated entries. No more mousing around to close a window.

The actual mechanism to do this was to reflectively call Apple’s EAWT application classes to allow me to register the correct event listener. Hmm, run anywhere with java GUI apps.

You can download the cross-platform and mac DMG binaries from the project’s GitHub repository.

Tags: , , , , , ,

Asynchronous HTML and HTTP

This post is to remind me that the next time that I am asked to consider using AJAX on a project to actually have a more careful think about the project’s design and user interaction requirements. If I take the time to look at what I really need to retrieve dynamically then will AHAH do a better job more simply than AJAX & DOM manipulation? Will it make my application easier to test?

No great insights, rather than a prompt to ask more questions.

Tags: , ,