Showing posts with label agile. Show all posts
Showing posts with label agile. Show all posts

Thursday, June 17, 2010

Owning the Architecture

One of the main principles in Software architecture is the fact that there is always an architecture. That is, there is no system made without an architecture in place. Good or bad, the architecture is, conceptually, the system structure, the organization of components, their relations and the relations they have with the system’s outer world. So, you cannot have a system without it.

The problem, discussions and disagreements come when we address the architecture actual handling. There we may find the position of letting the architecture “emerge” from the code written. Architect’s are sometimes decidedly marked for extinction, since they are not needed for development, simply because they do not “code“ but perform a Big Design Up Front that is useless at the end of the day (that is what that position holds as true, I disagree of course). Other positions often refer to architects as facilitators for high level design and decision takers regarding global and important issues. Yet, to others, architects are just highly experienced developers that should be helping coding, another level just above the senior developer.

The position I now describe here is the one I heartily believe is the one all architects should adopt. (Just because it is the natural one for handling the architecture.)

First, let’s see what’s been done so far…

How do you deal with the system’s architecture?Well, you can:
  1.  Develop, code and later on see what was created.
  2.  Define it (design) and then try to create it by development.
  3.  Forget about it. Focus on code.

As you can see, architecture will be always there, but it will grow wild in all three cases. Yes, case 2 also has problems since almost 100% of the time the resulting architecture is different (sometimes substantially different) than the one defined at the beginning. Common sense dictates that we should at least foresee the architecture from the beginning and start building it with code, keeping an eye on what that code is actually producing.

Now, no matter what you do, you end up defining an architecture. Either by planning, by designing, or by directly coding it. At the end, the architecture is defined by someone. The question is then who? (architects? Developers? The client?) And then How?  (coding? Designing? Deciding?). Common sense dictates again that all those roles are involved in the definition and creation. That means there should be a coordination, and a high end control of what is going on (not dictating, but controlling). That role is, of course, the one of the architect.

How does an architect control the architecture definition?Well, we have several stereotypes applied to architects, that we can recall:

  1. The documenter. Architects are seen as document generators, that are happy writing designs and other documents nobody reads.
     
  2. The technical Project Manager. Here the architect is the one managing the project at the technical levels. A technical lead. Sometimes a technical director. Some others a technical puppeteer that holds the developers strings.
     
  3. The Ancient, Know-It-All. This seems to believe that years will create a good architect, with unsurpassed knowledge. Many time this architect is seen in a Ivory tower, and some others it just holds the answer to all questions.

None of the above stereotypes really deal with the architecture control. Documentation may be an important tool to keep updated information of what the architecture looks like in a precise moment in time. There should be enough coordination and direction capabilities in the architect to manage the building process. And of course, there should be enough experience to make the correct decisions, coach, mentor and provide advice to coders and designers. Still, documents are not the final goal, nor the architect dictates directly what is to be done, nor he knows all and should not be at all difficult to approach.

So, we can say the Architect Owns the architecture. Owning means basically being responsible of:

  1. Knowing what the architecture is, looks like, in a moment in time.
     
  2. Adjusting the principles, decisions and rationale based on the feedback got from the development process (this includes the information that actual coding returns, plus stakeholder feedback).
     
  3. Rectifying actual coding and design if that breaks the rationale of the defined architecture.
     
  4. Make everybody included in the development process (that also includes stakeholders), participating on the adjustments and the architecture visualization.

It is clear now that the architect’s role goes far beyond that just imagine a proposed architecture at the first phase of the development process. It is responsible for the real architecture, the one built, at each step of the cycle. For that he will need:
  1. Visualization of the real architecture. It is out of the scope of this post to discuss how to do that, but one process I should mention is the “In Deep, Vertical Peer Review” that involves all three levels of review (strategy, tactical and operational) in all the phases, instead of just one review per phase.
     
  2. Rationale and goal validation. This process is very important, where we can validate the goals are still being achieved even if there are changes in any of the levels. For that, rationale is extremely important.
     
  3.  A trade-off process. Of course, it is impossible to always achieve everything. There should be a trade-off process that evaluates the options and resolves for the one that keeps the goals as unchanged as possible, and results in the least cost. This of course involves all stakeholders.
     
  4.  A cross refactoring process/redesign. All adjustments will change things. Refactoring is a way to improve things without changing actual behavior. The redesign may change behavior. The idea of the process is to try keeping the changes at the lowest level. That is, try first to adjust only code, without changing design nor strategic/architectural decisions. Then go up. The strongest change will require the architecture redefinition, with possibly the highest cost.

All this applies to all phases, including the quality assuring, deployment and acceptance.
How to do all that in different contexts and projects require a whole book. So far let’s simply summarize that:
  1. Architect deals with many tasks, including but not restricted to documenting, managing and deciding.
     
  2. The architect’s responsibility is to get an architecture done (meaning, built) satisfying the stakeholders goals. This requires continuous verification of goal and business value achievement.
     
  3. Performing all that goes far beyond just coding.

