Posts categorized 'Development'
The 3 Step Plan to Getting Your Tests to Run Against Oracle Without Installing the Client Tools
I can't say I know a lot about Oracle, but I do know it's a pain in the arse to get it working without having to install massive amounts of fluff that you don't need. I really don't like builds that have "installation" dependencies. They always trip you up when setting up a new machine, and...
Continue reading "The 3 Step Plan to Getting Your Tests to Run Against Oracle Without Installing the Client Tools"
Introducing PowerYaml
I'm currently working on a project where we will be incorporating a lot of powershell. The scripts rely heavily on some sort of contextual configuration. Not wanting to introduce any more XML into the mix we started exploring YAML as the format for our configurations. I didn't have to research very long...
Continue reading "Introducing PowerYaml"
Smoke Testing The Web With Powershell
Today I finally sat down and really worked on some powershell code. My end goal is to write some code that performs a series of smoke tests on an integration environment. I was hoping to use a unit testing framework that's already out there but I didn't quite like it. I wanted auto registration and execution of all my tests using some simple conventions. Here's what I spiked out:
As of right now, I have 2 files. One is the Test-Runner and it looks like this:
# Fixtures is currently a hard coded path
Get-ChildItem .\Fixtures | % { . Fixtures\$_ }
ls function:test-* |% { Write-Host -fore DarkCyan $_.Name; iex $_}
The first line dot sources all the files in the Fixtures sub-directory. These are the scripts that will contain tests (which I'll show later). The next line gets all the functions that start with 'Test-', writes the name to the console, then executes the function. So I have 2 conventions in place so far. All test functions must have the 'Test-' prefixed to the function name, and all tests must live in the Fixtures sub-directory.
Now I can write some very simple tests like the following:
function Get-Url($url) {
Trap { Write-Host -ForegroundColor red Could not access webserver: $_.Exception.Message; Continue }
$wc = New-Object System.Net.WebClient
$wc.DownloadString($url)
}
function Assert-Url($url, $pattern) {
Write-Host Making HTTP request to $url
if (Get-Url $url -match $pattern) {
Write-Host -ForegroundColor green Success
} else {
Write-Host -ForegroundColor red Failure: Response from $url does not match `'$pattern`'
}
}
function Test-PassingTest() {
$test_url = "http://scottmuc.com/blog/development/getting-my-build-and-release-on/"
$expected_response_pattern = 'Getting My Build and Release On'
Assert-Url $test_url $expected_response_pattern
}
function Test-FailingTest() {
$test_url = "http://scottmuc.com/doesnotexist"
$expected_response_pattern = 'not important'
Assert-Url $test_url $expected_response_pattern
}
Here you can see that I have two helper functions and two tests. The passing test asserts that a certain url contains a particular regular expression, and the failing test hits a non existent page. When executing the Test-Runner here's the output:

My next set of assertions will be to check for Windows Services running on remote servers. I can already see that it's going to be quite easy to setup those tests.
Continue reading "Smoke Testing The Web With Powershell"
Getting My Build and Release On
So it's been a long time since I've update this here ol blog. It's been an intense 4 months and there's so much to discuss but it's too late for all of that. For now, I'm going to provide a snapshot of what I'm doing right now. I'm afraid this post is inspired by 30 minutes on the eliptical and a recent viewing of Lord of the Rings.
I am priveleged to be a part of a fairly new offering by ThoughtWorks. The project is for a large telecom and I am part of the Build & Release team.
What is Build & Release
The release aspect of software is a world that many companies do not know how to do well. Heck, even the documentation on releasing software is unknown and is a domain that has been a hot topic as of late. It's one thing to build software, it's another challenge actually pushing the system to production (and repeatedly and reliably).
Right now I'm working with a brilliant group of ThoughtWorkers providing guidance to a software project of over 150 people and over a dozen project silos which need to eventually integrate with each other.
How/Why did I get on the team?
Because the acronym is BAR! Kidding of course. I actually resisted the push to go on this team. I'm a developer and that's what I wanted to do. Or so I thought...
In a lengthy e-mail I revealed to a friend that I might be missing opportunities to utilize my strengths. I reflected on the fact that I played with computers for 10 years (not my strength) before I even started programming! What did I do instead? Figured out how to tweak DOS to get my games to freakin run! I unintentialy became a pretty good troubleshooter. I even started building computers and selling them on the side, and learned how to figure out hardware issues as well. Even when coding, some of what I enjoyed the most was debugging complicated bugs. Figuring out a memory leak in the CBC Radio 3 metadata service using memory dumps was a memorable accomplishment.
How does that relate to build & release? Almost all my tasks will be related to things not working right and figuring out what's gone wrong. I won't be writing one iota of code that delivers business value, but I'll write code that's fun and challenging nevertheless.
What's my role?
Here's where the Lord of the Rings comment comes in. For the last few weeks I haven't actually done much. I sort of feel like Gandalf in that he really didn't do much either. His role was not to take down the Dark Lord (I dare not say his name) himself, but to organize multiple different roles and make them work as effectively as possible. Occasionally he would drop hints like telling Aragorn to go through the Paths of the Dead.
Ok, I'll drop the analogy before it becomes too nerdy, but the reason I compare myself to Gandalf (not just because he's awesome) is because I feel like my presense on this project is to be an influencer. To bring people on separate projects to talk to each other because they may have a common problem. To observe system wide issues and bring people together in an open forum to discuss them (Council of Elrond?).
In the last few weeks I've build relationships with the other teams and am proud to say that I may even influence how they do things. If anything, I got them vocalizing their problems a lot more so that we on the B&R team and tackle them before they become massive integration issues.
I'll probably be at this for a bit and will eventually dive into stuff that's more technical; I started writing PowerShell scripts today for example, but my role still as a support person. It's going to be an interesting year.
Continue reading "Getting My Build and Release On"
Help Me Become a Keyboard Ninja
A couple months ago I posted my new years resolutions and one of them was to be more proficient in mouse-less computing. It's hard to get motivated on your own to do this and the best way I've become better is by pairing. A pair partner is always good at reminding you that you are using the mouse a lot...
Continue reading "Help Me Become a Keyboard Ninja"
Installing ADT Plugin in Eclipse 3.5.1 (Galileo) on Ubuntu 9.1
I just picked up an Android powered phone and hit a roadblock getting my environment set up. Googling the error didn't come up with anything useful so hopefully this helps a few people out. Since it's been ages since I've done anything in Java I needed a checklist to help me get started. I found this...
Continue reading "Installing ADT Plugin in Eclipse 3.5.1 (Galileo) on Ubuntu 9.1"
My Developer Resolutions For 2010
Well, I did one of these last year and it helped give me some focus thoughout the year so I'm going to try it again. First off, here are some follow-ups to my resolutions of last year: Learn A New Build System - Learning a new build tool is not really something that you set out to learn I guess. The...
Continue reading "My Developer Resolutions For 2010"
Contextual Lessons in DDD
Agile Vancouver is nearly over and after the bus ride home I had a great real world example of where Eric Evans' discussion on contexts in modelling was quite apparent. On my CBC messenger bag I have some buttons from some music artists I like. One of the buttons is for an artist named Ben Lee and the...
Continue reading "Contextual Lessons in DDD"
Introducing Secretary.Net
Like most OSS (Open Source Software), the creation for Secretary.Net was the result of the major pain I was having with my current work. The CBC Radio 3 website is very file and context heavy. The idea of a path to an image is meaningless without context. Is it the image for an Arist? How about a Concert...
Continue reading "Introducing Secretary.Net"
Riding The Lines-Of-Code Rollercoaster
"Atkinson [ed: Bill] had just completed rewriting a portion of the Quickdraw code, making it more efficient and faster. The new version was 2000 lines of code shorter than the old one. What to report? He wrote the number -2000" -- Rosenberg
I couldn't help but smile when I read that. I have felt that some of my best coding successes are when I eliminate lots of code. This probably pushes Test Driven Development (TDD) as a great practice even further. Lately I've been a bit stricter by doing TDD. This means that I'm writing a lot more code, but as I get my tests passing I start refactoring and remove much of the code that's written. For every couple hundred lines of code I write, I eventually remove 50-80% of it as I glean knowledge from all the code I previously wrote.
It appears that LOC Rollercoaster development is an artifact of TDD and it's a great ride!
Continue reading "Riding The Lines-Of-Code Rollercoaster"
