Thursday, November 7, 2013

Notes - Rails Tutorial Chapter 3.2 - Integration Tests vs. Unit Tests

Integration Tests vs. Unit Tests

Unit Tests

A unit test is a test written by the programmer to verify that a relatively small piece of code is doing what it is intended to do. They are narrow in scope, they should be easy to write and execute, and their effectiveness depends on what the programmer considers to be useful. The tests are intended for the use of the programmer, they are not directly useful to anybody else, though, if they do their job, testers and users downstream should benefit from seeing less bugs.   ~ Nathan Hughes

Integration Tests

An integration test is done to demonstrate that different pieces of the system work together. Integration tests cover whole applications, and they require much more effort to put together. They usually require resources like database instances and hardware to be allocated for them. The integration tests do a more convincing job of demonstrating the system works (especially to non-programmers) than a set of unit tests can, at least to the extent the integration test environment resembles production.
Actually "integration test" gets used for a wide variety of things, from full-on system tests against an environment made to resemble production to any test that uses a resource (like a database or queue) that isn't mocked out.

Wednesday, November 6, 2013

Cal Tech & POODR Ch 1 & 2

Yesterday I started re-reading Practical Object-Oriented Design with Ruby by Sandi Metz. I got through half of Chapter 2. I didn't re-read Chapter 1 because I remember the main ideas from it.

Chapter 2 starts out with a bicycle. A good way to start if you ask me. There is talk about gearing. I never really thought that much about this. I put my bike in a low gear for going up the hill and a large gear for going down the hill. But what does that really mean mechanically? Fixed gear people talk about their gear ratios but I always tuned those conversations out because I am too clumsy for a fixie. I do have a single gear bike but I have no idea what the ratio is. It just goes. And the people who have 2 different sized wheels are just taking it to another level that I have previously been uninterested in.

Sandi Metz has made me think about all of this stuff. The most I can say is at least I knew it existed so that is something. 

We are trying to figure out the gear ratio of a bike.