Archive for June, 2024
Learning Music Sight-Reading with Duolingo
Posted by claudiolassala in Personal Growth on June 17, 2024
When Duolingo released the new Music course, I decided to give it a try. After seeing how it works, I embarked on the journey through the 69 lesson units. It is a fun way to learn something when I can only spend a few minutes on it daily.
Even though I have been writing music for several years, I can’t write or read it on a music sheet. I have a very minimal understanding of note lengths and where they are on the staff (provided it’s in the treble clef), but I feel like a child learning to read: “That’s an A… that’s a B… that’s a C…”
My expectation for this music course was simple: improve sight-reading. Such improvement helps me achieve two goals:
- Write and read portions of my music to facilitate recording
- Learn to play a few of my favorite songs on the piano by reading sheet music
Important: I’m NOT expecting to learn to play the piano; playing a virtual piano by tapping a finger on a phone screen isn’t cut for that.
Write and Read portions of my music
When composing my music, I often come up with a few parts that I want to add: strings, piano, orchestration, etc. To do that, I pull up my old IRig Keys and start playing until I find something I like. When I do, I need to memorize it and then record it.

That approach is time-consuming and very error-prone.
If I can write the notes down and read them as I play them, it’ll save me time and encourage me to do more of it. I don’t need to write the notes’ length precisely, even though that could be helpful in the future if I ever have somebody else play it.
I will put into practice the lessons I learned whenever I’m working on a new song for which I need these skills.
Play a few favorite tunes on the piano
There are a few of my favorite tunes that I’d like to learn how to play on the piano. I’m expecting to shred Chopin’s pieces a while ago. My goal is to play some simple tunes.
A few months after starting the music course, I completed the last lesson of unit 69. Although I didn’t get perfect scores (3 stars) in many lessons, I planned to get through the entire course and familiarize myself with everything covered.

The last lesson looked something like this:

Thinking that might be sufficient for me to at least start trying to play a song, I found the music sheet online. It begins like this:

