• About
  • Jerry’s Story

swalchemist

swalchemist

Monthly Archives: June 2024

Beyond Scrum

28 Friday Jun 2024

Posted by Danny R. Faught in technology

≈ 5 Comments

Tags

Kanban, scrum, TDD, XP

At the last few companies I worked for, my organizations happened to follow a similar agile methodology. It worked really well for us, but I don’t have a name for it. Maybe you can help name it. For now, I call it “Beyond Scrum.”

I’ve followed the Scrum methodology on a handful of teams in the past, including all of the ceremonies (colloquially – daily standup, sprints, sprint planning, demo, retro). I was even a certified scrum master.

But over time, some of the ceremonies seemed more useful than others. For one, sprints (a.k.a. iterations) especially created friction without providing any benefit. At the end of a sprint, there would almost always be stories that either had to be split, taking partial “credit” in the current sprint and the rest in later sprints, or pushed wholesale into the next sprint without getting any recognition for any of the work in the current sprint. We could get better at fitting stories into one iteration, but you know what makes more sense? Don’t arbitrarily chop our work up into sprints and then fret about whether the last few stories fit into the time at the end of the sprint.

My recent teams evolved into more of a Kanban sort of flow, where we would finish a story then pull the next story off of the backlog. There was no sprint backlog, just the overall project backlog. I don’t really know how much of Kanban we followed, because I don’t know much about Kanban. But I do like the continuous flow of starting a new story as soon as people were available to take on something new. Caveat: one team used a project management tool to groom at least a week’s worth of work at a time, which looked on the surface like a 1-week sprint, but the reality was that they always wanted at least a little more than a week of stories so they wouldn’t run out and have to groom more stories mid-week. Any stories that weren’t finished at the end of the week would flow smoothly into the next week with no anxiety about what sprint it was a part of.

Speaking of stories, story sizing seemed to lose its value. With no sprints, we didn’t need to calculate velocity in order to know how many stories we could cram into a sprint. Discussing size may have had value in terms of making sure the team understood the scope of a story, but ultimately the teams didn’t care what T-shirt size or Fibonacci number was put on each story. What did still matter, though, was writing good stories that had clear acceptance criteria and weren’t too large. Large stories that couldn’t be finished in a week were difficult to manage. But writing small stories was often difficult to do. Sometimes we’d split a story after seeing that it was taking a long time, or we’d just march on for two or three weeks and get it done.

My last few teams were working on infrastructure software–someone that a product owner might have difficulty relating to customer-visible features. So we found that the product owner role wasn’t very active or useful. Typically we would have a manager or designated person on the team take care of accepting stories, which was often rather informal. Often we wouldn’t even have clearly written acceptance criteria, and often the acceptance process was a rubber stamp that didn’t provide any value to the team. On a related vein – the sprint demo didn’t make much sense. We might demo individual stories as needed to facilitate story acceptance, but with the diminished participation of the product owner, we often skipped the demos. In their place, we might demo significant new features or newly introduced technologies to our team as needed. One team had a weekly time slot for this and other technical discussions.

Besides Kanban, another methodology we borrowed from was Extreme Programming (XP). We didn’t strive to follow all of the essential XP elements, so it would be disingenuous to say we were an XP team. But we did follow the most commonly known XP practices, test-driven development and pair programming. Another element of XP is the 40-hour workweek, and we did pretty well at that one too. Many of the other elements were there, like collective code ownership and continuous integration. But not the iterations and not much of the iteration planning.

We kept some of the other Scrum ceremonies. The daily standup was still useful, especially with a remote team. There were experiments with going more lightweight with an asynchronous standup in a chat tool, and in the other direction with adding a daily stand-down. And the retro was still popular, at least once every two weeks but more likely once every week. It wasn’t hard to find recent things to celebrate or improve on.

So there you have it – the elements of “Beyond Scrum” that were remarkably similar at two different companies. Maybe many companies have evolved toward something similar? Let me know if any of this sounds familiar to you.

