The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
My Apprenticeship - Tuesday, August 3, 2004

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jake Scruggs

Posts: 336
Nickname: aurorae314
Registered: Feb, 2008

Jake Scruggs is a developer at ThoughtWorks
My Apprenticeship - Tuesday, August 3, 2004 Posted: Aug 3, 2009 5:11 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jake Scruggs.
Original Post: My Apprenticeship - Tuesday, August 3, 2004
Feed Title: Jake Scruggs
Feed URL: http://jakescruggs.blogspot.com/feeds/posts/default
Feed Description: Ruby, Rails, Metrics, Testing, and pursuit of clean code.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jake Scruggs
Latest Posts From Jake Scruggs

Advertisement
This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

Tuesday 8-3-04

Other than a little bit of time spent with Micah explaining Word Press to Bob, I was able to code all day. Whoo! Some hints from Micah yesterday and a lot of trial and error today led me to finally get the hang of testing methods that rely on user input from the keyboard. When the program is really running, I pass in a regular old keyboard InputStream (System.in) to my userInput method. However, in a test, I can load up a ByteArrayInputStream with all the values I want entered (separated by newlines, of course) and then every time a function I'm testing calls for a user input it gets my preset values instead. Which is pretty darn cool.

Of course this took a large chunk of the day to get it working exactly how I want. Java IO can be a wee bit tricky. The rest of my time was spent applying the finishing touches to my long-neglected TDD Tic Tac Toe game. Should be ready for prime-time tomorrow.

Speaking of tomorrow, I'll be taking a class with James Grenning: Test Driven Design and Refactoring. Unit testing has been interesting, but I'm itching to see how FitNesse extends things. Since the paying customers want the class in C#, there's a good chance that I'll revisiting Microsoft Visual Studio. We gotta get Jet Brains' add-on installed soon because life is unpleasant without refactoring tools


When I applied to ThoughtWorks I used the trick I learned above in my coding submission to test input from the command line. Later on when I got hired I asked to see what people said about my code and one of the comments was "Some of the things he tested would never fail." First of all -- the anonymous reviewer was right. One can reasonably assume that core Java IO will work and so it doesn't have to be tested in your application. But second -- it was pretty cool to see that I had tested way more than a ThoughtWorker thought was necessary.

Read: My Apprenticeship - Tuesday, August 3, 2004

Topic: Comparing the performance of IronRuby, Ruby 1.8 and Ruby 1.9 on Windows Previous Topic   Next Topic Topic: Git and GitHub: A Revised Course

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use