Search The Blog
My Books

New:

My Songs

 

The Art of Unit Testing

Buy PDF or Print book at Manning

Buy on Amazon

Latest Posts
from 5whys.com
Twitter: @RoyOsherove
About this site

TDD in .NET Online Course

TDD and BDD in Ruby Online Course

 

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.

Friday
Jul112014

New Online Course: Beautiful Builds and Continuous Delivery Patterns

 

I somehow forgot to blog about this, but it’s never too late. My new online course Beautiful Builds and Continuous Delivery patterns is now available and is $25 until the end of this month (July).

Here’s the course description:

Ah, Continuous Delivery. Everybody and their sister are talking about it, but in real life, nothing is ever as simple as listening to a conference talk about it.

  • Can you really deploy 20 times a day if you QA department is breathing down your neck that they are using the staging server between 9 and 5?
  • Are the teams waiting for each other to finish their work , creating bottlenecks?
  • Is security threatening to have you fired for even suggesting you deploy to production?

In this course Roy Osherove, author of the books “Beautiful Builds” (still in progress, actually) and “The Art of Unit Testing”, discusses common problems and solutions (patterns!) during build automation and continuous delivery.

We start from the basics, defining the differences between automated builds and CI, separation of concerns in build management, and then move on to more advanced things such as making builds faster using artifacts, solving versioning issues with snapshots, cross-team dependencies, and much more.

  • All videos are both streamable AND downloadable to watch offline, no DRM.

More info at beautifulbuilds.com.

 

Friday
Jul112014

Should you write unit tests or integration tests?

I got this question in the mail. I thought it was quite valid for many other people:

Question:

 

Trying to promote unit tests in a new work place: the “search” action from the UI goes through IOC container which calls a WCF service, where the search itself is done using entity framework auto generated code.
My colleague claims that due to the multiple dependencies, it doesn’t make sense to fake everything when running the unit test, and it makes more sense to do integration tests in this case.

Is my hunch correct? Should I put efforts into implementing unit tests in this complex scenario?

 

My Answer:

You can go either way.

It really depends on time tradeoffs
  1. How long will it take to write the tests? For integration tests you will have to wait until the whole system is complete to get the tests even failing, unless you start from a webpage, and then they will fail for as long as the entire system of layers is not built.
  2. How long does it take to run and get feedback? integration tests take longer to run usually. and are more complicated to setup. But when they pass you get a good sense of confidence that all the parts work nicely with each other. with unit tests you will get faster feedback, but you will still need those integration tests for full system confidence. On the other hand with integration tests and no unit tests the developers will have to wait in long cycles before they know if they broke something.
There is no one answer. I usually do a mix of both. For web systems I might even start with acceptance tests that fail, and then fill the system slowly with unit tests for parts of the features with more focused functionality. 
I guess you can change the question to : What type of tests should we write FIRST?
Only you know that. it changes for every project and system.

 

Wednesday
May072014

Why I stopped selling courses on udemy

The Udemy Pyramid Scheme.

I’ve run several successfull courses on udemy back when they had a royalty rate of 90% revenue share per course.   Then things started to change, to the point where teaching in udemy to me feels like trying to win in a pyramid scheme. 

Here are the “new” revenue share model numbers:

http://support.udemy.com/knowledgebase/articles/277758-instructor-revenue-share

Quoting:

  • 100% revenue share on students that instructors bring to Udemy

  • 50% revenue share on students that Udemy brings to an instructor’s course

  • 25% revenue share on students that are driven by Udemy paid ads

end quote.

Seems fair. Until you realize, the hard way, that any exiting udemy user that takes your courses that YOU didn’t bring in with your specific course codes and discounts, counts as a 50% revenue share.

 

Points of consideration:

 

  1. There is a finite number of people who might be interested in your course
  2. There is a high chance that many of them have already signed up for udemy
  3. Of those who haven’t yet signed up to udemy, you have to bring in and make them use you special offer codes. Only then do you get 100% of that course’s revenue.
  4. Once you did that, you basically screwed over other course instructors, because your student will now and forever be considered a 50% revenue share for all other teachers.
  5. That means that I benefit and make money at the large expense of other teachers on udemy, while making udemy much, MUCH more money in the long run.
  6. The earlier I started with my courses on udemy, the more chances I have to get into udemy those users who have not signed up to udemy yet. The later i sign on to teach in udemy, the smaller my chances are ever making more than 50% revenue share, unless I bring my own crowd.
  7. Consider this: for each student on udemy, udemy makes 50% commission on all their purchases, EXCEPT one instructor.
  8. Eventually, there will be less and less chances for ALL instructors ot make ore than 50% revenue on courses, as the student population targeted has already signed up. any students that UDEMY brings to the table  with ads, will actually only get you 25% revenue share.
  9. This whole idea pits the teachers one against the other, to see who gets "fresh" users first, thus taking them “away” from other teachers. That’s not healthy.

 

 