feature image photo credit: Tom Natt (CC BY-NC 2.0)

Dr. Wiseman’s Luck Factor

13 Thursday Jun 2024

Posted by Danny R. Faught in career

≈ 4 Comments

Tags

luck

Continuing on my quest to better learn how to be lucky, I’m following up on my mini-review of Max Gunther’s book, The Luck Factor (Creating Luck: The Luck Factor). This time I’m discussing the book I set out to read in the first place: The Luck Factor: Change your luck – and change your life, by Dr. Richard Wiseman. It was published in 2003 and doesn’t contain any mention of Gunther’s book of the same name from 1977. They do have several things in common. However, Wiseman conducted research to back his claims, and also presents more elements of luck overall than Gunther. I’ll compare the five main points from Gunther’s book to Wiseman’s four principles and some of their 12 sub-principles. I’m really only paying attention to part four of Gunther, as I did with my earlier review.

Wiseman starts right in to the useful stuff after two chapters of introduction. In “Principle One: Maximise Your Chance Opportunities” he starts the same way Gunther did, talking about how a strong social network increases our luck. Wiseman goes on to tie in having a relaxed attitude, saying that luck is inversely proportional to neuroticism (one of the “Big Five” personality traits). The next sub-principle is about being open to new experiences, similar to Gunther’s “Fortune Favors the Bold” concept. “Openness” is another of the big five personality traits.

Principle two, “Listen to Your Lucky Hunches” matches with Gunther’s “Hunching Skill” concept. I felt that Gunther gave some more actionable advice here, despite not having research backing his ideas, and I especially like how he distinguishes between wishful thinking and informed hunches. In any case, for those of us who aren’t attuned to our own intuition, it’s worth studying.

Principle three in Wiseman’s book is “Expect Good Fortune”. I don’t see a close analog from Gunther, in fact, his “Pessimism Paradox” is basically the opposite. Both actually work well together. Wiseman’s principle is basically the power of positive thinking, and he gives several helpful angles on it. Gunther focuses on being prepared when Murphy’s Law strikes, and to expect that it always will. I believe we can benefit from both of these principles, as long as we don’t try to peg ourselves as entirely optimists or pessimists.

Wiseman’s principle four, “Turn Your Bad Luck Into Good” is hard to characterize. It overlaps a lot with the positive thinking in principle 3. One sub-principle, “Lucky people take constructive steps to prevent more bad luck in the future” hits some of the same points as Gunther’s “The Ratchet Effect”.

Overall, Wiseman comes across as more credible because of the research behind his book, and he devotes much of the book to the analysis of specific things that make some people much luckier than others. In addition, he includes several exercises to help you analyze how to improve your own luck, and the last section of the book further discusses how to learn to be lucky. However, I should note that Gunther’s book was an easier read, and it covers enough unique ground that it’s worthwhile as well. Both books have numerous interesting anecdotes of real people who either have unusually bad or good luck.

Some people respond to this topic with a big “duh, I know all that stuff.” In fact, the people who stand the most to gain are those with the worst luck. I hope they find these books. For me, I have more to learn about how to listen to my hunches, and though I think my attitude toward the things that contribute to my luck is already pretty relaxed, there are a few improvements I can make here as well.

Have you done anything to learn about what to do about your bad luck, or how to have even better luck? I’m curious to hear about it.

Test-driving fizzbuzz in bash

01 Saturday Jun 2024

Posted by Danny R. Faught in technology

≈ 1 Comment

Tags

TDD

Here’s one for the programmers in my audience. At a recent software crafters meetup, someone brought up the fizzbuzz coding exercise, and how funny it would be to code in bash. Examples of solutions in bash were easy to find, but I didn’t see any that included unit tests. So I tried a test-driven (TDD) solution for fizzbuzz in bash. Here’s how it went.