Conclusion: Owning the architecture means being responsible of its construction, taking care of all the complex processing that development requires.

Tuesday, February 2, 2010

Coding vrs Development.

Agile taste for working code over documentation may be misleading to some. As seen in many posts and discussions, it seems that it means no documentation at all for some people. For another group, it means you just need to start coding, nothing else matters. This post is to differentiate plain coding from development, and to explain that working code is more that just executable sentences.

Let’s start by saying that code is the description of a solution in some sort of language. I defend the position that the description of a solution may not be executable. That description is to be read sometimes by the machine, some others by humans, and some others by both. The description has to have an abstraction level. That is, based on the approach we use to describe and to whom, it may be machine language (assembler for instance) or a high level code like a DSL. And we don’t just write ones and zeros because we will need later to revisit that code, and be able to read it and to make changes. Bear with that in mind for later.

Development is not just coding. It involves finding the why in the business needs and decisions, deciding the how we will solve that, actually describe the solution (to stakeholders and to the executors), and verify that solution meets the needs.

One point to clarify here is the executors concept. A solution is not a chunk of code. A solution may be a complex system, that is software intensive. That means it is not just code, it usually contains processes, people, and many other elements. All together are the solution. And that system is to be built in development, not just the code part.

There are several other tasks that should be performed during the development process. As we deal with humans, you need to have people management. A group has always issues, problems, questions. Also, humans need material to work with. Meetings, information, computers, and many other assets. During the development, several decisions should be made, and not just about code: deliverables, QA scheduling, assignments, feature modifications, priorities, etc.

People needs to communicate. Creation of communications channels, management of those, coordination, moderation, etc. Some voices say all that work should be done by developers themselves. Not so sure about that. Some other say that is not needed, we just need code writers to write code. Not sure that works either.

So, so far, I believe development is far more a complex process that just writing code. And coding is far more complex that just writing an executable set of instructions for a machine (Description of a solution, remember?) Thus, I proclaim that coding is not the same as developing.  Let’s continue.

Going back to the coding definition. Some people think that a non executable code is waste. Specifically, design is seen as useless documentation, wasted time. Here then I start to defend what we may call design.

Non executable code is that one that describes de solution, but may not be read be a machine and may not be executed by it. As we mentioned before, the executer may not be a machine, but let’s assume the executable code is executed by a machine not to mess with concepts. Some of that code is the one generated as strategic and tactical description, aka, architectural description and design. If it is not executable, why do we need that kind of code? There are several reasons:
  • The ones to design are the developers, why? Because it is a description of the solution, and thus code.
  • Executable code is often done quicker when the ideas and major decisions are already made in the design.
  • When code is done, it is usually reviewed and almost always changed to improve it. Describing at design level is quicker than writing low level code, and thus fixes and improvements can be made earlier, saving time and effort (changing executable code, large portions of it, may have a great cost and impact).
  • Once done, the executable code should be verified. Checking against a high level description helps to verify. If it is different, then it means either the decision at high level or at low level need a review. It is important that both descriptions are kept in synch.
  • Why doing the work twice? Because they are different works. Description at high level is used at some time, and the low level description later. But both are used. Missing one means there is something in development that may have more cost later. See next point.
  • Development is never finished with complete code delivery. There are always enhancements, additions, changes. To decide why, how and what, it is always important to know what is done, how and why. Reading machine code means almost impossible changes. Reading executable code is possible, but at high cost. Reading a high level description, that was kept in synch, is great.
  • Design is not a documentation process, it is a description process that should be used through the development. If design outcome is not used, the it is waste. Design that is done trying to be complete before operational coding, it will also be a waste of time. Design should be made in regular chunks, not to little ones that misses the tactical view, not so big so that you end up making decisions with not enough information.
So, given the ideas above, I want to proclaim that used design is actually working code, and thus, if well done, complies with Agile thinking.

Wednesday, November 25, 2009

The Agile missing point and the Waterfall Illusion.

What if everybody is wrong? Well, not everybody, but majority.

Reading Kelly Water’s Post about “Agile Project Management: Avoiding The Waterfall” I came to think about this. Almost nobody claims today that they are following waterfall, because of the very bad connotation that word now has, but not actually because they understand what are they doing. Same thing for Agile followers.

From the post, I rescue that any process that has phases reassembles a waterfall. From actual presentations, blogs and discussions, Agile often means just following methodologies like Scrum, Lean or XP. Now I question: are we right about this? Let me see if we are, or not.

