Member-only story

What is the Business Value of Unit Testing? Part 2

Russell Hammett Jr. (Kritner)
5 min readSep 1, 2018

--

In the previous post, we started on a business application with the requirement:

As a user, I need a way to enter a number. Once the number has been entered, I need it to be printed back to me. The customer loves the app! But has a few new requirements for us:

As a user, I need a way to enter a number. Once the number has been entered, I need it to be printed back to me.

If a number evenly divisible by 3 is entered, the user should receive back “Fizz” rather than the number

If a number evenly divisible by 5 is entered, the user should receive back “Buzz” rather than the number

The requirements now are equivalent to the children’s problem and/or code kata FizzBuzz

Our code previously only had a single branch of logic. Get number, return number. Based on the new requirements, we can see there will be a few more branches:

  1. number is not evenly divisible by 3 or 5
  2. number is evenly divisible by 3
  3. number is evenly divisible by 5
  4. (not explicitly stated but) number is evenly divisible by both 3 and 5.

The 4th branch was not stated by the requirements, but seem like something that should be asked of the business owner, as it might not have been considered, or could have even been assumed.

--

--

Russell Hammett Jr. (Kritner)
Russell Hammett Jr. (Kritner)

Written by Russell Hammett Jr. (Kritner)

Just a boring Application Developer/Dad. I enjoy gaming, learning new technologies, reading, and potentially other stuff. That’s about it.

No responses yet