word = unit test, sentence = integration test

I was trying to explain to a manager the difference between unit testing and integration testing.  I used a few different styles for explaining, but one jumped out at me as “have to blog about that one.”

The Analogy

  • unit tests represent testing a word
  • integration tests represent testing a sentence

Why this works

If you use spell a word wrong, you have no hope of your sentence being correct.  The words are the units.  If you use the words in the wrong order or are missing a word or use the wrong word, your sentence is not correct.

It also shows why both unit tests and integration tests are needed.  With just unit tests you won’t know that “cat my hair ate the” is wrong.  After all the individual units are correct.

With just integration tests, it is a lot more work to know everything is correct.  While it is possible to test the entire sentence in one shot for spelling correctness, it is hard.  As humans we spell check one word at a time even if we don’t realize it.  That’s why “coding is fun” is faster to spell check than “codingisfun”.

Conclusion

Thoughts on this?  I don’t remember reading this idea anywhere, but I may have read it and forgotten it.  If anyone knows where it came from, feel free to post that as a comment.

why do i blog?

.. and I could not think of any reason why I would want to give free information to the anonymous general public.

I asked a colleague if he had a public blog and this quote was from his answer.  (used with permission.)  We both blog at work so I was a little surprised to hear that.  I thought about replying, but it makes a perfect blog post.  So here we are.

Why did I start blogging?

I’ve been posting at JavaRanch/CodeRanch since 2003.  I had thought of starting a blog but didn’t feel I would write often enough to warrant one. In 2008,  Scott asked me to be a contributing author on his blog, selikoff.net.  Fifteen months ago, he invited me as a co-author.

Why do I enjoy blogging?

I like to write.  I like to share knowledge/ideas/information.  I still don’t write often/regularly enough here to warrant having my own blog.  But that’s ok.  Scott and I provide a nice balance and variety of topics.  I even got an iPad so I add Apple topics too.  I also have an internal corporate blog which I write to about twice a month.  I use this one for my general information/JavaRanch projects/robotics topic.

What do I get out of blogging?

Pretty much the same things I get out of JavaRanch:

  • the opportunity to share information – I noticed very little information on the Core Spring 3 certification so I added a lot after I took the exam.
  • the opportunity to help others struggling with a problem – I encountered some surprises while setting up the BlackBerry simulator so I wrote about it to help others.
  • the opportunity to get feedback on ideas – or give.  One of our top five blog posts of all time is my reply to Kathy Sierra‘s tweet stream about female programmers.
  • the opportunity to interact with other strong technical people in the field
  • the opportunity to get corrected in a “safe” setting (it’s not like work where you are going to get in trouble for taking a risk) so I can learn more
  • a place to post things I know multiple people will ask me so I don’t have to keep writing answers to the same questions – whether it is a tool choice for Subversion or why you need to defend the code, it is write once and read thousands of times.
  • respect as a strong technical person
  • surprise opportunities that I never would have expected like quoted on the back cover of EJB 3 in Action, being a reviewer on the OCPJP certification book and being a speaker at the upcoming Server Side Java Symposium (extra $200 off with the code listed here.)

I wrote this list as a stream of consciousness thing and then went back to add examples.  I’m pleasantly surprised how many times I used the word opportunity.  I was also excited to see that each thread I linked to as an example has at least two thousand hits.

Why the quote surprised me

A few key words jumped out at me.  Let’s look at them one at a time.

  1. “free information” – Have you ever googled an error message?  Many of the hits that come up are blogs or message boards.  Granted some of them are people who are paid by Oracle/IBM/etc to be there.  But most are not.  They are people sharing free information.
  2. “anonymous” – Networking is all about talking to people you don’t know.  In the real world, you walk into a room and there are many people who quietly listen.  Which is fine.  Then there are the leaders who make things happen.  You get to meet more of those people if you are contributing information to the larger tech world.
  3. “general public” – Having those connections to people I don’t work with is incredibly valuable.  This is more so for JavaRanch than this blog.  Although I do think the amount of reputation/goodwill I have built up come from both.  When I am stuck on something, nobody I work with knows what to do and I really need help, having those contacts is priceless.

Culture differences

