Turnleaf Design Ramblings of a junior developer

10Nov/090

Mocking JDBC Connections with MockRunner

Last week I published an article, An Intro into Test Driven Development with Junit4, which got somewhat mixed reviews. One particular commenter on reddit suggested I didn't understand that unit tests shouldn't talk to its data source. I decided to do some investigating into his claims, you can check out my findings here. I was however intrigued none the less and started looking for a tool that would allow me to easily mock a JDBC connection. I found Mockrunner to be the easiest to use of the ones I have found. Below is a brief tutorial on how to use Mockrunner. (Keep in mind that I am still fairly new to using Mockrunner)

Technorati Tags: , , ,

26Oct/093

An Intro into Test Driven Development with JUnit4

Please read the technical guide before starting this tutorial.

This article will mark the first of a long-term series covering professional software development. For the lowdown on this project check out this article. Be sure to give me your feedback as it will be vital in helping me develop better tutorials in the future.

Test driven development seemed like a natural choice as a lead off to my series of tutorials as I had to explain why I am writing all these tests. It is also a very good development methodology that will actually save a lot of time by reducing the amount of time spent debugging. For this tutorial and the entire project, I will be using Junit4. For a synopsis on test driven development you can check out the wikipedia article here. If you need a brief refresher on JUnit you can read my tutorial here (written in Junit3).

Technorati Tags: , , ,

18Oct/092

Taming of the Subversion, a SVN primer; part 3

In the third and final part to my SVN primer I will finish up with my day to day tasks and I will go over how to add SVN properties to your project. The first two parts can be found here: 12.

Technorati Tags: ,

14Oct/091

Taming of the Subversion, a SVN primer; part 2

In part one I went over how to get SVN setup and configured on your system. In Part two I will get into the day to day activities of using SVN. In this part of my SVN primer I will cover; Checking out, committing, updating, synchronizing, branchings, and tagging. I will also go over some terminology to help make things a little more clear. I will be using subclipse as my SVN client in this part of the primer. I find using SVN from within an IDE to be more natural and including directions for both subclipse and tortoiseSVN to be confusing and there is very little difference between the two anyways.

Technorati Tags: , ,

12Oct/091

Taming of the Subversion, a SVN primer; part 1

In my first multi-part tutorial I will give an in-depth primer on how to use Subversion (SVN). Subversion is one of the mostly widely used version control systems in the software development industry. Subversion is based off of CVS and while I haven't personally used CVS I'd imagine the vast majority of what is in this primer can be transferred over fairly easily to CVS. So this primer should effectively prepare you for any version control system you will likely encounter. There are a couple other version control systems out there, but these are the two major players.

Technorati Tags: ,

30Sep/094

6 Steps for fixing any bug

Hate bugs? Yeah everybody does. Here are six steps that should resolve virtually every bug you encounter.

Technorati Tags: ,

30Sep/090

A brief intro into unit testing with JUnit

Learning how to use the built-in IDE debuggers and write unit tests is as fundamental to being a developer as knowing how to write a for loop. These two tools will save you countless hours of frustration and help you write better code. Entire books are written on just these subjects, however today I will just give a simple tutorial on writing unit tests.

Technorati Tags: , , ,

19Sep/092

If, else and nothing else

When I was still very new to programming I had a bad habit of writing bloated code. One of my worse areas was when it came to the usage of If statements. Often times I would write a whole if/else block when I could had just as easily gotten the same results in just one line of code.

Technorati Tags: ,

18Sep/090

Foreach isn’t a reach in pre-1.5

Developers living in the post 1.5 world are spoiled. With the very sweet foreach loop life is easy when you need to iterate through a list of objects. While us poor developers still living working with 1.4 or lower may not be able to totally match the 1.5 foreach loop we can certainly come close! While there are several ways to implement foreach functionality in 1.4 or below I will focus on the way I prefer to do it as I think it is the best way.

Technorati Tags: ,