I updated Bats using homebrew on my Mac. There is now a GitHub organization serving as a home for Bats. I uninstalled an older Bats version I already had, made sure to remove the old tap (“kaos/shell”), and reinstalled from its new home using the brew instructions:

$ brew install bats-core
...
==> Installing bats-core
==> Pouring bats-core--1.11.0.all.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
...

Pay attention to those errors (the “Error:” label was in red on my terminal, but it was buried in a large amount of other log output). I needed to follow the instructions in the error output before I had the new bats-core in my path:

brew link --overwrite bats-core

I also wanted to use the bats-assert library, which depends on bats-support, so I ran:

$ brew tap bats-core/bats-core
$ brew install bats-support
$ brew install bats-assert

The fizzbuzz exercise asks for 100 lines of output, printing out the numbers 1 to 100, with these modifications: if the number is divisible by 3, print “fizz” instead of the number. If the number is divisible by 5, print “buzz”, and if it’s divisible by both 3 and 5, print “fizzbuzz”. Rather than try to process 100 lines of output in each test, I planned to write a function to return one number in the sequence. I started with this test in a test subdirectory:

#!/usr/bin/env bats

load '/usr/local/lib/bats-support/load.bash'
load '/usr/local/lib/bats-assert/load.bash'

setup() {
source "../fizzbuzz.bash"
}

@test "fizzbuzz 1 returns 1" {
run fizzbuzz 1
assert_success
assert_output 1
}

I created a dummy function in fizzbuzz.bash so the test could run:

#!/usr/bin/env bash

function fizzbuzz {
:
}

And now the test does its job:

