Start practicing Shoshin

When you were a child and wanted to learn something for the first time. You chose to learn it from others with an open mind. Take an example of painting the picture. You could experience this when your kids try to mimic you while learning something the first time.

(My daughter Shruti tried to paint the butterfly. She was eager and tried to accept every information with an open mind)

When you acquire knowledge about something your mind becomes more closed. Over the period of time, you become reluctant to accept more information.

I hope you had experienced this at least once. When you try to give suggestion to improve processes like stand-ups, grooming, retrospective or some other agile process, the senior person would refuse to change since he/she thinks that he/she knows everything.

He/she choose to kill your suggestion with her/his closed mind! EGO?

I was introduced to this term by my agile coach when I was working with Tieto education Pune.  Initially, I was not very convinced or sure about it, preconceptions!

(Image: http://kungfupanda.wikia.com/wiki/File:Mantis-Po-acupuncture.png)

However, over the period of time, I saw good behavioral changes in me and my scrum team.

Shoshin clearly encourages good behaviors in you and your team. See below description from Wikipedia.

“If your mind is empty, it is always ready for anything, it is open to everything. In the beginner’s mind there are many possibilities, but in the expert’s mind, there are few. ” ― Shunryu Suzuki

I started attending various agile and software craftsman ceremonies with an open mind like study circles, knowledge sharing sessions, refinements, the storytelling of epic work items and so on. It really helped me and my team to grow as a scrum team.

Believe me, if you choose to practice below-mentioned attitude (SHOSHIN), it will really help you in the long run.

  • Openness

  • Eagerness
  • Lack of preconceptions.

I would highly recommend practicing Shoshin mindset in your team. Even you could include it in your way of working.

(Image: https://www.deviantart.com/keysamoguri/art/Inner-peace-301041283)

See what James Clear says about SHOSHIN: https://jamesclear.com/shoshin.

https://blog.beingcraftsman.com/datta/

Agile Economics : How decisions impact cost?

Cost is one of the important corners of the Project-management triangle. This factor is especially important for decision-making from business perspective.

Let’s look at one of the techniques that will help us take more informed decisions about various operations we as developers do.

Consider a scenario when we have to automate the deployments in your project. One natural approach these days, is to automate everything. But let’s take a closer look at the things more closely.

Let’s put some numbers on a graph. On the X-axis we have the percentage of automation done in the project and on the Y-axis we have the cost needed to automate it.

Let’s put one more graph on it, that of “doing things manually”, indicated by green curve.

As it turns out, the cost of doing everything manually is too high. It would require a step-by-step manual intervention many personnel (typically Devops). So if we have 0% automation in our project, the cost of doing everything manually is quite high.

On the other hand, the cost of automating everything, every single step is also high, since doing this will take a considerable amount of time and effort for developing it. (indicated by orange curve)

However, if everything is automated, the cost of doing deployments manually tends to be zero, we can deduce this by comparing the curves.

Now let’s do something interesting. If we add the values of these 2 graphs, at every single point, we would get a curve of something like this (indicated by dotted red curve)

This red U-shaped dotted curve, indicates the total cost if the deployments are done in combination (manual and automation). As you can see the cost tends to be minimum at Point(X,Y).

We can therefore infer that you should:- “Automate X parts of the system by investing Y amount in it“.

Why is this statement important?

Simple, cost. You don’t want to overspend on one particular aspect of the project. Instead prioritize things, (which in this case is X %) and automate them first. And then if you have time, money and will, go for the remaining (100-X)%.

Find your minimum dropping point. It could be way off on either sides. But having a rough idea of where you stand, can help you optimize your business.

Please note the above curves are approximations for explanatory purposes, the actual values may vary, scenario-to-scenario, team-to-team…..

This technique can be used in many other decision-making processes, such as “How much code coverage should we have?”, “How good product quality we want?” and so on…..

The most important part in this thought process is “Prioritization”. Do not plan big upfront. Instead, go step by step. Look where you stand after regular intervals and then do course corrections accordingly. After all, that’s what “Being Agile” means….

Don’t add unnecessary context

This is about a class, which has fields and methods whose name repeats the class name.

Please see the below class diagram for a student.

Looking at the class diagram, it’s clear that this whole class is all about the student. However, do you think repetitively adding the word “Student” in fields and methods really adds value?

Don’t you think it’s redundant?

It reads more like

  • The student has a student name.
  • The student has student birthdate.
  • Get student age of a student. It reads like a weird sentence, isn’t it?

We already have the student context, hence adding words repeatedly is redundant.

Let me show you the revised class diagram.

This one removes the redundancy. 

It reads more like

  • The student has a name.
  • The student has a birthdate.
  • Get the age of a student.

You may come across such redundancy when working with code. Identify it and remove it.

Next time, “Don’t just add unnecessary context”!

Another example:

Student repository

Don’t repeat the name of the class in class’ fields and methods.

Just don’t be mute pair programmer

The motivation behind this post was, I saw few developers who do full time or part time pairing with their peers and driving the process, choose to be mute for the whole time. Of course, this is an anti-pattern.

If you choose to be mute rockstar coder then it wouldn’t help anyone neither you nor your team.

If you see food shows on TV, you’ll observe that there will be two people working together (I used the word working TOGETHER).

You know there will be one chef who knows how to prepare the dish and other chef doesn’t know about it.

They talk with each other about the recipe, ingredients, do’s and don’t, what, how and why and so on so that the other chef gets the knowledge. Next time, the other chef could easily prepare the dish. During this process, the first chef would know few tips from another one.

You see the secret of their success is they talk with each other about the problem at hand.

The same thing is applicable to developers who work in a pair for full time or part-time.

As a developer, our peer may be facing some problem and when he/she comes to you, you should do the same thing as these chefs choose to do, just don’t be mute, talk, work together!

You should talk about the problem at hand, why, what, how and so on. There is a possibility that as a driver of the process, you would learn something new from another developer.

Even one of four values of agile and software craftsmanship emphasize on individuals and interactions. Please see below.

From agile manifesto

 

From manifesto for software craftsmanship,

https://blog.beingcraftsman.com/datta/

 

 

Web resource

A resource on the web is everything that could be uniquely addressable/identifiable. A resource is a fundamental element on the web.

Resources are things I want to interact with on the web;  It could be web pages, images, files, audios, videos, static resources (CSS, js…), an e-mail, information from various data sources like databases, SharePoint servers, and web services, location on google map and so on.

Earlier, a resource was static file or document. Now it has gradually evolved and nearly everything that can be obtained via the Internet is termed as a resource.

URI (rather URLs) are used to find/identify/locate a resource on the web and MIME type (media types, a two-part identifier for file formats and format contents transmitted on the Internet.) to specify the representation of the resources.

The web and HTTP are both all about resources.

Everything was designed to just make things work. So that different systems (Unix like OS, Linux, Microsoft Windows, Mac OS and so on), different platforms can easily work with each other.

Example of resources:
https://en.wikipedia.org/wiki/Main_Page — Web page
https://en.wikipedia.org//static/images/project-logos/enwiki-2x.png — an Image file
https://upload.wikimedia.org/wikipedia/en/3/3d/Sample_of_Daft_Punk%27s_Da_Funk.ogg — Audio file
https://www.google.co.in/maps/place/Pune — Location on map
https://www.onlineshopee/items/ — Collection of items
https://www.onlineshopee/items/123e4567-e89b-12d3-a456-426655440000 — Specific item

IMO, Resources on the web are as important as Objects in object-oriented programming.

Once you understand this terminology, everything (HTTP, REST, Web services and so on) based on this concept becomes easy to understand.

https://blog.beingcraftsman.com/datta/

Why Definition of done is required?

On Friday morning, Shrikant, the Manager, came to Naveen, the software engineer, asked about “Password reset functionality”.

Naveen had implemented the “Password reset functionality” using test-driven development and replied to Shrikant that he had checked in the code into TFS.

So, Naveen with a great smile said: “Yes, the feature is Done“.

Shrikant was happy and said “nice, let’s deploy it into the staging environment for client’s review”.

However, Naveen was hesitant and looked doubtful since the use cases and the code was not reviewed by another developer and QA was still waiting for his turn to verify the functionality in QA environment.

Ah! Who is responsible for this situation. Who is right or wrong?

You may come across such a situation.

This situation may occur because everyone (developers, reviewer, QA, and product owner) could have their own version definition of done.

One person, ‘done’ may be ‘deliver a feature in production with ZERO bugs’.

To me, it will create use cases, prepare the design, follow TDD practices and so on.

To the product owner it may  be “meet the need, get it verified against business rules”.

Remember the definition of done is a comprehensive checklist of necessary, value-added activities that establish the quality of a feature.

Below is sample definition of done:

  1. Prepare use cases that will cover use needs.
  2. Write code that covers all use cases.
  3. Peer-reviewed (or produced with pair programming) and meeting development standards.
  4. Unit tests are written and passing.
  5. Builds without errors.
  6. Code checked into TFS/git source control.
  7. Deployed to test environment and reviewed by QA.
  8. Passed UAT (User Acceptance Testing) and signed off as meeting requirements.
  9. Any build/deployment/configuration changes implemented/documented/communicated. (Database changes etc.)
  10. Relevant documentation/diagrams produced and/or updated.
  11. Remaining hours for the task set to zero and task closed.

To avoid above situations (mentioned in the first paragraph) in the team, it is very important that everyone knows and follows guideline mentioned in the definition of done that was created by the development team and product owner so that features get delivered completely with good quality.

https://blog.beingcraftsman.com/datta/

Effective stand-ups

Stand-up is considered to be the most important event in Scrum. Although there are numerous guidelines on how to run effective stand-ups, here are some of the tips based on my experience.

Why Stand-ups?

  1. Stand-up’s offer a means to share and build a knowledge base in the team. It’s a 2-way channel, as in, “Every problem is TEAM’s problem” and “Every piece of information is TEAM’s property”. Over a period of time, it helps the team develop good capability to collectively solve problems, thereby building “Self-Organizing teams”.
  2. They are necessary for promoting transparency which is extremely important for retrospection and improvement.
  3. As a side note, not everybody in the team is same. Some people are introverts. Everybody should get a chance to express themselves and get involved. Working in isolation has adverse effects in software development.

Here are some of the tips to improve the stand-ups

  1. Come prepared:- Most basic, and also the most overlooked thing. Come prepared about what you are going to share in stand-up.
  2. Be attentive:- Once you finish talking, do not get distracted. Maintain focus and listen carefully to other team members. This shows that you respect others and are eager to get involved. Plus from a career perspective, solving other’s problems can take you a long way ahead.
  3. Start it daily at a fixed time:- Some amount of discipline is necessary in software development. Although, sometimes it is ok if someone misses a stand-up due to unavoidable reasons, after all we all are humans 🙂
  4. Have quality discussions:- Although Scrum says a stand-up should not exceed 15 mins, it is better to focus on quality than quantity. It is ok to go into details of things, it helps everybody learn from each other. If someone faces a similar issue in future, they know where to look for and whom to talk to.
  5. Maintain a sidebar:- If the discussions go for a long time, take it offline, and put them in a sidebar.
  6. Maintain a board:- Although there are many ways used by teams to look at the work of current sprint, (such as TFS board, Jira board), IMO nothing beats a simple whiteboard. The main reason for that is you can customize a board as per your needs, add more columns, maintain more important information, stick more stickies for things which you feel are important.
  7. Retrospect on stand-up:- Reflect on the way the stand-up is conducted and run. Is it adding value? What are the pain points? Can we use our scrum board to help the situation improve? In one of the teams, I worked for, failing regression tests were a serious and frequent problem. We decided to put that number on the board in bold and red. We also decided to fix at least 5 tests per sprint. This lifted the transparency and people passing by the board took notice of that. Soon other teams also discussed this in their stand-up and joined in our efforts. We reached the stage where all tests were in green with the collective effort.

Asking “Why?” and seeking the answer for it is the most crucial step in any process. The most junior member should feel comfortable to question the most senior person in the organization. Things don’t work just by telling or imposing them. The one’s involved in the process should understand the “Why?”. This will establish a permanent connection between people and processes.

Object oriented thinking, the big picture

I see my recently graduated friends solves consumer problem by the procedural way (writing everything in a single class or a method) using object-oriented programming language.

In this post, I am sharing what and how I think while solving the consumer problem, The object-oriented thinking!

IMO, as an object-oriented designer, I divide the big problem into smaller ones. I provide the solution for small problems (concerns) using objects. Eventually, these objects communicate with each other by sending messages to solve the consumer’s big problem.

Let me explain it with the help of the use case. (We will consider the server-side solution)

Problem statement:

As the new user of the system, I want to register a user account.

We would consider only two fields on the user registration page, Name, and Email and sign up button.

Use case:

User can create his/her account

  • As a user, I navigate to the registration page.
  • Enter name and email.
  • Choose to register.
  • The user account is created.
  • Email is sent to the recipient.

The user cannot create an account when a name is not provided.

The user cannot create an account when email is not provided.

Solution:

As a developer, I need to provide the solution for these use cases. (I know there could be many alternate cases, however, let’s keep it simple.)

Clearly, there are different concerns that need to be addressed.

IMO, we need a class:

  • To validate the user inputs.
  • To create a record in a database.
  • To generate email content.
  • To send user registration email.

Thus, I would divide the concerns into

  • UserValidator class that validates user inputs and gives an error for validation rules like the name is required, email is required and so on.
  • UserRepository class that takes user entity and insert records into the database.
  • EmailTemplate class that generates the email content.
  • EmailSender class that takes email content and sends the email to the recipients.

UserController class that does the following stuff and try to solve the big problem by sending messages to the object of the above classes.

  • Verify the user inputs.
  • Create a user in the database.
  • Get registration email content.
  • Send registration email.

Note: To convey the intent, I kept this design as simple as possible. We could give more clean solutions like outsourcing the responsibilities of the controller (Keep controllers as thin as possible) to model classes and so on. Please feel free to share your feedback with me.

You can observe, The proper object-oriented design would divide the big problem into the smaller ones across classes. Solve small problems in order to solve the bigger one.

https://blog.beingcraftsman.com/datta/

Naming boolean variables

The boolean variables in codebase should read more like a question that answers either yes or no.

If it doesn’t answer you in ‘yes’ or ‘no’ format, then please revisit naming.

Below are some of the bad examples which feel like commands and I don’t think they are really answering the question in either yes or no format.

Dirty

  • emptyUrl
  • openFile
  • startJob
  • closeConnection
  • logIn

They feel more like verbs/actions/commands. For example emptyUrl. In my opinion, it conveys that it empties an URL. Similarly, openFile seems more like a command that opens a file.

Let’s see some of a good example of naming the boolean variables.

Good

  • isUrlEmpty
  • isFileOpened/hasFileOpened
  • isJobStarted/hasJobStarted
  • isConnectionClosed/connectionClosed
  • loggedIn

Are these variables answering in yes/no format?

While naming boolean variables, you could use verbs like is, has, can, was, contains and so on that could be part of a variable name.


More Examples:

  • isAdminUser
  • hasInvalidCharacters
  • canUploadFile
  • wasPackageDamaged
  • containsBadWords
  • containsDamagedItems
  • shouldCreateSession
  • isComponentMount…

How writing use cases can help you

During my initial career in software development, I was directly jumping to a programming solution without doing problem analysis.

I still remember sometimes I had missed some of the functionalities since I haven’t done the proper analysis.

I and my product owner were having too many discussions.

When I worked with the education team in Tieto, I got the habit of analyzing customer problems. During analysis, I choose to divide the customer problem i.e. requirements into use cases.

I choose to share it with my product owner before starting the coding. 

Since then I have been writing the use cases before starting the coding, why? See these benefits.

  • You could anticipate whether estimation assigned to a story/work item is correct or not and can raise the flag within the team.
  • You could easily break down the work into the small minimum viable product.
  • You could get better ideas about use flows like instead using a button in grid row, we could use a toggle button.
  • You could create a happy path, unhappy path, edge cases, and alternative flows so that you would not miss any cases or functionalities.
  • You could easily track the progress of the story/work item.
  • You could give clear updates in daily standups as I worked on use case#1 yesterday and today will finish use cases# 2 and 3.
  • You could anticipate the code changes in advance against all cases.
  • You could anticipate the blocking dependencies say for example you’ll need an answer from the product owner.
  • As a developer, it would help you to write tests against these use cases.
  • As developer/QA/PO, you could do functional testing against the use cases.

I would recommend you to go through

Use cases in Wikipedia

Agile Use Cases in Four Steps by Matt Terski

In my humble opinion, try to write very lightweight use cases instead of the very descriptive essay.