Perhaps you’ve heard of test-driven development but don’t really know what it is. Or maybe you know about it but you just don’t know why you would ever want to use it. In this article I hope to give an overview of exactly what test-driven development is and why you should consider integrating it into your software development process.
It is important to note that Test-driven development (TDD) is not solely a testing technique, but rather part of a holistic design, development and testing process. The basic idea of TDD is that instead of writing your code first and then writing tests after to ensure the code works, you write your tests first and then write the code that will get all the tests to pass. This is known as a Test-First approach.
There are two generally accepted views on how and why you should practice TDD in your software development. The first view sees TDD as a technique for specifying your requirements and design before writing the actual program code. The second view takes a more pragmatic approach and sees TDD as a technique that helps programmers write better code. Regardless of the view one takes, what TDD practitioners all agree on is that TDD will not only improve your code, but it will also improve the overall design and implementation of your software system.
This is a follow-up to my recent post on SSH Public Key Authentication. I was setting up a remote account with public key authentication so that it would work with my capistrano deployment process. Basically I wanted to be able to run cap deploy and have it execute without needing to type in the password of the remote account. While setting this up I ran into an issue that I thought would be helpful to document, both the problem and the solution.
I set everything up as expected, copying my public key into the ~/.ssh/authorized_keys file on the remote server. However, it just didn’t work. Whenever I tried to log into the server, instead of immediately logging me on, it still gave me the password prompt. In order to dig a little deeper and find out exactly what was going on, I ran the ssh command in verbose mode (adding -v). This showed me that my public key was offered but then rejected:
Do you use SSH to log in to a remote server? If so, do you type your password in every time you log in? Did you know that you don’t have to?
In addition to being more convenient, public key authentication is also more secure since your password is not transmitted over the network. It’s also relatively quick and easy to set up, and I hope the following information will be helpful in that regard.
With SSH public key authentication, instead of using your password to authenticate, it will instead use your public key. Of course the public key is only half of the solution, the other half is your private key. These two keys work together, so that a message encrypted using your public key can only be decrypted with your private key. It is important to remember that you can freely distribute your public key but you must never give your private key to anyone.
Pragmatic Thinking and Learning: Refactor Your Wetware by Andy Hunt is yet another classic from The Pragmatic Bookshelf. This is not your typical programming / technical book, where you focus on a specific technology, methodology or toolset. Instead, with this book you take a much higher-level approach, learning how the brain learns, so that you can be more efficient and effective in all that you do.
As a software developer I have to be continually learning each day. I’m either learning new things about the current programming languages and tools that I use, or else I’m learning new programming languages and tools. It never ends, and that is part of the reason why I love working in this field. It keeps things interesting and exciting, constantly pushing you out of your comfort zone and challenging you to keep progressing.
I found this book to be a great help to this process, as it helps you understand how you learn and thus optimize the learning we do, getting more value out of our already busy schedules.
It’s hard to believe another year has come and gone. 2011 is now just a memory.
Although it is now just a memory, 2011 was a good memory. So many wonderful moments shared with wonderful people.
I find it is important (and accurate) to view each day as a gift. You don’t know how much longer you have left in this incredible thing we call life. And so as another year comes and goes, I find it helpful to think about how I can use the limited time I have. What goals can I set for the coming year?
A couple weeks ago I got introduced to a fantastic app called Day One, thanks to Episode 10 of the Ihnatko Almnanac. It’s a beautiful journal / diary application that is designed to make writing in it incredibly easy. If there is one killer feature that a journalling app should have, effortless entry has gotta be it, and Day One has nailed this.
I must confess that prior to imbibing episode 10 of the Ihnatko Almnanac, the idea of keeping a journal was not even on my radar. However, the episode got me to start thinking about it and the more I thought about it, the more intrigued I became.
As a software developer I work pretty much all day with a computer. During this time I’ll be engaged in various tasks such as writing code, debugging, testing, database design and problem solving. The natural inclination for me is to do all these tasks on the computer. There are so many great software tools available that it’s easy to find something that works for the current task and thus do it all on the screen.
As much as I love working on my computer, I’ve been discovering the power in using a different medium: a piece of paper and a pen (or pencil). There is something about using a pen and actually moving your hand that seems to help me when I’m working through a tough problem. I find it helps tap into the more creative “R-mode” thinking processes.