So I opened my own shop on shopify and at least now I don’t feel like I’m screwing over anybody else. I pay more than 100$ a month for some of the plugins etc. But I do have enough people on twitter and I’m well known enough in some corners that it pays me OK.  I don’t like doing it, but it feels better. If they went back to the old model I’d probably go back to them, honestly.

When udemy sent me an email asking why I haven’t been selling any courses, here was my answer:

 

Hi Roy,
I saw that you drove almost $4,000 to your Udemy courses between Nov-Dec 2013 with instructor coupon codes and haven’t driven any additional income since then. I just wanted to send you a note to find out what we can improve to help you continue building your business on Udemy
Would you mind providing a little insight?
1) How did you drive your initial Udemy course sales?
2) Why did you stop promoting your Udemy courses? 
3) What do you need to restart promoting your courses?
I appreciate any feedback you can provide! And if you’d like to schedule time to chat, I’m available. Just let me know. :)
Regards,….

My answer:

I stopped because your new royalty model (50% if existing user) is basically a pyramid scam. And it feels unfair. 
By bringing in new users I make sure I get more royalties, but I also screw the royalties for other authors. Also, there is a limited number of people who are interested in a specific subject, so only early risers will get their full royalty.
It feels wrong. I was very happy with the previous model of a flat rate royalty, but this one has me looking for alternatives.

 

 

Needless to say, they didn’t reply yet. 

I would recommend that you stay away from teaching on udemy. it feels unethical.

Tuesday
Jan282014

Photo and Video Backup Strategy: Why I am not likely to ever lose my family photos and videos from the last 10 years in the next 10 years.

Here is the way I backup my photos>

  • First I use dropbox for “immediate” backup of the last month
  • Then I use PictureLife as a full backup and viewing service
  • Then I use Amazon Glacier for “cold storage”
  • For my stuff I sell I use Amazon S3

Here is my system.

Dropbox : First Line of Backup

My wife and I take most of our photos on our phones, so we have dropbox installed on our phone with automatic uploads. Every time we get to a wifi spot, the phone “calls home” to dropbox to upload the latest and gratest photos and family videos we have taken.

I have my own dropbox account with 100 GB on it. My wife has a separate, free dropbox account.

My wife has shared her “Camera Uploads” dropbox folder with me. She also has auto upload enabled.

Dropbox also automatically supports multiple versions up to a point, for the same file, so even if we get our files encrypted by that awful virus, we can restore them by version. I hope.

Cost: $10 a month for the pro plan

PictureLife: 2nd Line of Backup with Browsing

I pay for a standard picturelife plan, so I can always browse all our pics and videos on my phone, ipad and more. I chose picturelife because it supported videos. Lately other services have added that possibility as well.

We have picturelife installed on all our family PCs and phones. On the PCs it is set to look for stuff in the camera uploads and the shared camera uploads folder from my wife. Yes, we upload the same pics multiple times, but picturelife seems to be mostly smart enough to tell if the same picture has been uploaded multiple times and keeps only a single copy. sometimes we get two *especially if we get any pictures from what’sApp. This is still not a solved problem..

If we do take pictures with other camera, we just put the SD card in the laptop slot and let dropbox import everything into the camera uploads folder. From there everything gets synced to picturelife.

Cost: $15 a month for up to 300GB

 

Glacier: Cold Storage

We have two “family computers: in the house. One of the main media center windows machine with 1TB hard drive on it, and it is connected to my dropbox account. That means it also gets all of mine and my my wife’s photos since she has a shared folder with me.

Every one a month or two, I zip up al the files on that machine’s camera uploads and “camera uploads from my wife”’s folder and upload them to amazon glacier. the zip file is named with a date range for example jan24-feb25-2013.zip . Once the glacier upload is done (I use fastglacier for a speedy upload) I can safely delete the photos from dropbox, so that I do not pass the 100 GB limit (we have lots of videos).

No virus will have access to those files.

I also have a copy of all these files in two other glacier regions, just in case. the cost are extermly low. Much better than S3.

Cost: about $10 a month for around 300GB so far

Amazon S3: Quick access for my work

I have all the video files for all my courses backup to both S3 and Glacier. S3 is good because I host some of them for the blog and sometimes I need to get them to upload stuff to my shop. So I have two online backups for my large video files. S3 costs more, so I make sure to keep stuff there without the redundancy options, which is much cheaper

