Posts

Software Engineering Principles

In software engineering, most of our time is spent on solving specific problems. We don't often sit around thinking about what our IDE, Version Control, Automated Quality Assurance, and Build Systems are doing for us. And that is the point - these tools are meant to do their thing quickly and quietly, letting us focus on more interesting aspects of development. However, to be truly successful at software engineering, we need to understand how the tools we use and decisions we make affect the overall product. To this end, I will review five points that I think software engineers need to know. Q: What three groups of people do you need feedback from to accomplish the three prime directives of open source software? A: Remember that the three prime directives are that the system accomplishes at least one useful task, that a new user can successfully install and use the system, and that a new developer can understand and enhance the system. The original developer does not have the c...

Google Project Hosting

Image
While it may not have won the one-on-one tournament, my robot did the best in the melee competition. I'm sure all of ConnellBot's loyal fans will want a chance to help improve its technique, and its enemies will want to learn exactly how it works to create effective counter-strategies. Well, now you have the chance. ConnellBot is available on Google Project Hosting at  https://code.google.com/p/robocode-can-connellbot/ . The source can be checked out through SVN, and I have created guides for both developers and users to get started with the project. I have used SVN and other version control systems in the past, so this part of the task was very easy for me. Since I already had Tortoise installed, it only took a minute or two to check out the template, copy my files to it, and check them in. I found it interesting that while my code is on r2, the entire project is on r9 because it is updated every time I make a change to the home page or wikis. The part that took the l...

A Competitive Robocode Robot

Image
For anyone keeping score, I've recently written about Robocode, JUnit, and Ant Build Systems. Now it is time to put them all together into one project. On October 11th, my robocode robot will compete against other robots for the glory of victory. But what's really important is what we've learned along the way (insert snide comment here). So let's dive in. Robocode You'll recall that robots have three behaviors: movement, targeting, and firing.  I experimented with a robot that moves less often to save energy and one that moves more often to avoid bullets. In my tests, moving on each turn was clearly better than only moving after being hit by an enemy. I've heard of some other tactics that move only when they detect an enemy bullet being fired, which would give them the best of both worlds. But my movement strategy is much more simple. Each turn, I move forward 200 pixels. If I hit a wall, I move in the opposite direction. If I am hit by an enemy bullet...

Ant Build Scripts

Continuing the theme of my last two posts, today I will write about how I am gradually improving my skills in another area of software engineering. This time it is Ant Build Scripts. I've completed the following eight exercises. 1. Ant Hello World: simply prints "Hello World" 2. Ant Immutable Properties: demonstrates ant properties 3. Ant Dependencies: shows how dependencies are resolved 4. Hello Ant Compilation: compiles a simple "Hello Ant" program 5. Hello Ant Execution: executes the "Hello Ant" program 6. Hello Ant Documentation: creates javadocs for the "Hello Ant" program 7. Cleaning Hello Ant: cleans the "Hello Ant" build directory 8. Packaging Hello Ant: creates a zip file of the "Hello Ant" project I had worked briefly with CruiseControl in an internship a few years ago so I was familiar with the types of tasks that could be done with build systems, but I had never written the scripts myself....

My Robot Code Kata

"Robot Code Kata" may be one of the more interesting phrases you'll read in a technical blog. Kata is a martial arts term describing highly choreographed and practiced movements that aim to perfect form. A code kata  is, similarly, an exercise in programming form. It involves purposeful and effortful study toward improving programming skills through a number of small projects. Okay, repetitively practicing programming may not sound that  interesting. Let's add Robots. Robots make everything more exciting. Robocode  is an open source game where Robots written in Java battle each other by moving, targeting, and firing upon their enemies. Simple robo ts are very easy to make, but a robocode champion will involve advanced algorithms for avoiding enemy fire while predicting their movements. My Robot Code Kata consists of thirteen exercises - six in moving, three in targeting, and four in firing. None of these exercises will result in a winning robot, but the skills ho...

Writing and Testing FizzBuzz in Eclipse

I put my Java, Eclipse, and JUnit skills to a simple test today - I wrote the "FizzBuzz" program. FizzBuzz goes through the numbers 1-100. If the number if divisible by 3, it prints out "Fizz." If the number is divisible by 5, it prints "Buzz." If the number is divisible by both 3 and 5, it prints "FizzBuzz." In all other cases, it just prints the number. Obviously this is a simple program. It was a good way to ease back into writing Java (which I abandoned for C# a few years ago), get a feel for the features in the newest version of Eclipse, and introduce myself to JUnit. It took me about 20 minutes to complete the program and unit testing. As expected, the Java code was pretty straightfoward. I did spend a little time redoing some tasks to make sure I was taking full advantage of Eclipse, like creating the main method and managing packages. At first, I wrote everything in the main method and ran the code to check the output. Everything see...

Installing, Using, and Modifying SQuirreL SQL Client

Image
Back in my undergraduate "Introduction to Databases" class, we were asked to create a database client in java. So we did: it could connect to an Oracle database, build and run simple queries, and (at my partner's request) had a black background and green text. We got an A, but it was primitive and ugly and even we wouldn't want to use it. Today I decided to see what other people have come up with. I visited sourceforge  and searched for Database projects written in Java. The first one I found, SQuirreL SQL Client , had good reviews and had been updated within the last few days. The project's homepage at  http://www.squirrelsql.org/  says that it can be used to connect to any database with a JDBC driver. Being able to manage data from multiple various DBMSs at once seems pretty useful, so I proceeded to install it. The available download was a .jar file which, when launched, started to install the client. A few steps in, it asked where to install and I ran into...