I work for a bank where intellectual property comes up as a term.  I am very careful not to let any work information/projects leak out.  (That’s why I have a work blog; for the things I can’t make public.)  Sometimes I’ll play with a tool/technology at home first so I can blog about it here.  Or sometimes I’ll play with something home because I want to try it out before a conservative place like a bank gets to it.

I do understand the feeling of not sharing information with the “outside world”.  But that’s for information that my employer owns or pays me to learn.  For things I do on my own time, why not?

Conclusion

I enjoy blogging/information sharing and I look forward to continuing to do so.

Getting my iPad ready for FIRST robotics season

Last year, I started volunteering as a programming mentor to the Stuy Pulse FIRST robotics team.  Since kickoff was yesterday, I set up my iPad today for this season.  At least the beginning of it; I’m sure I’ll have more ideas as the season goes on.

Background

The internet isn’t too reliable in a New York City high school.  There is (usually) wifi, but it doesn’t always work.  It’s also proxied through the Department of Education which doesn’t allow things like SVN or GIT connectivity.  Luckily one can at least view files through a browser.  There’s also way more team members than computers causing a lot of crowding around the screens.

What I set up

Use case Details Apps used Impressions so far
Skim game manual as soon as it is released and refer to it during discussions. Before kickoff, I downloaded the encrypted game manual and stored it in my dropbox for offline use DropBox

GoodReader ($2.99)

Positive

It worked.  GoodReader let me type in the password.  I was able to look up everything I wanted and a student on the team also referred to my iPad.  Also positive was the fact I had a cached copy, because usfirst.org promptly crashed right after the announcement of said password.

Negative

GoodReader doesn’t cache the password.  Even if you don’t close the app and your iPad locks, you get to type the password in again.  Which wouldn’t be so bad except the password was “5Time4For3Robots2to1Dance!”.  Nice and easy to type in on an iPad, right?

Be able to blog from the iPad There are some lulls when the programmers are waiting for use of the robot.  I want to be able to do other things during this time besides try to surf the net on a tiny BlackBerry. WordPress I’m very impressed  so far with the WordPress app.  I wouldn’t want to publish directly from the iPad because it is hard to type with 100% accuracy.  WordPress saves what you write as a draft accessible by both the iPad app and the regular internet.  This means I can patch up what I wrote in my browser before publishing.
Download the unencrypted game manual Entering the password repeatedly as been a royal pain.  I downloaded the unencrypted manual from a mirror (that grabbed it before the site went down). Dropbox

GoodReader ($2.99)

Very routine.  I deleted the encrypted file from my dropbox, added the unencrypted one and moved on.  The only snag was GoodReader still had the encrypted one open.  Closing GoodReader and reopening it, solved that.
View WPI Javadoc offline Unsurprisingly, we used the JavaDoc a lot last year.  It would be nice to reference it without competing for computer use with the person currently programming. DropBox

JDoc Reader ($3.99)

JDoc Reader was easy to set up.  I transfered a zip file with the JavaDocs via DropBox and chose “open in” JDoc Reader.  JDoc reader than imported it and provided a nice GUI for use.  I like that JDocReader lets you import any JavaDocs since these aren’t common ones. (Most JavaDoc readers I found were for specific docs.)  I didn’t download the JavaDocs for Java itself, but I will if we find we need it.
View WPI Python offline We are trying out Python as well this year.  The Python “API” is really just a large text file. DropBox

iUnArchive ($1.99)

Text Viewer (built in)

It’s awkward to open such a large text file.  Text viewer does it, but I’m still trying to get the hang of this.  (Will update this post when I learn how. For now it is a question)
View git This year we are using git instead of subversion.  (good idea since we can’t commit realtime) GitHub Viewer Lite Positive

The install was easy.  I entered my github username/password and it linked to my repositories and the like.

Negative

I was hoping I could save some files for offline viewing.  This doesn’t appear to be possible.  Not too important since team members will have checked out from home and have local copies of the repository on hand.

And of course, I have twitter etc already.  I actually had all of these installed except JDoc Reader.  I listed the ones with direct relevance to robotics.

I also probably need to add some manuals to DropBox.

Conclusion

Some of the students bring their own laptops so I expect the docs to be present.  This makes it easier for me to reference them.  And provides another copy for team members to use.

Note: followup posted