Nope, I’m not ready yet.
- That’s a lot of sharp (#) notes. Duolingo only had a few lessons to practice that.
- Bass clef, dude, Duolingo has no lessons showing the bass clef.

What now?
New plan:
- Go through the lessons again, aiming for perfect scores. I have been doing this and feel I’m making progress (sight-reading a little faster), but I need a lot more practice.
- Get familiar with the bass clef. I may look for an iOS app, put it on my iPad, and practice using my iRig Keys.
I’m not in a hurry and only want to get a little better every day.
Given-When-Then and Arrange-Act-Assert: Thinking Differently
Posted by claudiolassala in Quality & Testing on June 12, 2024
“Does choosing the Given-When-Then approach vs. Arrange-Act-Assert make us think differently?”
I’ve been pondering languages a lot over the years, both spoken and programming languages. My observations are based on my experience as a multilingual individual who has programmed in a few different languages for the last 30 years.
The spoken language I choose to communicate does affect how I think.
I drove to work on a particular day, knowing I’d have a sprint review early in the morning. As I drive, my mind has thoughts about the flow of the conversation (e.g., “How do we better convey the value we’ve produced in this sprint? What is the best story arc to demonstrate the results?”). I know everyone in the room speaks English, the language of the upcoming conversations. So, my mind thinks in English and tries to problem-solve in that language. That’s the perspective.
That afternoon, I drove home. I knew my wife would ask me how my day went. We only speak Portuguese at home, so I think in Portuguese as I drive. That’s the perspective.
Looking at a problem from different perspectives makes me think differently.
I’ve noticed similar thoughts when using a programming language to solve problems. For example, if I’m writing code in C#, my initial inclination is to think object-oriented. But sometimes I look at it and ask: “How would I write this in Ruby? Hmm, that’d be similar to how I solved some problems dynamically in FoxPro. Would that be a valid approach in C#?”
Thinking in different languages gives me different perspectives when problem-solving.
Back to GWT and AAA. If I’m presented with…
// Arrange
// Act
// Assert
…my mind immediately wants to fill in the details, thinking in technical terms constrained by the programming language:
// Arrange
//...instantiate some classes
//...set some properties
// Act
//...instantiate a system under test (sut)
//...call a method on it...
// Then
// ...verify some properties
// ...verify object interactions
Stepping back from the nitty-gritty technical details and focusing on the problem at hand can be a relief. It’s a common pitfall for us developers to get so engrossed in the system and its implementation that we lose sight of the problem that needs solving.
Instead, if I’m presented with…
Given...
When...
Then...
…I’m focused on a desired behavior. This approach makes it easier to avoid getting bogged down in technical concerns.
Granted, those statements could still be written to describe technical concerns, but I’ve trained not to do that and isolate behavior from the system under test.
This simple shift of language (Given-When-Then vs. Arrange-Act-Assert) shapes how I think about solving problems and helps me stay focused.
Research
Shortly after starting to write this blog post, I found several videos that explain this topic and the research that goes into it. Here are some of them:

Is Given-When-Then superior to Arrange-Act-Assert?
Posted by claudiolassala in Quality & Testing, Software Development on June 7, 2024
Is Given-When-Then (GWT) superior to Arrange-Act-Assert (AAA)?
Interesting question: superior in what sense?
Is Angular superior to React? I have seen both great and terrible software built with both.
Is C# superior to Java? Same as above.
Is Red Bull superior to Monster? No, the Green Monster tastes better. But that’s just my preference.
To think of one thing being superior to another, I think of what needs to be achieved.
If I’m dehydrated, water is superior to wine in hydrating me.
If I’m enjoying a meal at an Italian restaurant, wine is superior to water in complementing the taste of my delicious pasta.
If I am asked to implement a user story, GWT is superior at helping me clarify the problem that needs solving.
If I collaborate with others (technical or non-technical), GWT is superior in getting everybody on the same page faster.
Notice I specifically wrote those statements from my perspective.
After many years of following that approach and receiving feedback from those I have collaborated with, I’ve validated that GWT is superior for me in achieving those outcomes and has helped my teams.
Could I achieve those outcomes through different approaches (such as AAA)? Yes, I’ve done it before knowing GWT, but I know I wasn’t as effective, and my collaborators didn’t benefit from the same level of clarity.
AAA only exists in the context of automated tests. This is a typical example:
[TestClass]
public class CalculatorTests
{
[TestMethod]
public void Add_TwoPositiveNumbers_ReturnsCorrectSum()
{
// Arrange
var calculator = new Calculator();
int number1 = 5;
int number2 = 10;
int expectedSum = 15;
// Act
int actualSum = calculator.Add(number1, number2);
// Assert
Assert.AreEqual(expectedSum, actualSum, "The Add method did not return the expected sum for two positive numbers.”);
}
}
It doesn’t matter whether this test was written before or after the feature implementation; it exists far from any meaningful conversation involving two people about the problem that needs solving. We wouldn’t see those arrange-act-assert blocks in a user story for conversation.
GWT exists in the context of conversations about scenarios of a user story. If a story describes the value of a feature that calculates results, we could see a scenario described like such:
Scenario: Addition of positive numbers
Given two positive numbers
When those numbers are added
Then the correct sum is calculated
That is a conversation starter. Depending on where the conversation goes, the scenario could be rewritten to include examples:
Given the numbers 5 and 10
When those numbers are added
Then the calculated sum is 15
Is that going to be turned into automated tests? Maybe. Maybe not.
By writing out very simple GWTs on a whiteboard during conversations, I have experienced the following:
- User stories change from high to low complexity and vice versa;
- UX/UI design discussions moving forward faster
- There have been fewer trips back to the drawing board due to presenting features to stakeholders and receiving feedback such as “nope, that’d never work because of…”
GWTs shorten the distance between the real world and code.
What about developer tests for technical things?
Yes, code is written for humans. Even when describing technical things, use plain English.
Seeing it from that perspective (people communicating and collaborating), I believe GWT is superior to AAA.
GWT helps streamline communication and collaboration with anybody, technical or non-technical. If everybody is technical, it also streamlines the conversation regardless of their levels of expertise.
