RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Technical Error in Sandi Metz Rails Conf 2016 Presentation

See how Sandi Metz commits one of the TDD beginner’s mistake in her RailsConf 2016 - Get a Whiff of This presentation.

Comments

It is the collaborator that is stubbed, Foo behaviour is «return the output of collaborator’s total method» Inner workings of collaborator object are, and should be, irrelevant to test Foo.

And it is an example, for a talk, so it is simplified, and seemingly contrived, to save you reading 50 lines of code out of the point being made, on a slide.

If you consider this an error, you don’t understand isolation or what a Unit Test is, and should read about it (I would dare to recommend you http://poodr.com), learn, rewrite your «unit» tests, publicly apologize to Mrs Metz, and meditate on how not to embarrass yourself in public in the future. If you were a nice person the polite thing to do is write privately to the author, so they can, if they are indeed wong, amend themselves.

By going witchhunt-angry-mob on this, what you achieved is two prove two facts at one, that you not as good a programer as you think of yourself, and most important, that you are a bad person.

Still, there is a problem with her test. You want exactly one test to fail for any given bug. This test will fail if you change 47 to any other number, string, nil or anything else. The emphasis of the current test is not on whether the message to total was sent or not.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in