Wednesday, May 21, 2008

Story Driven Development

If you are interested in testing and the TDD/BDD movements, then you may find Bryan Helmkamp presentation on "Story Driven Development" worth watching. Bryan explains the differences between unit testing and scenarios. He also shows Webrat, a tool he works on, which makes defining stories in Rails apps very easy.

I like the title that Bryan has chosen for the talk. The name "Story Driven Development" makes it clear that it's a lot about defining requirements, and not only about testing. Additionally, I think it's clear that it focuses on the acceptance level of tests without mentioning unit tests.

He also provides a quote from Robert Martin:

Unit tests: “Make sure you write the code right.”
Scenarios: “Make sure you write the right code.”

You can watch the slides here, or grab the PDF version (which has correct code examples).

Tuesday, April 8, 2008

Google App Engine and dynamic languages

Google has launched Google App Engine. It's a big news. But look at this:

"Although Python is currently the only language supported by Google App Engine, we look forward to supporting more languages in the future."

You see, Python is their first choice as the main language for Google App Engine. It's not that surprising, Google is known to be a Python company. I'm pretty sure that Java, .Net and Ruby support will be available very soon as well. I wonder when will be the first time that some of the Google (or other companies) services are available only with dynamic languages.


What is my point here?

If you are serious about your career in IT then you have to start learning how to develop software with dynamic languages.


Python or Ruby seem to be good candidates. If you ask me - if you come from .NET world go for IronPython, if you come from Java choose JRuby. That's a good start. Good luck!

Wednesday, April 2, 2008

BDD examples with user stories and Webrat

This is the best BDD explanation I have ever seen. It explains all the philosophy behind BDD, shows how it fits with RSpec stories, and how you can use Webrat to create a high-level integration test. It even shows how to use Selenium with RSpec stories!

Integration Testing in Ruby with RSpec's Story Automation Framework by David Chelimsky

Big thanks to David Chelimsky!

Thursday, March 27, 2008

Going to Euruko 2008?

Oh, how I love the conference season!

After attending the SFI conference in Krakow (which was great, BTW!) I'm ready to go to Prague.I'm going to be at the Euruko 2008 conference. Their program looks really interesting! All things that I like: Ruby, JRuby, testing. Hey, there's even a talk about AOP in Ruby!

I'll be in Prague from Friday afternoon till Sunday evening, and I'm always happy to chat about Rails, TDD, Agile, JRuby.

I'll try to comment about the conference on my Twitter. Peter Cooper is also going to update his twitter. Any other Twitterers in Prague?

See you in Prague!

Andrzej's Rails tips #9

link_to_remote and GET request

If you're working with link_to_remote and you are surprised with a message like the following:

Only get, put, and delete requests are allowed.

then you just need to know that link_to_remote uses POST request by default. All you need is to do is to add :method => :get to the method call.

Use schema.rb to create a new database

Keep the schema.rb file in your Subversion/Git/Mercurial repository and make sure it's up-to-date. It's very useful when you want to create a database without using migrations. You just call rake db:schema:load.

As the documentation states:

"Note that this schema.rb definition is the authoritative source for your database schema. If you need to create the application database on another system, you should be using db:schema:load, not running all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations you'll amass, the slower it'll run and the greater likelihood for issues)."

Monday, February 25, 2008

Andrzej's Rails tips #8

Resource controller and 'new' action

If you want to refer to the 'new' action using resource controller, you have to use the 'new_action' method.
BTW, if you want to do the same operation before both 'new' and 'edit' actions in a resource controller, you can do it like that:

[new_action, edit].each do |action|
action.before { @product_types = ProductType.find(:all) }
end

Migrations and removing defaults

If you have some default values set on some columns, then you can remove them using ':default => nil'.
Like that:

change_column :users, :name, :string, :default => nil