solnic.eu
Articles tagged with  tdd

Mocking and Ruby

May 22, 2014 by Piotr Solnica

In the “TDD is dead” discussion unit testing and mocking is being mentioned frequently. DHH explicitly expressed how much he dislikes mocks and it seems like many people still connect unit testing with mocking or even confuse the two. In case you missed...


TDD Is Fun

April 23, 2014 by Piotr Solnica

Today DHH published a blog post about TDD being dead (to him at least). It’s really not that surprising since from what I know (please correct me if I’m wrong) David’s experience is mostly based on building web apps with Rails. I get that, I really...


Common Pitfalls Of Code Metrics

January 22, 2014 by Piotr Solnica

Code metrics and code metric tools can be both helpful and harmful. The difference between the two is learning to interpret the results and use the feedback to improve yourself and your code.

I have a lot of experience with code metric tools. Over...


TDD and ActiveRecord in Rails

January 06, 2014 by Piotr Solnica

I don’t have exact numbers but I believe TDD isn’t really popular amongst rails developers. This shouldn’t be a surprise given that the two of the most complex elements in the rails stack, models and controllers, are very convoluted concepts and are...


Mutation testing with Mutant

January 23, 2013 by Piotr Solnica

When working on DataMapper and its libraries we put a lot of effort into testing. Our libraries must have 100% code coverage and even that is not enough. What we want to achieve eventually is full mutation coverage. What is that? If you’ve ever heard...


Yes, You Should Write Controller Tests!

February 02, 2012 by Piotr Solnica

It really surprises me that there are people arguing that writing controller tests doesn’t make sense. Probably the most common argument is that actions are covered in acceptence tests along with checking if views are properly rendered. Right? Right...


Making ActiveRecord Models Thin

August 01, 2011 by Piotr Solnica

“Skinny Controller, Fat Model” is a well known best practice in Ruby community. Everybody seems to agree with it and follows it. It’s pretty clear what a skinny controller is. The question is what is a fat model and what should we do if it gets too...


Custom RSpec-2 Matchers

January 14, 2011 by Piotr Solnica

RSpec is one of my favorite tools. I have literally fallen in love with this fantastic BDD library, especially with its second version. While using RSpec I realized it teaches me how to write tests. Yes, exactly - learning RSpec DSL, its syntax and...