June 2004 Archives

One thing I am constantly fighting with while developing software systems, is the issue of when to do automated testing, and when not to. Some evangelists of automated testing procedures will try and convince you to always automate your testing.

I believe differently. Like everything in life, there should be a balance between using automated procedures and manual testing. Web based systems are growing at a very rapid pace, and this is a prime example of where a delicate balance is needed. Automating back end logic is much easier than automating front end logic (i.e. the GUI). This is simply because the user interface is not easily accessible using programmatic methods such as API's, services etc.

Most (clever) people adopted the coding style of separating business logic out of the UI, into a separate business layer. This eases automated testing dramatically, since now most of the functionality can be automated and only the thin UI layer needs to be tested manually.

However, even with the business logic separated from the GUI, it sometimes is still a huge pain to write automated tests. A simple example is a test to ensure the side effect a certain method has on the database is correct. This implies the test needs to go through these steps:

  • Run the test to generate the DB entries
  • Compare the DB entries to what is expected
  • Delete the entries generated to prepare for the next run (the test needs to be idempotent)

If the side effects are huge, such as an entity consisting of several linked relationships, then this can become quite cumbersome to automate - to the point where writing the automated test might take longer than all the cumulative time spent if tested manually.

I believe one should consider the following aspects in order to make the best decision:

  1. How critical is the functionality that you need to test for the system's success?
  2. How complex is that functionality?
  3. Does that functionality lay in the critical path of the system, i.e. how often is it executed?
  4. How long would it take to automate that test?
  5. How long would it take to manually test the functionality
  6. How regularly does that code changes or gets worked on?

You should automate your tests if and only if:

  • (1) is important to critical
  • (2) is moderate to high and (1) is important to critical
  • (3) is often to regularly
  • (4) is less than (5) * (6)

I would say for the other times, one should be able to get away with more efficiency using manual testing. I would love to hear what you think? Please comment away...

Microsoft Windows woes...

| | Comments (0)

Ever got frustrated by virusses (virii??) and Windows? Well, I am subscribed to Bruce Scheider's Cryptogram and found this link which I think is a great read.

Lost generation....

| | Comments (0)

I remember I used to work happily in Wordperfect 6.1 for Windows 3.1, back in the 90's. I had only 8MiB of RAM back then, so it took a few seconds to load. But once it was loaded, it was amazingly fast. Put it this way - I could never outtype the word processor.

Windows 3.1 booted in a few seconds on a high end PC. DOS booted even quicker - under a second. Yeah yeah I know - DOS and Windows 3.1 does not have true memory management, no pre-emptive multitasking, no networking subsystem etc. But then again those PC's were 486DX2-66 MHz machines with 2-8MiB of RAM...

Why am I ranting like this? Because I am frustrated seeing my G4 1GHz 17" PowerBook with 1GiB RAM run into 90% CPU utilization just because I have Microsoft Word 2004 on Mac OS X 10.3.4 open. In specific, I have one document open based on the new Notebook type document. For the rest - I am not touching the notebook. It is just sitting there chewing up 90% of my CPU - doing nothing. After some troubleshooting I found 70% of the problem. I have about 20 entries, each with one of those fancy aquafied icons (checkbox, exclamation mark and question mark) to indicate the kind of entry. That is why those icons are there for, isn't it???

Anyways, removing all those icons, and leaving the notebook to settle caused it to drop to a steady 20% CPU utilization, with Word taking up about 15% of that 20%....

My question to you is - why? Those icons are not animated, and even if they were I am sure a 1GHz computer can render a 10x10 pixel animated GIF without using any significant CPU time. Heck - back in the 80's and 90's people used to have the Assembly '9x competitions where they rendered rotating 3D torusses in a 4KiB COM file running on 386's!

I love my Mac - make no mistake about it. I prefer it to anything else for workstation related work. But why can't Microsoft (and so many other companies) who have more than 20 years of experience behind them in the software industry, write efficient code anymore? It seems there are some people who agree with me on this.

Is it really so difficult for M$ to spend the day or two on Word 2004 for Mac OS X to optimize the idle loops a bit? Because of this, I cannot really use the Notebook thingey since I need the ability to have it open at all times on my desktop - which is clearly not possible without chewing up all my available CPU power...

This is not the first time I got pissed off at this kind of behaviour...

DOM vs SAX

| | Comments (0)

I always knew DOM and XPath were not as fast as SAX, but I have never realized exactly how slow they are when applied to a huge XML document.

I guess some things do change in this world of ours... Many years ago I vowed I'll never touch a computer. That was 11 years ago. I have been working with computers for more than 29000 hours now...

A few days ago I vowed I'll never do the blog thing...

I'll try it out and see whether it is a sensible way of getting rid of pent-up words inside of me :)

'Till later then.