The Real Turing Test

The original Turing Test is a little different than I normally hear it described. It starts with a man, a woman, and an interrogator. They communicate using text. The interrogator tries to determine which one is a woman. The man impersonates a woman.

The trick is that the man is then replaced by a computer. Now the interrogator tries to determines which of the two (computer or woman) is the computer. It is a test of how well the computer can simulate a human.

There is an annual contest to see whether new computer programs can pass the Turing Test. The best attempt wins $2,000. And if any program can actually pass the test, they win $100,000.

Next time I will go into other artificial intelligence topics such as a computer playing chess.

Artificial Intelligence

I went to the library and picked up a book on Artificial Intelligence. This book was written with the general reader in mind. It made no assumptions that you knew about AI, or that you were a technical person.

Some people in the AI field have made a lot of money in the commercial sector. If you really want to learn AI, you should first learn programming.

I have heard about the Turing Test before. You put a computer up against a human, and see whether a third observer can detect which one is the computer. However this book helped provide a lot more insight into the history and current attempts at winning the Turing Test.

More on this delicious book later.

User Interface Design

We had a new developer design a couple screens for changes in our application. He had a couple busy screens. Sure one of the screens was dictated by the customer. But the other one was a monster that he created himself.

When we did a review of the design, I pointed out that there were way too many buttons on the screen. The new guy explained the use of each of the buttons. I determined it was time to step back and figure out what our goals were.

The top goal should be to make the most common operations easy for our customer. After that, the screen should be intuitive enough that you don't have to read a manual to figure it out. The design for this one new screen was not achieving any of those goals. What happened to the good old Windows user interface design principles? It might be time to get back to basics on our project.

Bulding Robust Systems

There are many principles you can employ to design systems that don't break often. This will help you sleep better at night. That is because the system won't crash, and they won't have to call you for help. I should know about this. I just got a support call this evening. We must not be following the right principles at work.

One this you can do is to manage your events with a queue. There is standard technology to deal with queues. An example is Microsoft's MSMQ. You can even choose a queue in the cloud if you want to get fancy. Wait. Hold that thought. You do not want the support calls. So choose a mature and stable queuing technology.

Many business processes are batch oriented. Each stage requires the output from the prior stage. Our back end is a big UNIX system. You would think you could just pipes the processes along. That works in theory. This is a bad practice in reality. You should design a scheduling system that spawns the processes separately. The results from each stage should go to a file. The scheduler can wake up every so often, see if a stage has completed, then start up the next stage. We have our loading software follow this pattern. It is rock solid, even when things go awry.

A final tip is one that I have heard before. Every time you resolve some trouble ticket, you should turn that into an additional automated unit test. You already are investing the time to test your bug fixes. It is a marginal extra effort to automate that testing. This helps you grow your unit test code base and coverage. Sometimes prevention helps you avoid the pain that you would get otherwise.

Scrum and DSDM

A magazine article I read recently reviewed different agile software methodologies. I have previously written about Extreme Programming. Now I will go over Scrum, and a new one I am not familiar with (DSDM).

Scrum is a management technique. One of its goals is to stabilize requirements. That alone is a noble goal. I find our requirements lacking in general. However Scrum also advocates a daily stand up meeting. Those I have found degenerating into a waste of a whole lot of time.

DSDM stands for Dynamic Systems Development Method. Have you ever heard of it? Neither have I until now. It attempts to hold the resources and delivery date constant. The way to achieve that is to modify the scope of the deliverable. I like the sound of that. It comes from Britain. I don't think it is popular in the States.

I will have more later on things like Continuous Integration and Test Driven Development.

Agile Methodology

I got a really good overview about Agile Methods from a magazine I read this weekend. Surprisingly it was a magazine on testing. It seems the techniques have progreesed past plain development to the world of software test.

Let's start with the first, and what I consider the biggest. That's XP which stands for Extreme Programming. It sounds funny when applied to testing. XP was created by a guy working for Chrysler.

XP focuses on delivering small release quickly. Then you can circle back and add more functionality in later releases. That has the distinct advantage of getting something done fast. It also provides a tangible program for the user to try out. You can get some great feedback from such a responsive development cycle.

There are a number of techniques used in the XP world. These include Test Driven Development (TDD), Pair Programming, and Refactoring. Perhaps I will go into these techniques at a later time. In the mean time, I plan on explaining Scrum and a new method called DSDM. Later.

Programming Rules

I read an article on the web by Rob Pike. He is an important guy in the UNIX/C world. I know I own at least one UNIX text authored by him. For some reason, I thought he was also one of the authors of the awk scripting language. However that does not seem to make sense as the letters in awk are supposed to represent the first letter of the last names of the three guys who invented the language.

It seems I digress. The article I read was entitled “Notes on Programming in C”. The funny thing is that many of the topics discussed by Pike are not specific to C. They can be applied to most programming languages. That is kind of like a Code Complete by McConnell. Let’s start with some of the C specific items as they are few. One is that you should not include another file within an include file itself. In other words, you should not nest include files. Another tip was that pointers are preferable to objects. I think that means pass pointers to objects instead of making copies of the objects themselves.

Now let’s move on to some of the guidance that can be applied whatever programming language you are working with. The first is the short variable names are often better. For instance, it is reasonable to use the variable i for a loop index variable. Next you should strive to eliminate comments. This may sound contrary to what you were taught when you first started programming. However the best code is clean, simple, and easy to understand on its own. It does not need to be littered with comments. This eases maintainability. You can also trust the code always. Comments that are wrong or misleading are harmful.

Finally let’s talk about procedures and functions. Procedure should be named according to what they actually do. That sounds simple. But you would be surprised how some procedures are named which have nothing to do with their function. Next you know that a function returns a value. You should name the function based on the type of value it returns. Any functions returning a BOOL should be in the form of a question. Examples of this are isOpen() and canDelete().