Showing posts with label Lean thinking. Show all posts
Showing posts with label Lean thinking. Show all posts

Thursday, March 17, 2011

What is Radical Programming?

What is Radical Programming?

It is a post-Agile software construction methodology which aims at order of magnitude improvements in value delivered through software projects.
The word radical has a Latin root radix.
Webster defines: (1) proceeding from root (2) fundamental (3)unusual (4) cool.
In that respect it recognizes that the primary source of all the value ultimately created through a software is the source code itself. It recognizes that root purpose of the software is to satisfy customer need.

Eight-fold way of Radical Programming.
Aim of any software is to create customer value. Aim of Radical Programming is to create order of magnitude returns on the efforts required to generate that value.
The eight principles of Radical Programming work together to achieve exactly that.
In today's fast moving world with multi faceted sales channel Software Product Line Engineering is the most sensible option. It creates multiple differentiated versions of product by using the same underlying code base and repository of components. As you can see it is component oriented reuse. 

1: Four Quadrants
Radical Programming uses a variant of Software Product Line Engineering that simultaneously undertakes parallel activities in four quadrant.
  • Quadrant I : Creating and discovering  Domain Model. All prototypes, spike solutions and various differentiated product versions reuse the same object oriented domain model.
  • Quadrant II: Product Assembly.Various differentiated product versions are constructed using iterative development. Rapid delivery of customer feature is the primary aim. The secondary aim is to achieve maximum reuse possible.
  • Quadrant III: Creating Platform code. Most products require common infrastructure and we spend significant time in developing productivity tools
  • Quadrant IV: Aspect Orientation.We also spend significant time taking care of global and cross cutting "aspects" like performance, security ease of use etc


2:Value Streams



