This is an article that came out of a workshop I had with my super talented team at PaloIT as we start a greenfield Java project for the Government.
A quote from a very smart friend of mine, Jayesh Salgaonkar, struck me the other day as we were talking about Test Driven Development. He posited that:
This struck me as a realization that we as developers, learned to focus on creating and problem solving but weren’t taught how to ask questions.
Through the years, I value inquiry more and more. To the point where it’s sometimes annoying (Thanks socrates). I’ve also embraced the fact that there is value in questioning, and value in knowing what you do not know.
As I started a new project that will improve the lives of many, I wanted to start and understand if I can improve the lives of the people I work with first.
I reached out to a very skilled and experienced leader, Kean Lin, to get us into a virtual room with the objective to learn the concepts of Test Driven development together.
Out of that workshop, the team learned about the history and the RED-GREEN-REFACTOR cycle that is the gist of Test Driven Development. But I took away something much bigger out of that short time.
We had a fun exercise of doing a hot-potato test writing around the game TicTacToe. The requirements were:
What I saw was a struggle of each individual in starting to write and think about what to test.
So the following week, I came to the team again with a different objective: to give a framework on how to start looking at requirements and start an inquiry to determine what to start with.
The writing framework above is agnostic to whatever test you are doing. Unit, Behaviour, Integration, or End to End. It does not need any tools but it does require you to change how you think.
Now, how do I improve my writing process now? How do I apply this?
Let’s look at one your tasks right now:
Asking the questions above would already vastly improve the type of tests you write. You just have to take time to do it.
The framework above gives you ways of starting how to write effective tests, but how do you measure effectiveness? There is no one way to measure an effective test as codebases evolve over time and organizations have different definitions of quality. What you could look at are the following:
It would be ideal for you to determine the measurement at the start of the project, or keep it as mantra. My personal one is “test only what’s important, focus on value”.
Writing tests on their own is valuable and it should be for all developers and organizations. However, cultivating a culture of testing and inquiry should be explored more in conjunction as it will improve the quality of the work made.
Stay safe and stay indoors everyone.