Individual Versus Team

The New York Times ran a lengthy article on basketball player Shane Battier. I had never heard of this player. That is probably because he is not a superstar. However analysis shows that Battier makes his team win. The raw statistics do not do him justice. His team’s management keyed in on it though. They just can’t put their finger on what it is that Shane does to inspire the wins. But the numbers do show his presence drastically increases the probability of a win.

I found the article stimulating. In my own mind, I wanted to apply this phenomenon to software development. Personally I want to increase my own skills. This goal may be in direct opposition to my team or company’s goals. How can I reconcile these competing forces? The company might not even know the value of my actions for the team.

If the company does not know that I am responsible for some wins, how can they begin to compensate me for it? It is almost as if it does not make sense to do what is best for the company if my actions provide no benefit to myself. This does not even consider the fact that many developers only stay at one place for a year or two.

This all probably boils down to the source of my own motivation. Or in general, what is it that motivates a developer to do good work? I would hope that it would be something greater than a big paycheck. Don’t get me wrong. I am not in this profession for charity purposes. But you need to have that desire to do development deep down inside to be able to stick it out.

The other half of the equation is how does a company reward its technical staff. Or more accurately, how does a company reward its technical staff so that it leads to people doing what is best for the company. Is it too simple to ask for a rewards policy that encourages individual and company goals at the same time? Yeah I guess that is not going to happen.

Use the Source Luke

Our customer reported a strange problem in the production environment. They were not seeing the right display on some data. The guy who leads my team took this problem. He asked me if I knew how to make the problem happen. I did not. So I recommended he get in touch with the user that submitted the problem.

A tester on our project also called me and asked if I knew how to make this problem happen. I told him I did not. This tester and my team leader got together to work on this problem. My team leader consulted the documentation. Then he tried changing the test data in our development environment. However he was not able to replicate the problem that the user was having.

Once again my team leader asked me for some advice. He thought that perhaps this was some sort of screen resolution problem where text is getting clipped. I told him this might be the case. However I urged him to consult the source code that computes and displays the value. After all, you should not trust the documentation 100 percent.

A few minutes later, the team lead called back. He saw that there was some transformation in the source code that resulted in the data being displayed on the screen. He was then able to make the behavior happen in the development environment. Usually once we can recreate a situation, we can resolve the problem. The hard work is getting to that point.

I am frequently surprised how developers in the maintenance world are hesitant to call up the end users and trace the actual source code. They often concoct all kinds of theories as to what might be wrong with the system. The problem is that until you know exactly what the user is talking about, and you see the code that is involved, you might go nowhere with the hypothesis method.

The Art of Pseudocode

Our project at work frequently has tasks that require software design. We are required to document our design at a high and low level in different design documents. I frequently contribute to this effort. My normal instinct when writing an algorithm in pseudocode is to use a mixture of English and PL/SQL code. This follows the precedent made by the original designers of our system. The chief architect was a PL/SQL developer. So naturally he expressed and documented his designs in PL/SQL. I follow that trend to this day.

Right now I am taking a Java programming course at the local community college. My Java book has some alternate methods to writing pseudocode. They seem fine. Often they include Java specific keywords. Since I am in the middle of learning the Java programming language, this pseudocode is quite easy to follow.

My instructor has some other ideas about how pseudocode should look. He concedes that there is no official standard for pseudocode format. However he believes there is an unofficial industry standard. One characteristic of this standard is that each line of pseudocode should begin with a verb.

Now I am usually in favor of standards. However standards need to be written down and agreed upon. Otherwise there is no objective standard. My own opinion about pseudocode is that it should clearly communicate algorithms and design. If it accomplishes that task, I don’t care what the format of the pseudocode is. For my class I will adhere to any format my instructor requires. But out here in the real world, you use the tools and formats that get the job done.

If my instructor were to read my blog, he would give the old “minus 2 points Maintenance Man” in jest. Therefore I will not give him the URL of my blog until I have long since aced his class.

OLE DB by Example

Our customer gave us some new requirements with a short turn around time. A developer performed some rapid application development to code up a GUI. Then this developer quit. Another developer tried to pick up where he left off. However he was unsuccessful. So I was given the task. I have a week to deliver it to internal testing.

The original developer told me where he left off. There were some GUI control issues in adding next records. And he confessed that he did not know what to do for an update. To figure out where we really were, I tested what we had. The add code did not work due to the GUI control issue. And update did not seem to do anything.

I am not starting from nothing. There is some code which reads and displays data in the database. However there seems to be a lot of work to do. The add code was not working due to some broken validation in the front end. The update was not working because there was no code behind the screens. My big mission was to code up this update processing.

This application uses OLE DB to access the database. I have used OLE DB before. But I am not strong in it. The goal was to get this done in a week. The customer does not care how elegant my code is. So I decided to just cut and paste some working OLE DB code. Then I hacked at it until the update processing seemed to work.

Testing of the update processing uncovered some deficiencies. The work was split up into a GUI front end and some back end stored procedures. The back end was coded and declared complete. However as soon as I got my update code working, I determined that the back end update processing was broken. Luckily I had another back end developer that could fix these bugs as I proceeded with the front end.

