Integration Testing

Programming Is Like Sex

because...

  • One mistake and you have to support it for the rest of your life. (Michael Sinz)
  • Once you get started, you'll only stop because you're exhausted.
  • It often takes another experienced person to really appreciate what you're doing.
  • Conversely, there's some odd people who pride themselves on their lack of experience.
  • You can do it for money or for fun.
  • If you spend more time doing it than watching TV, people think you're some kind of freak.
  • It's not really an appropriate topic for dinner conversation.
  • There's not enough taught about it in public school.
  • It doesn't make any sense at all if you try to explain it in strictly clinical terms.
  • Some people are just naturally good.
  • But some people will never realize how bad they are, and you're wasting your time trying to tell them.
  • There are a few weirdos with bizarre practices nobody really is
    comfortable with.

I Spec, You Spec, We RSpec!

I love testing, I could hardly wait for this meeting of the Chicago Ruby Group. I was not disappointed. Unit tests are cool, but specs are awesome. Whats the difference you say? I think its a more natural way to write your tests, it makes you think of the behaviour of your object and not "oh gosh, I have to write 3 tests for each of my methods."

Ruby on Rails makes nice with PHP

Not all projects can jump ship from a home grown PHP site to Rails, especially projects where there are exactly 1.3 programmers for the project. I was surprised there wasn't much information on integrating php and rails site (spare me the flame wars). All new development will be done in Rails and old PHP will be written in Rails as time permits. I was exploring some of the ways that this could be possible and what possible problems might arise.

Sessions
I will need to read certain sessions variables from PHP into Rails, I will not need to write to the session. I found a ruby script PHP Serialize which takes a php serialized string and converts it to a Ruby datatype. If your sessions are stored as files, they are in /tmp/sess_[session id] where session id stored in $PHPSESSID they contain a special serialized string. Ruby can get the session id from the cookie and read the file, and PHP Serialize will convert it into an object. If your sessions are stored in a database, then of course you'll be able to create a Rails model to access it. If you need to write to a php session, then I think it would be better this way. I didn't try using sessions stored in a database, because I use files. I’m not sure how you would do it stored in memory. In any case, reading from the session file I believe is a temporary hack at best.

Where do your responsibilities end?

For those of you who don't know, I live in the Washington, DC Metro area.
For those of you who don't know, snow - ANY snow - completely terrifies and paralyzes the city.

While I was watching the news this morning, I caught an interesting quote. In DC and parts of Maryland, homeowners are *required* to shovel the sidewalks in front of their houses. If they fail to within a certain number of hours, they get a bill from the city for the shoveling along with a $25 fine. While this isn't huge, I thought it was fascinating that although you are allowed to exert no control over it, you are still responsible for the sidewalk's condition. Sounds quite a bit like programming against third-party systems, huh?