Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« Unit Testing at TechEd Israel 08 - Which talk would you choose? | Main | Scala, NRehersal and Fluent Test Interfaces »
Saturday
Jan122008

Refactoring private methods is like...?

I'm still struggling away with my book, and was wondering what you thought about this analogy.

I am referring to the problem of testing private\public method, and in that regard I refer to the ease of changeability of private vs. public methods and the contracts they assume of the interacting party (reader\developer\code)

Refactoring methods is like refactoring a book chapter.

In a way, changing a private method is like changing a few sentences in a book chapter. The full chapter still may read exactly the same, but the way it is being delivered may change.

Changing a public method is like changing the chapter’s title I the book. You really want to make sure that you’re not hurting the overall feel and content of the reader.

 

It feels OK to me, perhaps a bit contrived, but what do you think? what is refactoring private\public methods analogous to?

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>