Have you reach a place where you no longer find any solution to your problem. You have been debugging your codes for hours yet you made no progress. It’s time to challenge your assumptions.
Assumptions are actually important as they simplify the problem we are solving. However, not all assumptions are correct and necessary. Moreover, some of them are hidden yet influences our decision making particularly when coding.
On the backend, I was recently working on joining two Sequelize models in an e-commerce like application. I just needed to write the model classes, add them to the current Sequelize instance and specify the type of relationship, one to one or one to many.
After this process, using Postman, a API development app, I retrieved the joined data as expected.
My colleague then requested me to accept a merge request of his latest changes and merge them into the develop branch.
After doing so, on regression testing my JOIN feature, I was greeted with a strange error. Model B was not related to model A. I had to specify the relationship, which I already did.
Not knowing to exactly how to approach this problem, I spent the next two to three hours trying to understand what went wrong. I glanced on similar issues on Sequelize and TypeScript Sequelize, to no avail.
Next morning, with a fresh brain, I checked my codes and experimented with different variations of the relationships - changing from hasOne to hasMany - which indicated that Model A could have several Model B.
The codes worked again. The data could be retrieved as was the case earlier.
Maybe out of tiredness, I assumed that the problem was everything but my codes. I still don’t specifically know why it worked earlier; perhaps the data set was limited (I implemented pagination earlier).
What's the Idea?
The way we treat assumptions when solving problems are fundamental to succeed or fail. Sometimes they are in plain sight, other times hidden.
We need more effort to locate them.
Basic Way to challenge assumptions
- For a particular problem, identify the assumptions and make a check list for each
- Determine if the assumption holds true
- If correct, check it and proceed to the next.
Whenever in doubt, ask questions to get more information on the subject. You can write them down for yourself to analyse and answer - or ask your colleagues, especially the decision makers such as the Project Manager.
- Do I clearly understand this task?
- Do I have enough information to proceed?
- Dear Bob, I did not understand the requirements, can you give me a scenario?
You can also use the technique below which forces you to think differently.
Assumption Reversal Technique
- Write down list of assumptions, even the ones you think is correct
- Write the opposite of each assumption
- Write down new ideas based on the reversal of those assumptions
- Use these ideas to experiment on solving the problem.
Let’s use this technique as a way of illustrating my problem described above.
List of Assumptions & Opposites
- My codes are still working after the merge | they are no longer working after the merge
- The Database connection is valid | the connection is no longer valid
- The Sequelize models are complete | they are missing
- I’ve read the Sequelize docs and know everything | I’ve read most of the docs but missed a lot of important features
“Ask questions; don’t make assumptions.” Angela Ahrendts