Test Driven Development Tutorial Roman Numerals

This tutorial generates a Ruby function to convert any low natural number into a Roman Numeral.

Writing the tutorial caused a couple false starts. TDD is no perfect algorithm generator. Like all hill-climbing algorithms, starting with the wrong abstraction can often make the right one harder, not easier, to climb to. I had to start three times, each time solving “II” a different way, before the algorithm clicked in.

The code to pass the test must be the simplest possible, but the refactoring, after the test passes, must then be very aggressive.

The refactoring here leveraged two simple rules: Make things look similar, then put them next to each other, then make them the same. That practice forms little tables, which eventually become real source tables.

Following those rules as closely as possible allowed a better algorithm to emerge.

The tutorial methods are brief enough that should provide an animation of the code squirming around.

More on TestDrivenDevelopmentTutorialRomanNumerals

This entry was posted in Technical excellence. Bookmark the permalink.

98 Responses to Test Driven Development Tutorial Roman Numerals

  1. Roberta Galinoo says:

    it was this type of fine write-up. My business is actually getting excited about the subsequent submit.

  2. Medical Jobs says:

    This is such a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a prime resource for free. I truly loved reading your post. Thanks!

  3. computer running slow says:

    Test Driven Development Tutorial Roman Numerals | Lean Labs: Fab article, this is one of my favourite subjects and obsessive about. LOL. I like keeping up to date on all things new so I will be book-marking this page. Maintain the amazing work!

  4. Underground Online Seminar 007 Review says:

    Loved reading this. Keep it up!

  5. Sterling Bullman says:

    Aw, it was an incredibly wonderful posting. In suggestion I’d like to put in writing this way furthermore 鈥?taking time and real work to create a very good article鈥?however what can I say鈥?I procrastinate much and certainly not seem to get something achieved. Mobile Shelving Spider Legs

  6. Best Way to Lose Weight says:

    I really enjoy reading your posts. :) I am going to bookmark your blog. I hope you will continue to update!!!

  7. Interesting says:

    Hi! I just want to tell you that I found this blog really useful to me. I will visit this blog regularly to read more. Thanks.

  8. Interesting says:

    Hi! I just want to tell you that I found this blog really useful to me. I will visit this blog regularly to read more. Thanks. srt1307468346

  9. Interesting says:

    Hi! I just want to tell you that I found this blog really useful to me. I will visit this blog regularly to read more. Thanks. srt1307468569

  10. washington dc map says:

    That is the suitable weblog for anyone who desires to find out about this topic. You understand a lot its almost onerous to argue with you (not that I truly would need…HaHa). You definitely put a new spin on a subject thats been written about for years. Nice stuff, simply nice!

  11. ธุรกิจออนไลน์ says:

    Oh! I that This single site very the ultimate. Them made i have knowledge. It is the Web site that with very much knowledge. I am felt well that has come by this site Thanks a lot and I am would stop to visite to this webs often thanks.

  12. map of dc says:

    Oh my goodness! a tremendous article dude. Thanks Nonetheless I’m experiencing concern with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting equivalent rss downside? Anybody who knows kindly respond. Thnkx

  13. map of washington dc says:

    There may be noticeably a bundle to find out about this. I assume you made certain good factors in features also.

  14. map of dc says:

    An impressive share, I just given this onto a colleague who was doing just a little evaluation on this. And he in reality purchased me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the treat! However yeah Thnkx for spending the time to discuss this, I really feel strongly about it and love studying more on this topic. If attainable, as you turn into expertise, would you mind updating your blog with more particulars? It’s extremely helpful for me. Big thumb up for this weblog publish!

  15. windows 7 activation keys says:

    Hello There. I found your blog using msn. This is an extremely well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I will definitely comeback.

  16. Eimile says:

    Did you ever notice: The Roman Numerals for forty are

  17. web design belarus says:

    I just wanted to say thank you for your job on this. Thanks for sharing.

  18. Scrape Proxies Faster says:

    Hi the info on this site is just amazing it keeps us coming back time and time again ,personally this blog has helped me through some very tough moments in the kitchen lol! so i couldnt love it any more i have done my best to promote this site as i feel that people need to read this thing ,cheers for all the time you take in making this brilliant site !

  19. search people says:

    Must be nice to find yourself in a growing industry.

  20. cliff lee jerseys says:

     I want to thank you for your efforts, you write this article. I hope that in future the same high-level posts and your comments. In fact your creative writing skills inspired me tomake my own blog. The real blog is its wings rapidly. You write that it’s a good example.

  21. lexapro online says:

    I just added your website on my blogroll. I may come back later on to check out updates. Excellent information!

  22. House rentals Bethany Beach de says:

    Ill say thisyour days of divide-and-conquer are OVER. All REAL AMERICANS are going to hardware storesand guess what theyre buying?

  23. Car repos says:

    Nice work with the layout of the blog – it is very easy on the eye

  24. http://www.maleenhancementreviewssite.com says:

    I really like the font on your blog. It is very easy to read.

  25. buy atenolol says:

    I just added your website on my blogroll. Really enjoyed reading through. Excellent information!

  26. buy keflex online says:

    Great article with very interesting information. You are a very skilled blogger, thats for sure! =)

  27. Nike soccer cleats says:

    Said was wonderful, really the best site! Liked by the way best described 2011 Nike soccer cleats .Prefer the Nike mercurial vapor superfly

  28. test a ipad 2 the keep it for free says:

    Do you have a Facebook page or Twitter? Would love to follow you there, I’m on my iPhone and love reading your stuff!

  29. Nike mercurial vapor superfly III says:

    Since winter coming, the popularity of buyying Adidas Adizero Prime shoes for match has never reduced both in stores and online.

  30. one good guy says:

    Really great article with very interesting information. You might want to follow up to this topic!?! 2011

  31. Nike Mercurial Vapor Superfly says:

    Glad to see all the speakers, really wonderful content. Do not know if you like Nike Mercurial Vapor Superfly in Nike Football Cleats.

  32. Nike mercurial soccer cleats says:

    Ah good exciting content! Will always come to our attention. To bring you good news-works perfect! New nike soccer shoes of Nike soccer cleats best Nike mercurial soccer cleats 2011!!

  33. buy oem adobe photoshop cs4 says:

    The Zune concentrates on being a Portable Media Player. Not a web browser.

  34. discount adobe photoshop cs4 says:

    I may come back later on to check out out your other posts.

  35. cheap adobe photoshop cs4 says:

    I had been tiny bit acquainted of this your broadcast provided bright clear idea

  36. google reklam ver says:

    Very good theme. Would you mind giving me the name of theme you use? Google Reklam Ver

  37. google reklam ver says:

    I am glad that i found this web site through my search “google reklam ver”.

  38. google reklam ver says:

    Very nice template. Would you mind writing template name for your blog ? BTW I searched on google “google reklam ver” and found myself here.Thanks..

  39. Temizlik Firmasi says:

    Off topic but very interesting template. Would you mind giving me name of template ? Btw i searched on google “temizlik sirketleri antalya” and found myself here in a way :)

  40. Elaine Trigueros says:

    Thank you, I’ve recently been seeking for facts about this subject for ages and yours is the best I have discovered so far.

  41. rtyecript says:

    I really liked the article, and the very cool blog

  42. Real Estate Lewes Delaware says:

    The racism of this program takes away from the message. Mr. Ferguson made it seem as if the current mortgage crisis is due to minority homeowners, particularly in Detroit and Memphis. The camera shots of minorities further supported his theory. Mr. Ferguson should have looked further to Florida, Arizona and Nevada where white homeowners were defaulting in waves. The problem was that many people, whites included, bought homes that they couldnt afford. If there truly were loans for people with no jobs, income, and bad credit, then everyone would have a home now. And that surely isnt true.

  43. Windows 7 Anytime Upgrade Professional to Ultimate key says:

    Just desire to say your article is as astounding. The clearness in your post is simply nice and i could assume you are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please keep up the enjoyable work.

  44. chinese solar panels says:

    I have been looking for some good info about this almost a few hours. You really helped me a lot indeed and reading this blog post

  45. provera online says:

    Really great article with very interesting information. You might want to follow up to this topic!?! 2012

  46. Nike soccer cleats says:

    This Nike soccer cleats ultra vibrant New nike soccer shoes …The Nike soccer cleats has a huge army of fans across the globe, and if you’re one of them we know you love them to be bright, flashy and in-your-face colours. Checking out these nike mercurial vapor superfly III fg versions, part of Nike’s Fall seasonal releases, we’re sure you’re going to love these Nike Football Cleats too, they combine Laser technology and Nike Mercurial Vapor Superfly with the Vapor series!especially once they start appearing en masse on pitch. You can click “VIEW MORE” for more detailed pictures. New levels of performance after nike mercurial vapor superfly III new levels of performance after.

  47. solar panels power says:

    Thanks for finding the time to discuss this, I feel strongly regarding it and enjoy learning more about this topic. If possible, as you gain expertise, would you mind updating your blog site with a lot more information?

  48. รับสมัคร PJ says:

    Thank a comment.

  49. social music news says:

    Outstanding. I can only wish I had this information taught when I was a student in high school.

  50. music news says:

    Gail, your intention for the day is a lovely one. I hope you had a wonderful time at your group today!

  51. payday says:

    Instant payday and payday loans inwebsite

  52. jingxiamnh says:

    This is sweet stuff, its nice to be within the know.

  53. Iphone 5 says:

    I really like your weblog.. quite good shades & theme. Did you create this internet site yourself? Plz reply again as I’m looking to create my own website and would like to know wheere u acquired this from. many thanks

  54. Aline says:

    Leading post. I look forward to reading far more. Cheers

  55. xiaorr456 says:

    I found this blog post while was searching for books online related information on google and found it very good article, thanks for sharing, best regards and cheers!

  56. Replica Burberry Scarf says:

    This is absolutely gold. I did not expect that I鈥檇 get so much out of reading your write up! You鈥檝e just earned yourself a returning visitor :)

  57. Pandaranol says:

    Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV

  58. cheap adobe software says:

    Im glad to see this informative article. Thanks for such helpful and useful post.

  59. happyday67 says:

    I am lucky that I detected this blog , exactly the right information that I was looking for! .

  60. happyday67 says:

    Keep up the excellent work , I read few posts on this web site and I believe that your site is very interesting and has bands of excellent info .

  61. renren876 says:

    Nice site. Though its loading a little slowly for me. Maybe you shpould look into that?

  62. buy autocad lt says:

    I can not subscribe to your channel

  63. real estate Lewes de says:

    So as a further addendum to this post, I just wanted to add that after sampling Ron Kubys first official week on Air America Im coming to some early conclusions. As before, I find Kuby likable and well-spoken, and his legal and political chops are impecable. However, hes not grabbing me. And Im at a loss to explain what "grabs me" as far as the sound of fury or of any particular talk show host. Theres a certain "music" to the thinking, vocabulary and larynx of certain talk hosts (Bob Lassiter and Neil Rogers come to mind) that matches my tastes, or beliefs or thinking patterns. Something. The subject deserves a full blog post, which Im not prepared to write now. But as I said in the post, Maron always "grabs me." After having some time to think about it, I am pissed about Maron getting passed over.

  64. buy cheap software says:

    You just copied someone else’s story

  65. Cheap oem software says:

    jTjtkh Interesting, but still I would like to know more about it. Liked the article:D

  66. Pingback: zhexuejia

  67. Pingback: chanel bags

  68. Pingback: coach factory outlet

  69. Pingback: Louis Vuitton Outlet

  70. Pingback: coach factory outlet

Leave a Reply