About
Buy my book
Exceptional Ruby is the definitive guide to exceptions and failure handling in Ruby.
Pages
Categories
Tag Archives: tdd
Early access beta of “Objects on Rails” Now Available
Often, at conferences and users group meetings, I find myself discussing the intersection of Ruby on Rails, Object-Oriented development, and Test-Driven Development, and I’ll mention something like “I prefer to develop my business objects first, and add ActiveRecord in later”. This usually leads to … Continue reading
Making a Mockery of TDD
I made this gnomic remark on Twitter the other day: To be a successful mockist, you must dislike mocks. A lot of people re-tweeted it, so I guess I’m not completely alone in thinking this way. I should back up … Continue reading
5 things programmers preach but don’t practice
I’m having a frustrating day of merge hell. Just to blow off some steam while specs run, here are some things that, in my experience, are a lot more common in theory than in execution in proprietary software development projects. At … Continue reading
Posted in Rants
Tagged bdd, refatoring, Revision control, scrum, tdd, Test-driven development
55 Comments
Demeter: It’s not just a good idea. It’s the law.
Is #try really so bad? In response to my recent post about #try being a code smell, a lot of people made the reasonable objection that the example I used—of using #try on a a Hash—was a pathological case. A … Continue reading
Posted in Ruby
Tagged bdd, coupling, demeter, design, law of demeter, objects, oo, oop, ruby, Ruby on Rails, structural coupling, tdd, testing
67 Comments
Linkdump #8
Scriptensity: Emscripten 1.0! This is the first I’ve heard of this project: it’s an LLVM-to-Javascript compiler. Which means you can (for instance) compile C++ to Javascript. I can’t decide if this is amazing or just batshit insane. Probably both. tags: … Continue reading
Posted in Links
Tagged http, javascript, llvm, ruby, spdy, static analysis, tcp, tdd, test-unit, testing, yield
Leave a comment
Linkdump #7
Hacker Chat: Pinboard Creator Maciej Ceglowski Talks About Why Boring Architecture is Good, and More Wise words. tags: development I think many developers (myself included) are easily seduced by new technology and are willing to burn a lot of time … Continue reading
Posted in Links
Tagged architecture, bdd, java, javascript, literate programming, logging, nodejs, rails, rspec, ruby, tdd, testing
Leave a comment
RSpec is for the literate
A couple years ago I wrote a library called AlterEgo. It’s an implementation of the State Pattern for Ruby. I consider the library to be retired at this point—other libraries, such as State Machine and ActiveModel, have since incorporated all … Continue reading
Roy Osherove on Test Construction
It’s quite easy to get caught up in the technique of TDD and not pay attention to the way unit tests are written: their naming, how maintainable or readable they are, and whether they test the right things or might … Continue reading
TDD Accelerates Development
Periodically, well-meaning Agile advocates will make the argument that practicing Test-Driven Development trades development speed for better quality. That is, it slows you down but it’s worth it because the resulting code is better. Rubbish, I say. TDD makes me … Continue reading
Testing Private Methods
Periodically the question of how to test private methods comes up at work or online. My answer is: don’t. It may seem trite, but there is some reasoning behind it. Private methods are, by definition, implementation details. If you are … Continue reading