✗ fizzbuzz 1 returns 1
(from function assert_success' in file /usr/local/lib/bats-assert/src/assert_success.bash, line 42, in test file fizzbuzz-test.bash, line 12) assert_success' failed

-- command failed --
status : 1
output :
--

1 test, 1 failure

Getting the test to pass was easy enough:

function fizzbuzz {
echo 1
}

Not shown below is the satisfying green color on the last line showing 0 failures (it was red before):

$ ./fizzbuzz-test.bash
fizzbuzz-test.bash
✓ fizzbuzz 1 returns 1

1 test, 0 failures

Next I added a test to the test script to triangulate and force a more useful implementation:

@test "fizzbuzz 2 returns 2" {
run fizzbuzz 2
assert_success
assert_output 2
}

The first test passes, and the new one fails as expected. A simple change to the function makes both tests happy:

function fizzbuzz {
local num="$1"
echo "$num"
}

Now finally a test that makes it interesting:

@test "fizzbuzz 3 returns fizz" {
  run fizzbuzz 3
  assert_success
  assert_output fizz
}

Some simplistic logic gets the test to pass:

function fizzbuzz {
local num="$1"

if [[ "$num" = 3 ]]; then
echo fizz
return
fi

echo "$num"
}

So we triangulate again:

@test "fizzbuzz 6 returns fizz" {
run fizzbuzz 6
assert_success
assert_output fizz
}

And that drives a full solution for the “fizz” part of the problem:

function fizzbuzz {
local num="$1"

if [[ $((num % 3)) = 0 ]]; then
echo fizz
return
fi

echo "$num"
}

On to the “buzz” part of the challenge:

@test "fizzbuzz 5 returns buzz" {
run fizzbuzz 5
assert_success
assert_output buzz
}

Here’s what the test output looks like now:

$ ./fizzbuzz-test.bash
fizzbuzz-test.bash
✓ fizzbuzz 1 returns 1
✓ fizzbuzz 2 returns 2
✓ fizzbuzz 3 returns fizz
✓ fizzbuzz 6 returns fizz
✗ fizzbuzz 5 returns buzz
(from function assert_output' in file /usr/local/lib/bats-assert/src/assert_output.bash, line 194, in test file fizzbuzz-test.bash, line 37) assert_output buzz' failed

-- output differs --
expected : buzz
actual : 5
--

5 tests, 1 failure

Again I did a simple implementation that would require triangulation to complete:

function fizzbuzz {
  local num="$1"

  if [[ $((num % 3)) = 0 ]]; then
    echo fizz
  elif [[ $num = 5 ]]; then
    echo buzz
  else
    echo "$num"
  fi

}

One more test to triangulate:

@test "fizzbuzz 10 returns buzz" {
  run fizzbuzz 10
  assert_success
  assert_output buzz
}

A little tweak makes the test pass:

function fizzbuzz {
  local num="$1"

  if [[ $((num % 3)) = 0 ]]; then
    echo fizz
  elif [[ $((num % 5 )) = 0 ]]; then
    echo buzz
  else
    echo "$num"
  fi

}

Now finally, one more test for the “fizzbuzz” output:

@test "fizzbuzz 15 returns fizzbuzz" {
run fizzbuzz 15
assert_success
assert_output fizzbuzz
}

My solution was unsatisfying, but it worked:

function fizzbuzz {
  local num=$1
  if [[ $((num % 3)) != 0 && $((num % 5)) != 0 ]]; then
    echo "$num"
    return
  fi

  if [[ $((num % 3)) = 0 ]]; then
    echo -n fizz
  fi
  if [[ $((num % 5)) = 0 ]]; then
    echo -n buzz
  fi
  echo
}

I was happier after a refactor to remove the redundant logic:

function fizzbuzz {
local num="$1"
local output=""

if [[ $((num % 3)) = 0 ]]; then
output=fizz
fi
if [[ $((num % 5)) = 0 ]]; then
output="${output}buzz"
fi
if [[ -z "$output" ]]; then
output="$num"
fi

echo $output
}

There are far more concise solutions out there, but I like the readability of my solution. Now, as for getting 100 lines of output when running the scripts directly, I tacked this to the end of my script. This allowed it to meet this requirement while still not affecting how the unit tests work with the fizzbuzz function at all:

if [ "${BASH_SOURCE[0]}" -ef "$0" ]
then
for i in $(seq 1 100); do
fizzbuzz "$i"
done
fi

I tested this chunk of code manually rather than try to automate a test for it.

$ ./fizzbuzz.bash
1
2
fizz
4
buzz
fizz
7
...

And there you have it, a testable fizzbuzz in bash. Some people add a few extra rules to continue the fizzbuzz exercise, and I’m confident that the tests would help support any further additions to the code.

Further reading: I first wrote about the Bats unit test framework in “Going bats with bash unit testing“.

Recent Posts

  • Seeking the Inner Ring – Revisited
  • Use Your Unit Tests, or Else
  • Open-Minded Networking
  • Design Evolutions Doomed to Never Finish
  • Adventures in Personal Library Management

Recent Comments

Danny R. Faught's avatarDanny R. Faught on Seeking the Inner Ring –…
coutré's avatarcoutré on Seeking the Inner Ring –…
Danny R. Faught's avatarDanny R. Faught on Use Your Unit Tests, or E…
coutré's avatarcoutré on Use Your Unit Tests, or E…
Five for Friday… on Four Years after the 343

Archives

  • October 2025
  • September 2025
  • March 2025
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • March 2024
  • February 2024
  • February 2022
  • September 2021
  • August 2020
  • July 2020
  • February 2019
  • December 2018
  • October 2018
  • August 2018
  • June 2018
  • March 2018
  • February 2018
  • October 2017
  • September 2017
  • May 2017
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • September 2013
  • August 2013
  • November 2006
  • April 2003

Categories

  • archive
  • career
  • Jerry's story
  • life
  • security
  • software-development
  • technology
  • testing
  • travel

Meta

  • Create account
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

Blog at WordPress.com.

  • Subscribe Subscribed
    • swalchemist
    • Join 26 other subscribers
    • Already have a WordPress.com account? Log in now.
    • swalchemist
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar