Sunday, October 01, 2023

Different Software Worlds

We talk about best software development methodologies, best processes, practices, designs etc but have we ever wondered that there are entire different worlds in software development universe ? So much so that certain principles, guidelines, metrics have total different meanings and emphasis on each of these different worlds. 

Quality concerns, limitations and design constraints could be vastly different across these world that we simply can not discuss about one 'best' process or methodology at all.

A well thought of article on the subject can be found in here Joel Spolsky has written this more than 21 years ago. In that post he talks about 5 different worlds Shrinkwrap, Embedded, Internal, Throwaway and Games.

While the article is so good and eye opening, we could little redefine these worlds to match with the current landscape of software development. You may need to read that post before continue further..

I would get rid of Throwaway type since it's not a industrialised, large scale or collaborative type of software. Would also get rid of Embedded type for two reasons. One, most embedded software these days can be upgraded online, from our mobile device drivers to electric cars. This make embedded software also bit similar to mainstream, also this type of software is probably bit rare too. Certainly less than 1% of all software development.

That leaves us with Shrinkwrap, Internal and Games. For this set I would add SAAS/PAAS software and the fifth world, Apps. Now, shrink-wrap is more or less a readymade product to be used by many. How about enterprise software development targeting a particular organisation ? I mean by external service companies which are specialising in this kind of development so it does not cover under Internal type. For instance, a solution provider may get selected via a competitive tender/bidding process for that project which would then last few months or years involving maintenance and expansions. 

So I would say 6 worlds. Each of these have different demands, quality concerns, design needs and different constraints and limits, some architectural and platform related while some others could be financial, time and legal.

Now, to the important question : what development methedologies / process will work best in each of these worlds ?

Or even more important : Which of these worlds am I in ?

Open for discussion..


  


  

Monday, September 25, 2023

Is Agile becoming the new waterfall ?


Agile or Lean Development soundly emerged as the more practical and effective approach towards software development, beating the age-old Waterfall methodologies.


Today everybody follows agile and it's now even not the buzzword anymore, it's the only word there is. The de-facto methodology for software. Fame and becoming the mainstream, comes with it's own dangers though.

Early adopters and pioneers followed agile for a reason and with passion. They had first hand experience in rigidness and overheads of Waterfall. They understood why Agile is effective and embraced the spirit of it. They knew why they were using it and more importantly, what to avoid.

New followers on the other hand (at least a sizable portion of them) follow it just because it's the main one there is. They have no experience doing things the inflexible waterfall way. With this kind of followers Agile also can become like a religion. Sometimes religions are followed as mentioned in the scripture, out of faith, to the letter and oftentimes while missing the very spirit of it. Same is happening to Agile.

Ceremonies, retro, reviews, backlog refinement are followed as per the book. With numbers, faith and with unquestioning meticulousness. Spirit of Agile suffers a silent death at the hands of this heavy handed process and overheads.

When process overtakes the spirit, the very reason why Agile came into existence in the first place is being forgotten. 

Another common issue is that the high level business decisions are taken upfront, delivery dates determined and then forced onto development teams who then try to implement those in the 'agile way'. It is understandable that in some scenarios, we may have to work for a set plan, but following a plan is not the strongest point of Agile or what it is designed for. (check item 4 of the manifesto below)

What happened to the 'working software as the primary measurement of success' for instance ? Instead, we are once again embroiled in all kinds of metrics, numbers and what not. Success is more often and blindly measured by velocity or burndown, without a proper look at 'working software'

Let us read the Agile manifesto once again. Let's remember the spirit it was written in. Let's not allow Agile to become the new Waterfall !

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

This is what I signed for in 
24 Jun to 23 Jul 2005 I was among 49 signatories who officially embraced Agile in that month.
https://agilemanifesto.org/display/000000046.html

and here is the full (but fittingly very short) Manifesto: 
https://agilemanifesto.org/

PS : After writing this, I searched the web using the title of this article just to see whether there are similar thoughts. Turns out there are many. Following are two well written ones. (much better than my short rant here)


Wednesday, March 08, 2023

A program to solve WORDLE

WORDLE is a popular word (English vocabulary) and logical game. If you haven't given it a try yet, may be you should do now. It's quick, simple, interesting and beneficial.

Ever since I started playing it, I wanted to write a program to solve it and compare my personal performance against the program. I had an idea how to do that (from my earlier experience in writing a program to solve the similar but way more popular board game, Mastermind) but had to wait until I find a time and after that another long wait until I find a time to write about it. 

Anyway, here goes.... 

WORDLE game uses 5 letter meaningful English words. Some dictionaries give more than 150 000 such words. However, WORDLE use their answers from a selected list of 2309 words.

Once the system selects a random word, our task is to guess it in as fewer attempts as possible. For every attempt, the system will provide us more information by marking the letters in our attempted by green or yellow. Green if that letter is there in the chosen word in the exact place, yellow if the letter is present but in a different place. Following is an example, here we have taken 5 attempts to guess the word correctly.


So how to get a computer program to logically arrive at the correct word ? We have to feed it all permissible words first of course. Then we need an efficient algorithm in applying some deductive reasoning. Can you come up with an approximate quick solution for starters ? 

Think a bit, take few minutes may be...

....

....


Ok, here a clumsy but a working try. Starting by all 2309 words (problem space), we can :

1) select a word in random from the problem space and put that as an attempt

2) gather given information (green and yellow) on our attempt

3) Use that information to calculate which words within the problem space can be eliminated

4) Clear the problem space by removing words which can be eliminated by the step 3 above.

5) Go back to step 1 for the next attempt.

This will surely work, but no guarantee whether we arrive at the solution in the fastest manner possible, perhaps we can even exceed the given limit of 6 attempts. 

How to improve on this ? Take few more minutes/hours may be..

....

....

....


In the first solution, we chose a word by random. Obviously that's a place we can find some improvisation. Instead of randomly select a word, we can find the word which could give us maximum useful information. 

In the first solution, we managed to eliminate some words from the problem space using the information we got for our attempt. We can count the words which can be eliminated for a given input for a given attempt. 

Ex: in the image above we have the attempt 'ARISE' for which we have got the input of 3 yellows.Using the step 3 of the first solution, we can calculate how many words we can eliminate from the problem space for the input of 3 yellows. More importantly, we can calculate this for all other possible inputs as well! That is : number of words which can be eliminated if we get the input of 2 yellows, or if we get 1 green and 1 yellow etc. 


By the way, what are all possible inputs ? 5 greens of course is the end condition. 4 greens and 1 yellow is just not possible. We are left with following:

[4 green 0 yellow]

[3 greens 0 yellow], [3 greens 1 yellow], [3 greens 2 yellow].

[2 greens 0 yellow], [2 greens 1 yellow], [2 greens 2 yellow], [2 greens 3 yellow].

[1 green 0 yellow], [1 green 1 yellow], [1 green 2 yellow], [1 green 3 yellow], [1 green 4 yellow].

[0 green 0 yellow], [0 green 1 yellow], [0 green 2 yellow], [0 green 3 yellow], [0 green 4 yellow], [0 green 5 yellow].

That's it! 19 possible inputs in all.

For any given possible attempt we can find the number of words which can be eliminated for each of these inputs. Then we can find the worst case, which is the input which will result in eliminating the least number of words from the problem space. This worst case count can be used as a measure for a given attempt. 

Now we do the same for another word in the problem space. Find it's worst case, then do this for another word etc. We do this for all the words in the problem space. In the end we can find which word has the best worst case count. This word can be our next attempt.