I have LOTS of data on S3 so I get around $40 per month in costs..

 

Final Words

I don’t rely on a single service to stay up. And I always have full access to everything from the last ten years.

Total cost for managing all my files ever:  $65-$75 a month.

Your costs might be $40 lower since you might not need S3 if you are not keeping professional grade work for quick retrieval.

Saturday
Nov232013

Fifteen things I look for in an Isolation framework

  1. Is the framework strict or non strict by default? Hopefully non strict.
  2. Is everything called a mock? Hopefully not. a fake? mock/stub differentiation?
  3. Does it have recursive fakes? Hopefully.
  4. How good are the error messages?
  5. What is the test style? record replay?arrange-assert-act? arrange-act-assert? hopefully the latter.
  6. How simple are the matchers for expected parameters to write? 
  7. How easily can you create a mock logger that expects a string containing X at least once?
  8. How easily can you create a stub logger that simulates an exception, and a mock service that gets a message containing string if the logger throws. ([as specified here])
  9. Is the framework constrained or unconstrained? Important to know what it can and cannot do.
  10. Does stubbing a return value feel like setting an expectation? Hopefully not.
  11. When you verify - can you verify only a single specific call? hopefully. or do you have to verify all?
  12. Could you verify all if you wanted? hopefully not.
  13. Does the framework verify by default ? hopefully not.
  14. Does the framework encourage to verify all in the teardown? hopefully not.
  15. How easily can you verify you got an object with some properties or attributes?
Sunday
Oct202013

Looking for a new adventure and challenging work in 2014

TLDR;

If you think I would be useful to your company in the US or in Europe as an Architect, Team Leader, Senior Developer, CTO, Trainer or any other role where I can make a real difference - maybe we can work together, starting around summer 2014. Due to visa issues we know this takes a while to get going, so we are starting the search early. 

Here is my CV 

 

I will be in the US (Omaha and New York) during November, and that would be a good time for me to drop by and interview with potential employers. Contact me.

More information:

 

In the summer of 2014 my family and me will have spent two years in Norway. It was always about the adventure, and now it’s time to move to a warmer place, and seek new adventure, while the kids are still young enough so that such a move will not be too much of a burden on them.

I do love working at my current job at ITVerket, and the project is very rewarding and interesting, but my wife is going crazy not being able to find a job here (due to lack of Norwegian) and next year the international school costs here will just be too high for us.

So before the summer comes, I need a place to move to, with a job where I can make a difference.

I am looking for work opportunities in places warmer and different from Norway (not Israel. There’s always that option..).  The ideas is to move and live somewhere another two years, or maybe more if we can financially see it being worth it (financially, Norway was very challenging, to put it mildly).

If you think I would be useful to your company as an Architect, Team Leader, Senior Developer, CTO or any role where I can make a real difference - maybe we can work together.

Here is my CV

I will be in the US (Omaha and New York) during November, and that would be a good time for me to drop by and interview with potential employers. Contact me.

I do come with a package. I am married with three little boys. We currently live in Norway and that’s where we will be relocating from.

Places we would love to move to:

  • US

    • Austin, TX

    • Miami

    • New York/NJ area

    • Other places with a thriving tech community and reasonably warm weather (My wife is tired of the norwegian winter we’re about to go through again).

  • Austraila
  • Canada
  • Vancouver (yeah, less warm, but we hear is a great place to live with a lively population)

  • London

    • Again, not too warm, but I was there a couple of weeks ago and it looks like a great and lively place to work and live.

  • France

  • Hawaii?

  • Anywhere that feels like a Caribbean island
  • Anywhere else that we should think of and did not!

 

 

Contact me.

 

Friday
Oct182013

$11,000

That is what I earned on my book for software team leaders before it was even finished.

This august I finished writing and publishing my first self-published book. Last month I got done adding a print and an audio edition of that book.

So far, two months after finishing the book, I have netted almost $14,000 from the book in ebook, print and audio formats. It sold around 1,500 copies. That averages almost $10 per copy sold, and I sold more than half of them at a very large discount.

It was an interesting experiment, and I would like others to know how I did it in a way that worked for me.

I previously wrote one other pretty successful (at least in the Microsoft niche) book about unit testing, through a “standard” publisher (Manning).

In the next month, the second edition of my book with manning will appear, and I am looking at the numbers deciding whether the self publishing experiment was worth it. So far, it has.

I can already say that I made more on my book before it came out, than I had made with a traditional publisher after 6 years. That is because with a traditional publisher you might end up getting 2-4$ per copy sold, once a quarter, while the way I sold it I got about 20$ for each copy, monthly.

A four year old blog

