News for hackers. Stuff that matters.
Re:How deep are your unit tests? by meaty on Monday December 10, 2012 @10:49AM (#4899492)
A 20 page stack trace is the symptom of another problem, not a result of decoupling.
Re:How deep are your unit tests? by jiggy2011 on Monday December 10, 2012 @11:04AM (#4899619)
True, but the most popular method of decoupling seems to be via using an abstraction layer of some kind. At some point you need to talk to a concrete "thing".

It's also difficult to know ahead of time how much abstraction is the right amount ahead of time.

For example, you abstract disk access through an RDBMS but you might want to change DBMS so you abstract that through an ORM. But maybe you want to switch away from RDBMS altogether and go with a NoSQL solution or do everything with message queues or REST APIs? Should you abstract up another level also?

Re:How deep are your unit tests? by meaty on Monday December 10, 2012 @11:17AM (#4899697)
That's vertical decoupling.

Well the point of the abstraction is that you don't care about the contents, hence the term "black box abstraction".

It doesn't matter to the interface consumer what the implementation is, just that it does what the interface says it will do.

Our VFS layer has various backends which can be picked based on the client's requirements and this covers REST APIs, RDBMS and filesystems. There are various depths of stacks and abstractions hiding behind all that but to the consumer, it doesn't matter.

If it blows up anywhere in the stack, we can throw 80 levels of stack right down to the container thread if need be, but we only care about the abstraction at the point of failure.

Re:How deep are your unit tests? by jiggy2011 on Monday December 10, 2012 @11:26AM (#4899761)
True, if all of your classes can conform to the same interface.

When you integrate some third party black box with a different interface you're probably going to have to write at least one wrapper class.

Re:How deep are your unit tests? by meaty on Monday December 10, 2012 @11:41AM (#4899871)
True also. We wrap Amazon S3's client behind our VFS layer.