加载中...

Ruby

  1. Home
  2. Computing & Technology
  3. Ruby

What is Test-Driven Development?

While Test-Driven Development isn't exactly the same thing as Extreme Programming, it's related to it. Here's how it works: Write a test that fails, write code only to pass that test, validate it passes and refactor.

All About Test-Driven Development

Amanda and Michael's Ruby Blog

This Week's New Releases

Friday January 16, 2009

There are a few notable database-related releases this week, as well as an interesting project to replace grep with a Ruby implementation.

  • Amalgalite 0.6.0 has been released. Amalgalite embeds the entire SQLite database library into a Ruby extension. Though you still need a C compiler (or a gem with a native build, and yes, there is a Windows build) to install this, it will eliminate any platform-specific packages. It might sound odd, embedding and entire library into a Ruby extension, but this is really what SQLite was designed for. SQLite is extremely small and provides multiple ways for you to embed it into your programs. SQLite itself also has no dependencies other than an ANSI C compiler, so Amalgalite should be quite easy to install on any system.

  • Sequel 2.9.0 has been released. Sequel is a complete database abstraction, including DSL for database schemas and queries as well as a small ORM layer. It also has a modular database backend, and will work with most popular databases MySQL and SQLite.

  • Grepper 0.9.3 has been released. Grepper is an interesting tool, which aims to make a GNU Grep type tool you can use from your Ruby programs. You can grep any file for a string, and returned will be not just a list of lines, but their line numbers. Also included is a grep.rb command-line tool that mirrors the GNU Grep tool, with many of the same command-line options.

Interviewing Mike Gunderloy & Matt Aimonetti: A Closer Look at Rails Activism

Tuesday January 13, 2009

When the Rails Activist team was announced earlier this month, it set the Ruby on Rails community abuzz and questions abounded: Who are the Rails Activists? Why create a core team to facilitate community outreach? What's their role?

Who better to answer these wonderings than some of the core team members themselves? Recently, I had a chance to ask Mike Gunderloy and Matt Aimonetti, two of the core team members, some questions about the genesis, purpose and direction of the Rails Activist team. Here's what they had to say.

What is Test-Driven Development?

Monday January 12, 2009

You may have heard of Extreme Sports, but Extreme Programming? While Test-Driven Development isn't exactly the same thing as the methodologies used in Extreme Programming, it's related to it. Using TDD can help you focus and not get carried away when writing code.

Getting carried away when writing code can have a number of consequences. First and foremost, you're writing code that you don't need which just wastes time and money. Secondly, it makes the code you do need more complex. Thirdly, it makes dark little corners of code that are rarely branched to that, if they have any bugs, will really throw a wrench in the gears weeks, months or even years later. Test Driven Development aims to prevent this from happening altogether.

This Week's New Releases

Friday January 9, 2009

One big release this week, and not many small releases. The big news is Ruby 1.9.1 RC1 has been released. This is the first release candidate for version 1.9.1, so that means 1.9.1 is just around the corner. But why is this big news?

Version 1.9.1 is big news simply because it's the first stable version in the 1.9.x branch. Version 1.9.1 runs Rails, many of the plugins and some of the gems and will be in use very soon. 1.9.1 is the opening of a new chapter for Ruby. The most important improvement over the 1.8.6 and 1.8.7 branches is a brand new execution environment, the YARV bytecode interpreter. This means faster execution time for no extra work, it's all done behind the scenes.

The switch to 1.9.1 is not all good news though. Since 1.9.1 breaks some code written for 1.8.6 or 1.8.7, some gems, Rails plugins and application code will need to be fixed up. As it stands right now, running 1.9.1 is pretty disappointing if you use a lot of gems (and who doesn't?). The question is, are the gems still being actively maintained and will they be fixed for 1.9.1 in the near future? But, if anything, this just highlights the need for more test-driven and behavior-driven development. Running the tests will let you know for sure if there are any incompatibilities with 1.9.1. Without tests, one can only assume a certain piece of software is running correctly, only to have some bug come back to haunt them in the coming months.

In other news, HTTPClient 2.1.3.1 has been released. Just last week, 2.1.3 was released, but this is an important upgrade as 2.1.3.1 was released to fix a security vulnerability. The vulnerability may cause HTTPClient to send cookies from secure sites to insecure sites. Everyone is encouraged to upgrade, even if you don't use cookies or HTTPS sites.

Finally, Rack 0.9 has been released. Rack is a kind of middleware program. Instead of writing code to teach every Ruby web framework out there to interface with every web server out there, Rack takes care of this. Rack reduces the amount of code duplication in frameworks and makes them easier to write.

Discuss

Community Forum

Explore Ruby

More from About.com

Ruby

  1. Home
  2. Computing & Technology
  3. Ruby

©2009 About.com, a part of The New York Times Company.

All rights reserved.