The work on the self published book started four years ago, with a simple blog about the topics I cared about. Every time I had something to say to a team leader, I blogged it there. I knew I would then use the best ideas from my blog in an eventual book.

This process keeps repeating for me. My first book was based on a blog started five years earlier. And I am planning another book about a different topic

ISBN:

AN ISBN can be costly if you live in the US. But I live in Norway. So that`s free. You just ask nicely by email. I also made my publisher name “Team Agile Publishing” registered in Norway. Free too.

 

Ebook:

So what does an author with a passion for agility and lean thinking do when they write a book? They look for a way to write a book the same way.

I used Leanpub.com to write my book and actually start selling it before it was done.

In fact, one nice feature you can do with that site is that you can declare you want to write a book, write out a description, and ask people to check it out. Visitors can mark on the page what they would have paid for such a book, and that can help you gauge whether you might make any money writing that book. It is pure lean market research, but you still have to get the people into that page, which is where my blog and twitter came in handy.

When I started writing it, I published a couple of chapters and immediately declared it available for sale. Yes, there were typos, and grammar issues. But I believe in deploying less than perfect and see what sticks, because that gives me a motive to keep working at something and make it better.

Because I could change the price whenever I wanted immediately, I started off selling the book for 3$, with the leanpub promise that purchasers always get the latest versions of the book as I update them on leanpub. That means early adopters will end up with the full book for 3$.

The more chapters I added, the more I added to the price.

Most the money from the book was made before it was even published. I was able to do this because I have amassed a bit of an audience through my long time blog and previous book. That means about 8,000 RSS blog readers and 10,000+ twitter followers that knew about my book while I was writing it.

While writing it, I also continuously wrote a blog about the ideas in that book at 5whys.com

Profit from Leanpub so far:  13,890$

image

Editing

For copyediting, proofing and spelling I used a combination of people I know from the publishing industry, which I paid to with paypal, and asking the readers of my blog to be beta reviewers of the book in exchange for a free copy.

Cost of editing: about 250$ if you do not count about 200 free copies given away.

 

Book Cover

To design the cover of the book I used 99designs.com and was quite happy.

Design cost? about 350$

After designing several covers there, I would recommend opening contests for $500 or more so that you get the really top tier designers there interested. Here is  a great cover I got for that price.

Amazon:

When my book was done I published it on amazon kindle (LeanPub generates a file you can just upload) through the KDP program.

 

Audio Book:

I first tried to record the audio book on my own. I felt like I could do it because I do a lot of speaking, but it was just not cutting it. So I went on voices.com and found within a day the narrator I wanted (Gorde Edland).

Gorde also formatted the mp3 files and I ended up making the itunes file  using AudioBook Builder (cost: 5$) 

I then published the audio book first on gumroad.com

Narration and production Cost? 1650$

Profit so far: 1679$      since august 17th: cost repaid in two months

image

I then tried to find a way to put the book on Audible.com. That is NOT an easy task if you live outside the United states and do not have at least five audio books to sell.

Turns out you can find, here and there, publishers that will do audible distribution for you, and only take a small cut of sales.

I tried going through vook.com and a couple of other places but ended up choosing Spoken Word. They were the quickest to return my email and I did not need all the marketing extra work that vook offered.

I still do not have any numbers on how much audible sold. It takes at least three-four months to find out, and then another month to get money from that. That sucks. But any money I make on the audio book now is “free money”.

 

Print Book:

I chose CreateSpace.com to print the book and have a print edition available on amazon. so far the reports show 10 print copies being sold (I still have not emailed my mailing list of several thousands that the print book exists).

To layout the book cover for createspace cost me about 50$ through a contact I made in the book business

to try out and ship to me a couple of proofs of the final print cost me less than 25$

Profit so far: About 130$

image

Marketing

I do very little marketing, and it is mostly on my blog and twitter, in the form of sidebar links from my various websites.

I pay 13$ a month to hellobar.com for the top bar of this website which I can easily change and applies to all my other websites as well.

I am now experimenting with facebook ads for the book. it cost me less than 10$ to get about 35 clicks and about 3 sales of the book after two days of that starting out. Still playing with that.

I use madmimi.com to maintain an email list of people interested, which I got for free because I used to work there.

 

Overall :

net profit of $13,815 within two months of book publishing in a niche area.

image

Wednesday
Oct162013

Video: Unit Testing and TDD – Why You Should Care and How to Make It Happen

A few weeks ago I spent a few days in Germany and got the opportunity to speak at the siemens healthcare testing conference. I talked about why we usually fail to introduce new paractices into an organization and explained influence forces and how our own estimates prevent us from doing the things we believe.

Here is the video:

Web Analytics