Applying lean thinking to Software Engineering it envisions the assembly line where features are continuously "manufactured". A feature starts it life as user story and goes through various development stages of acceptance tests, precondition, post conditions, detailed description and test , design, implementation , unit tests and is finally released. Radical Programming considers software delivery as a Batch Process. Scrum and Kanban are used to deliver  the batch. Body of knowledge developed for lean thinking and batch management is then systematically applied.

    3:Code is Design

    Radical Programming treats Code as the primary expression of Design. It uses code centric approach to development where unnecessary documents are eliminated. Various techniques and concepts like Static analysis, Literal programming and Design by Contract are used. Code is re-factored mercilessly. 

    4:Standard Architecture

    One of the ways to achieve great flexibility and productivity is to use standard architecture with predictable interaction between components. N-tier service oriented architecture or plugin based architecture or pipeline like architecture. Emphasis is on implementation agnostic interfaces and loosely coupled interfaces so that components can be readily interchanged. There are many many design principles that can be seen in existing systems and design philosophies. Eg. Unix Philosophy, COM, N-tier SOA with REST etc, Many "component oriented" CMSes.  


    5:Data Driven Design

    One of the main principles of Radical Programming is to use data driven programming. This means program logic is driven by configurable data sets. Every argument that can be made for DSL is equally valid for data driven programming.

    6:Fractal Time Boxing

    Time boxing is a familiar concept, however time boxing is applied to various time horizons and product definition and planning is handled only at the appropriate level of details. Vision is defined on 1-3 year time horizon, the mission and strategy is calibrated every quarter and quarterly goals are achieved by series of monthly/fortnightly releases. At every "scale" the process looks similar because we deal with uncertainty, deliverable and work to be done at only the appropriate level of details. 

    7:Spiral Development

    Spiral development is different than iterative development. In the context of Radical Programming it means within a sprint product is developed by first building it in big chunks and refining it again and again. Rapid development and progressive elaboration is the mantra.

    8:Flexible Team Structure.

    In short it is a self organizing team with collective code ownerships and lack of silos. Developers sometimes wear SDET hat and sometimes volunteer to drive issues like product wide secuirty/performance etc. Load balancing is the matra.

    Tuesday, March 1, 2011

    Lean Wisdom: Software Design Spec is Muda





    Goal of any software is to create customer value. Aim of Radical Programming is to create order of magnitude improvements in returns on the efforts required to generate that value. There are two obvious ways of achieving that: increasing productivity and reducing waste. 

    Waste reduction is an effective way to increase profitability. The lean thinking originated at Toyota Production System. It is based on the idea of reducing three types of wastes viz. muda ("non-value-adding work"), muri ("overburden"), mura ("unevenness").
    There is nothing so useless as doing efficiently that which should not be done at all. 
    -        Peter F. Drucker

    Mistaken Identity
    For a long long time our industry has mistakenly borrowed construction metaphors. Result is our desire to write up a design document or complex graphical representations like UML. 
    In other industries like mechanical production or civil construction, we actually need physical (hard) material to build each new unit. This production requires workers, materials, tuning assembly lines, takes time and costs money. There is an inventory of physical things to manage. In a nutshell, production is a big deal. Mistakes in design cost money, rework and lots of pain. It is not simply a matter of undo a checkin it is lot more painful. If design of your car chassis is wrong, you'll actually have to recall vehicles and melt the car back into the steel and start over again.
    Now if you could find the problem before going into the production all you have lost is just time required to design that thing. That's why proper design is important and why 'building' is lot bigger deal than designing. 
    Compare all this to how we 'create' software: We start our "build' which in turn calls compilers. Once we have binaries we then 'publish' them- Ready for people to download (or copy) and install. It probably took us only a couple of minutes. From this point of view software construction is free! Remember we don't ship code, we ship binaries! If you found the problem before going into production all you lost was developer's time. If you have found a problem after production release you can release a critical patch - it won't be fun but you can at least fix it. Building software is nowhere close to building a car or a dam or a space shuttle or a microprocessors. Just type in make (or ant or nmake) and you have 'made' the software.

    Blueprints  
    Whenever we think of a design it reminds me of a blueprint. In 'hard' engineering designs are important. They really are. You can't argue with the fact that blueprints are absolutely essential to construction. Say we want to build a house.  I hope you agree with the sentences in bold italics (Remember these as you read because we are going to see if exact statements are equally true with software design.)

    • We want to make sure the architects and structural engineers we are hiring are professionals. That they have tested their design. That they have stress tested it for earthquakes, winds, snow on the roof. That they have made sure that it adheres to the building code.So on...design can be analyzed using different models.  
    • Once they create a viable design or a blueprint, from that blueprint they can estimate how much material they need. Project engineers can then create a project plan Eg.When to start laying foundation, when structure is erected, when flooring is done, when to paint etc. Each step takes time and really can't start before it's prerequisites are complete. In theory you can build a house one room at a time but that doesn't make much sense. So they plan the work for the entire house. They will then hand the blueprint off to the contractors, who will actually build them. Things can not be built randomly we need to understand dependencies between various stages.  
    • Going into Production is a big deal. It is a point of no return. Having good design before hand is important. Because once you start building, you can't correct design defects.
    • What about Design changes before going into production? They can of course change the design thousands of time before going into production. If something is wrong with the design like there are too many stresses in the beam or something like that they can change it. They can go through iterations until they resolve most of the engineering problems. There can be thousand iterations with the design itself and no one will complain, in fact it is encouraged.  
    • Again we want to customize our house. You know what I would like? I would love to see a 3D model so I can make suggestions. Shuffle rooms around, move columns around , change where I put doors and windows. Most of the times we can accommodate these things by changing design. Early in the game, showing mockups or models (i.e prototypes) to the customers is helpful.  
    • But at some point I need to stop and sign off on a final design. We now have a blueprint we can use to 'produce'/ 'build'/'construct' dream house. We need sign-offs only because construction can not begin before we finalize design.   
    • Now what is the best way to communicate a design ? Write up a design doc ? No! You draw a blueprint. Contractors, electricians, interior decorators, inspectors all communicate though blueprints. Why blueprint? Because that's the most natural way to communicate 'design information'. It is precise and "executable". Of course you must be able to read and understand blueprints but then everyone in that profession can do that. With medium like that you don't need yet another document describing the blueprint or design. Blueprint (i.e. Design) itself is actionable, quantifiable, measurable - it is executable.   

    But dude, for software engineering - Code is the Design!
    With the modern object oriented programming languages like Java, C# or C++, a well commented code is like a blueprint. It is self explanatory. You don't need a separate design document. Software Design Specification document is a Muda (waste) that needs to be eliminated.

    • It wastes valuable resource - developer time to write and review it.  
    • It is often stale, out of date and out of sync with the actual implementation.
    Assuming you write modular and component oriented software, all you need is a very high level overview of  what each module/component does and the actual code for it. No need for design spec! If act of coding itself is a design then all the following is still true. Except one thing production is not at all a big deal.
    • design (aka code) can be analyzed using different models. Eg. static analysis, code inspections, memory and time complexity, 
    • Things can not be built randomly we need to understand dependencies between various stages.  Yes indeed. That's why we right complex make files and build scripts. I'm not cheating here. We really do need to understand dependencies and a plan to 'build' software. It just happens that actual building is cheap.
    • Going into Production is a big deal. It is a point of no return. If production is 'building'- no big deal. If it means 'deployment', Yes big deal - but then we are not going to release software until we thoroughly test it.
    • There can be thousand iterations with the design (aka. code) itself and no one will complain, in fact it is encouraged. Refactoring? TDD?
    • Code (i.e. Design) itself is actionable, quantifiable, measurable - it is executable

    We should not waste time writing design documents. We should start coding. Because CODE IS DESIGN