Skip to main content

Posts

Showing posts with the label Testing

Where do you test your code?

I've been thinking a lot about the "it works on my machine" issue. We seem to build up and take care of our development environments or virtual machines (VMs). They have a state, mostly a non-deterministic state after being maintained for so long. The idea of spinning up an environment just to test some code would have been infeasible until recently. I do enjoy using VirtualBox , I've been using it for years. I didn't know that it could be used to automate the deployment of virtual machines. We have developers and devops in the office looking into Docker for this task, but I'm quite comfortable with virtualisation and I thought that I would see if I could use virtualbox (or KVM) for this. I discovered that Vagrant is a wonderful tool for this automated creation, provisioning and clean up of VMs for development and testing. I've only used Vagrant for 1 week, but I'm enjoying it so far. My PC at work is fairly old and slow, but even so, I can s...

Unit testing

Unit testing is extremely useful. I'm working through this excellent guide : Pragmatic Programmer: Unit Testing in Java with junit I have yet to find any good websites for junit, but the book is great. I've had a lot of success in some small projects, using NetBeans 6.1 to generate empty tests for each class member. Then you go and fill them in. It's helping me to refresh my memory about the code and great to think of new ways to test the code and new ways to write the code.