I thought I might not be able to make the week long delivery. However things are looking up. The breakthrough was when I decided to cut and paste working code to expedite coding. The other advantage was to only work on the pressing issues to make the basics work.

Training Your Replacement

Our system uses an old version of Oracle Reports. It is Oracle Reports 6i to be exact. This is a client/server version of Oracle Reports in which you need to install a report server on your workstation to run the reports. We have a large number of those reports to maintain. Our back end database has kept up with the latest releases from Oracle. Right now we are running Oracle 10g on the back end.

There is one person on our development team who is assigned the reports duties. In fact, that is pretty much all she does. She does not work on the rest of the applications since they are written in C++. She does not know C++. This developer came from a testing background. She is on the development team because she has a big mortgage and needs the money.

We have proposed a couple alternatives to our customer on how we can upgrade our reports infrastructure. One way was to go with the new Oracle way of doing reports. That requires a back end report server, and perhaps even an application server. This is the way Oracle wants us to go. It supports delivering reports over the web. Our reports developer would like this. It would let her leverage her reports knowledge, while she gets to learn some web stuff. Unfortunately our customer turned that idea down. They don’t like having to pay for and maintain back end infrastructure such as reports and application servers.

Instead our customer has opted for us to port the Oracle Reports to C++ code. This poses a problem for our reports developer. She just does not know C++. And that is a language that you just don’t learn overnight. At first this developer said she might have to lean C++. However management has another plan. They have hired a consultant to do the port. I met with the consultant. She seems very proficient. I think she might be able to do the job. The only hard parts will be learning our customer’s domain, and implementing a design that our team lead want.

The main problem with all of this is determining what our old reports developer shall do now. She has a limited skill set for our project needs. Her job is being replaced by a consultant. And now we have her training the consultant on how the reports work. I would not want to be in that position. Maybe she can go rejoin the testing team. In this economy, you must do what you have to in order to hold on to your job. What should our reports developer do?

PrimoPDF to the Rescue

My company had a good year. So they decided to lift the restrictions on costs to fund certifications. I talked it over with the big boss. He said he would approve anything related to our project. I decided to get an Oracle certification.

At first I had to check with the development management to ensure I could get a week off from the project. It takes this long to attend training for Oracle certification. I finally got the ok for the time. Then I gathered up all the required documentation. I needed to get the big boss to sign off. The only problem is that he works at a different location.

I figured this is business. So I could just FAX him my document. I called up the big boss and left him a message. All I needed was his FAX number and for him to be there. I got no response. Then I sent him a follow up e-mail the next day. I found out he was "off site". Great. He asked if I could put my forms in a PDF and e-mail it to him.

I went home and scanned in all my forms. The only problem was that my scanner software produces image files. The boss needed PDF. I found PrimoPDF on the web. If you can print your document, PrimoPDF can generate a PDF for it. Problem solved. And it did not cost me anything.

Data Generation Scripts

Our project had a big meeting to review what went right and wrong in our latest release. For some reason we spent a lot of time discussing things without getting a full list of problems. One issue that did get discussed was a longstanding one. We have outdated test data we use for development and internal testing. This has been talked about before. However we have not solved this problem yet.

After going home, I read a magazine article about writing scripts to generate test data. A lot of the ideas resonated with the situation we have on my own project. Data generation script writing requires great skill. You almost have to possess some development background. That’s why it never works when we tell the testers to create their own data.

A good way to plot out you data generation strategy is to create scenarios first. You should organize these scenarios around the flow a regular user would take in the real applications you are testing. Once the script gets written, it should be able to clean up test data that is created. It should also enable logging.

Some best practices for data generations script writing include liberally using asserts. You are making a number of assumptions when creating the data. Why not go the full distance and verify those assumptions. I read that you should use regular expressions why adding asserts to your scripts. I know I need to brush up my regular expression knowledge for that.

Test generation scripts should enter some bad data to try to break the system. The scripts should accept a parameter which indicates what environment you are populating. For example, this may be for development or for internal testing. Data generation scripts, like any other source code, should be kept under source code control. Check those scripts in.

Once the scripts are written, you should run the tests regularly. You never know when developers will break existing code. Finally you should send the output of your automated tests to as many interested parties as possible. I know we have a lot of data generation needs on my project. I think I am going to get involved with the solution in a big way.

Peer Code Review

Recently I have found advertisements from Smart Bear Software offering a free book. The book title is The Best Kept Secrets of Peer Code Review. At first I worried that there was some catch. Usually nothing is free. But I decided to bite and request the book. I read it from cover to cover. There were some gems in there for software development and maintenance.

Bugs make you lose market share if you sell the software. Code review can provide a competitive advantage. The problem is that developer time is expensive. The cost of reviews to programmers seems to outweigh the benefits to them. Peer review tools can lower the effective cost.

If you spend more time reviewing code, you will find more defects. However more code does not necessarily translate to more problems found. In fact, the optimal code review is for chunks of code which are less than 200 lines of code. There is also a drop in productivity after about an hour of code review.There really isn’t a lot out there about code peer review. That’s where the catch from Smart Bear Software comes in. They produce a tool called Code Collaborator which helps automates review. I know Google has similar software that is open source (free). This sounds a lot better than the manual peer review methods we use on my project.