Waterfall is a term, it seems nobody knows who coined it, related to a phased methodology. Dr. Winston W. Royce wrote about it (without given that name), describing an ideal form that was not so good . The phases were the requirements gathering, analysis on those requirements, system design, coding, testing and operation. The ideal was each step may iteratively cycle with the next down and the next up, in little steps. The flaw was it was usually the case that testing will not just go back to coding, but it may go up till design, and from there, jump back to requirements gathering again. That flaw (the large back jump) was caused not because the phases, but because the testing phase is where the actual product is finally validated against design and requirements.

The problem is, there is no solution to this. We can dilute or minimize the impact of the testing findings, using several techniques, but we cannot avoid it. At any level, team or individual, the same steps are repeated: I see what it is needed, I analyze what is possible, I think on how to do it, I do it and finally I check if it works. That can describe the process of developer creating a simple three line method! That is, phased development is there, everywhere, and that is not the problem. The problem is when that phased process is done in a way that the impact of facing reality with needs is too big that multiplies the work and the cost of the back jump.

So, the waterfall illusion is when you think that rain is not a waterfall, simply because the raindrops are so tiny you don’t see them fall individually. But they fall anyway. It means, people that think eliminating the analysis and design steps and jump into coding breaks the phased process, I’m sorry, it doesn’t, it may avoid a large body of water fall into one place, but will make millions of little bodies fall everywhere. See the point?

Ok, there is another idea into this, and that is to make the water flow up. You start coding, with no idea of what you need, and then the phases are completed backwards. (Hey! If you want to start really backwards, then start by testing! Oh, yes, we have TDD). The code will make a design “emerge”. The next logical steps if to create requirements that match the design. Well, I guess that does not work. In that case, the requirements are still presented before coding. So the new phases are: requirements, coding, design, testing. Or, requirements, testing, coding, design, testing, coding, design, etc. Anyway, we always have phases.

Now, Agile. In the Agile Manifesto the idea was to value common sense upon theory. That is why “individuals and interactions were valued over processes and tools, working software over comprehensive documentation, Customer collaboration over contract negotiation and Responding to change over following a plan.”. Nowhere on those lines there is a mention of chaos process over phased process. Where is the missing point? Well, actually in three places.

1. Comprehensive documentation was assumed to be the design’s product. So, design must go, correct? Well, that is not true. The idea behind this is to prefer creating working software rather that documenting. Actually, creating working software requires you to think first on what do I need to create software for, how can I accomplish that, think how will I do it, do it and then check if it works. You can do all that without opening a word processor, right? Working software is not any software, but the software that delivers the business value, and that is not produced just by hitting keys.

2. Customer collaboration over contract negotiation seems to define the negotiation to be a non collaborative task. Actually, any customer involvement implies a contract (or mini contracts), which is the definition of what to do, and who will do what. Collaboration does not mean the client will bring coffee, or will help writing the code. It means active communication to shape the bush with little cuts. The client says the overall figure, then supports indicating the little branches you may cut further. Contract and mini-contracts.

3. Responding to change over following a plan does not mean going into chaos. The following a plan refers to follow a line without looking at changes in time. That is flawed thinking, the plan may perfectly be to respond to change in an organized way, validating each time to improve the next one. The plan is simple: we decide as we go, following these principles.

All the above is in the principles.
“Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.”
“Continuous attention to technical excellence and good design enhances agility.”
“Business people and developers must work together daily throughout the project”
And
“At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.”

Now, let’s talk about project managers and architects.
I understand many agilistas think they need to disappear. Yes, YAGNI. Architects are document creators and thus have no business in Agile. Project Managers are plan followers thus they are not welcomed in Agile world.

Of course, that is not correct. I mean, the stereotype many people has about architects and project managers. In a team, you need different roles. If you have only coders, and all people just code, you have an incomplete team. Roles are not fixed either, you can have four, ten, twenty different roles in a team. Each person performs a type of work, needed to complete the main goal.

So, does that mean Architect and PM are roles? No, they are professions, and each one plays a role in the team. And no, an architect is not the one to write design diagrams, and the PM is not the one with MS Project under his arm telling everyone how to type its code.

An architect is the one that owns the architecture, that is, knows what the structures and organization of the functional elements and other architecture issues, are. Not only that, he is responsible of assuring the business goal is met, either changing the code that builds the architecture or changing the architecture to match the code.

The PM is the one in charge of measuring everything, keeping an eye on evolution, times, resources needs, organization of meetings, pending issues, team problems, process glitches, and a long etc, so coders wont need to worry about those things.

Closing this long post, I can summarize:
1. No, there is not only waterfall and the good guys. Water is falling in all projects, we need focus in minimizing the bad effects.
2. No, agile does not mean following a methodology and getting rid of good guys like Architects and PMs, but understanding the common sense of the manifesto and apply it to improve development.


Cheers!

Quick Post Edit: Reading at this, you may think I believe all Agile people thinks the same. Well, no. I was practicing agile principles even before the name was coined, and find out those are misunderstood by a lot of people. Fortunately, not all of them! So, Agile is the way to go.