Mar 4 2010

The Gap between Agile Methods and Agile Development

Category: Development Tools | MethodologyJonathan @ 03:33


Agile Methods are a people-centric way of running projects where increasingly teams are accepting that it has tremendous value. However there is more weight put on the code for an Agile Method based project, as with more deployments, milestones and iterations, there is either a need for more refactoring over time, or a more future-proof design is needed. However both refactoring tools and greater predictive powers on the future of the code are both valuable tools.

However, if the software being crafted is not of an equally high and maintainable standard, the project can also fail at being more agile, (just like a people-centric approach can fail with the wrong set of people, irrelevant or bad design can affect the iterations and deadlines).

The software design should also be crafted in an Agile way, to support the Agile Method governing the people. However, being more agile in code does bring in some side affects.

  • An increase in software abstraction
  • An increase in configuration and meta data
  • An increased requirement for intelligent design
  • A more controlled, standardized, patterned and convention based development environment

Currently though, I see a gap between the Agile Method and the code written within the project. ie. the relationship between the agile software and the Agile Method.

There are many reasons why teams using Agile Methods could fail and I include design and coding into that list.

I believe that:

If being more agile is being more 'adaptive' (rather than predictive), then being more agile in code, needs the counter-weight, which is 'predictive', rather than 'adaptive'. I believe code should be more predictive of future changes, the more adaptive the business becomes. The balance of the two concerns is where you will find a good software system with happy clients. It is all the balance.

Tags: , ,

Jan 20 2010

Interface Phasing

&


On the concept of contracts and contracts, I think we need "interface phasing". Having a phased relationship between two parties.
It is imperative that objects and at a higher level, an Application, can change the way they interact by who or what is accessing them.

 

An object should present itself differently to different audiences. Imagine a developer seeing a specific interface, but not a user, or IDE vs developer. Its not role based, because it could be different per application to application communication, although a similar effect can be achieved.

The concept is simple.

I think that coding today suffers from

  • Repetitive nature of structural elements: for example: creation of large Object Models, classes, properties, collections and so on.

  • Creating Object models with no separation of Context or concerns. I want an object to 'share' code, but for different reasons. Cross-Cutting. Yes, I can create a new object and share code, but that's not always the answer. Imagine two object models, where one is a Facade of the first. I want to simply map the one to the other, not create the entire structure for it again.

  • Different ways of extending components. Different ways of creating add-ins, Custom B2B, Adaptors, Bridge patterns etc. It can all be made easier, if we used a "Global extension object system"

  • The 'under the hood' 'abstractions, keep changing - not for the better or necessarily for the worse, but for no distinct benefit.

  • Contractinitis - Nothing works unless its all explicit. In .NET, can't call the web service with your Person Object, cause its not the same namespace etc.

 

Create automatic and dynamic proxy layers based on metadata and intention of communication. The code is then 'assembled' and made ready for the communication. The code is assembled from existing non contextual code that can fit into a common proxy container and interact.

On a simple level, imagine, you create SOA like methods, stateless and they are formulated by the runtime into a new object that looks like the one required.

This is not the complete answer, but we really need to get to 'smarter relationships' rather than contracts.

See Lack of MetaData on code and .NET Framework libraries

Read Evolution, Architecture, and Metamorphosis - A great piece of work.

 

Tags:

Oct 19 2009

The Agile pendulum has swayed too far

Category: Frameworks | MethodologyJonathan @ 09:12

Being an agile developer has meant a lot to me. Over the years, I have tried to get those around me, more agile, more iteratively focused, more quality, result driven and so on, but I fear it is growing askew.

Agile is on the cusp of becoming so customer, service and result focused that quality, reuse, robustness and many other facets are getting less emphasis.

Agility can be a weakness too.

Everything is balance, and I can see two problems amounting.
1. More and more are 'Agile' without actually seriously changing their ways, or actually being agile.
2. Becoming so focused with being Agile, they turn full circle, back to all the clutter there once was.

A micro or macro manager will always have their different approaches, and Agile is not a fix for either. It is a careful balance between the two.

Tags: , , ,

Sep 11 2009

What is Production Code and how do

Category: .NET | Design | Design Patterns | MethodologyJonathan @ 08:36

... you know when you have it, or not?

You see it written in code samples: No warranty, please take care if you use in production environment. This is not production code, but what does production code really mean?

Firstly production code can be any code that is in use. But that does not refer anything about quality. Just because software is on the shelf, does not mean its good quality.
Production code must have some sort of quality level.

Amusingly the DSDM pocket book, (Atern) says that "it must be good enough" - which makes me laugh, then cry.

Quality is subjective yes, and quality costs money. So what should production code be?

The following is a list of heuristics for referring to code as production code.
  • More than 40% of your application has Unit Tests
  • At least 3 or more people have spent time actively seeking bugs, for longer than 30% of the time it took to originally write.
  • At least 3 or more people have been actively seeking bugs, in at least 5 different configurations/environments.You have mixed the environment (different server, different database name, altered culture/region, etc).
  • Bugs have been solved with SolvingDesign (A lasting solve)
  • Code Regression is reduced, practically to a stand-still. A ratio of 50 bugs solved per 1 reintroduced is a good ratio. 5 bugs solved for 1 reintroduced is a terrible ratio.
  • Users have used the code for at least 40% of the development time taken, reporting bugs, and the system recompiled and redeployed at 5 times during this period. (preferably at intervals, so input can be recalculated)


Influence that will present itself, and cause you into thinking its production code, before its not.
  • Deadline and other pressures
  • Reactionary mindset, rather than pre-emptive
  • Bad company software creation intelligence (what else can you call it?)
  • Human traits, inexperience, carelessness etc


Tags: , ,

May 6 2009

The Every Project Framework - Part 2

Category: Design | Design Patterns | Frameworks | MethodologyJonathan @ 05:25

In The Every Project Framework - Part 1, I spoke of partitioning, and abstracting structure and infrastructure. Now Let's talk about how we do that.

Over the last decade, the most prolific and available Architectural Pattern introduced and adopted by business developers is the Layers pattern. Call it by another name, but the concept is around everywhere. Most enterprise systems have open or closed Layers. They have many names, but Data Access Layer, Business Layer and so on, are often used. This a good thing towards raising the level of abstraction, increasing the infrastructure and providing more structure. However, having layers, does not automatically mean your application is on a good footing.

Raising the bar

If you are very skeptical, read the 'Why' section below first.

What do you think of your objects? How do you think of them? Are they transportation, containers, db table wrappers or other? Majority of business applications I see, have objects as a 1 to 1 mapping to a database table and it effectively is a container for a row of data. Some then wrap it into a collection of these rows and you have a table. Is that really what you need? is that efficient and good practice? Does it raise the bar high enough?

The first thing to say is that wrapping your table into an object is not entirely bad, as it is a level of abstraction away from the table.
However, if its at the highest level of abstraction you go to, then you will still have miles of code that you need to place elsewhere. Code such as Context, Security, Permissions, work flow and so on. If you manage all of your Types as a 1 to 1 mapping to the database tables, are you not merely writing code against the database?

If its UI (form) accessing and using -> the DataType Person, then your level of abstraction to the data is almost zero. You have abstracted the concept of a database table and replaced it with a more crude version, which you are populating.

Then the relationships and structure between all these singular Types will slowly come together within your UI, behind your button, in some method of some obscure class. Instead, the singular classes should be a little more structured and the bar should be raised higher, providing your UI with more closer, ready and easier to use objects.

To repeat in more a programmatic way, consider a table named Person.

If you have your UI --> Types --> Table

effectively you have abstracted a Row and Column concept away from the UI and replaced it with a PersonType and a PersonTypeCollection.
That means the UI, must understand how to deal with these Types.

To raise the bar, you would have more abstractions between UI and database
perhaps more like so

UI --> PersonCompositeType --> transaction(PersonDataType1/PersonDataType2) --> Table1/Table2

So PersonCompositeType is at much high level.

Please note:I am not saying that your architecture must look exactly like this, what I am suggesting is that more levels of abstraction can be achieved between the UI and your 1 to 1 mapped Type, that is so commonly found.

Why?

Have you ever had the following in your last or current project?

The UI is a lot more work than writing the "engine" or "business layers"!
Well of course it is, because the level of abstraction for the business layer is so low.

Your project starts quickly, progress seems to be made at speed, and then it slows right, right down....
It would, because, laying out database tables, getting your SQL and business objects in a 1 to 1 mapping is easy. Tying these low level abstraction together into a working application is harder.

Are you using a workflow engine? Are you using a business rules engine? Do you have isolated, stateless services? Do you have wrappers, commands, actions?
If not, then all the workflow, business rules, services are tucked away, most likely in your user interface. If you don't think you need these things, your large projects are most likely failing, running late and/or getting harder and harder to maintain.

Closing thoughts

If you think in "the ways of frameworks". Not as a framework that will be released to the world. Not as a time consuming lets focus on the framework, but rather build it, partition it and expand it within the project, your application will benefit from having more structure and more infrastructure.

Even having one of those is vastly beneficial. That is why a company with their own libraries (infrastructure), can get an application up quicker, even if its not a framework. One or both infrastructure and structure is vital for reuse and time to market. Yet, there is very little training going on at university, or courses in this area.

We should be training developers from their earliest years in software to think about reuse, to understand patterns, and putting rudimentary frameworks together.

Don't let the fact, that there are no perfect frameworks out there, lure you into thinking frameworks are bad. They are just diamonds in the rough. Most importantly, the "good" aspects of frameworks can be used within your application to high rewards. But how do you do it? -- stay tuned...

Tags: , ,

May 1 2009

The Every Project Framework - Part 1

Category: .NET | Design | Design Patterns | Frameworks | MethodologyJonathan @ 07:11

In The Every Project Framework - Introduction, I spoke of structure and infrastructure, lets now move a little deeper.
More...

Tags: , , , ,

Apr 27 2009

The Every Project Framework - Introduction


Do you think of a Framework as a large 'hole, to be avoided'? Are they too complicated to develop within your project, for everyday development?
I take the view, that a Framework can very easily be part of every project you build, and with great benefit. You just have to understand how.

A Framework has two very important characteristics to give to Applications. A Framework provides structure and infrastructure.

More...

Tags:

Apr 9 2009

Refactoring complex classes using Composition Part 2

Category: .NET | c# | Methodology | Refactoring | Visual StudioJonathan @ 04:07

Please Note: Please make sure you have proper unit test coverage on your classes, as you refactor.

From Part 1, I showed you how I initially split a large class into a few more, splitting the complexity of having the code in one place. However, you will still find that for a really complex class, there will still be quite a lot to do. Here are a few more composition based things to consider for continuing the refactoring process.

More...

Tags: , ,

Apr 8 2009

Refactoring complex classes using Composition Part 1

Category: .NET | c# | Methodology | RefactoringJonathan @ 04:09

Please Note: Please make sure you have proper unit test coverage on your classes, as you refactor.

Using Design Patterns which deal with compositional power, such as Wrapper, Facade, Adaptor, Bridge, Proxy and others are extremely useful for breaking large classes down. Rather have 10 smaller classes than 1 large one.

Well here is a very simple start to how to get your refactoring of that large class under way. Please be sure to compile your project after each step, to fix any errors, before moving to the next step.

More...

Tags: , ,

Mar 30 2009

How much should you design Upfront?

Category: .NET | c# | Design | Design Patterns | Methodology | Visual StudioJonathan @ 07:22

FeelGoodFactor

I follow the FeelGoodFactor principle. Requirements at first glance can be cloudy and messy. It can ambiguous and abstract, or it could just be plain daunting. However, you need to list what you can, and the attempt 'solves'. By solves, I mean a logical route to a solve, a prototypical solution to that problem, or at least common consensus by a few good men (cough). You need to get most of the areas in your head sorted, and then commit a bit of that solution in your head to paper and a review by your peers.

More...

Tags: , , , , ,

Mar 27 2009

A Simple Software Design Methodology


No matter what software development methodology you adopt, you will always be faced with 'design' that is between good and bad, between necessary and unnecessary, between complicated and over-complicated. Design, even if it is technically good, can have disastrous effects on the project, if implemented incorrectly, or creates discord within a team, misunderstanding. In fact there are so many reasons, it would be better just to tell you what good design is. That's if I could, but I can't!.
However, I can say that Design is one of the most important factors for a project, it influences time lines more than anything else. Underdesigning, or overdesigning, neglecting to think ahead far enough, not including certain implicit requirements can all add days and weeks to a project.

Most of the time, its in your hands

A project requires thought and understanding. It takes a wide range of thinking outside of the box, thinking realistically, but yet being extremely open to ways of improvement. Here are three activities that will definitely aid your methodologies, skydiving and chess and music.

More...

Tags: , ,

Mar 24 2009

Future Proofing your Application

Category: Design | MethodologyJonathan @ 09:06

Software lifespan types

  1. StaggeredRelease
    We develop versions and patches and roll them out periodically.
  2. ContinuousLeak
    We fix and create mini patches, live alteration, component replacement, live into the environment. Typically its developed by in-house staff, developers and/or support.
  3. OneHitWonder
    An App created and used, more or less with no problems or errors. Seems to be around for a while, and then fades away. Typically a utility, which has very little value, and soon gets replaced or irrelevant. Typically a quick utility written by someone on inspiration, but with little time to spend on its up keep.
  4. RewriteEvolution
    An App released again and again, but always with the knowledge that it will be rewritten and/or always seems to get rewritten. Typically where there seems to be little justification on spending a lot of time on it.
  5. ConcreteBeast
    An App, that is not liked or really wanted at all, but seems to be impossible to get rid off as too many things are dependent on it. Typically a piece of software installed before you got there.


More...

Tags:

Mar 20 2009

D4 Software Frameworks

Category: Design | Design Patterns | Frameworks | MethodologyJonathan @ 09:03

Effectively, here is an Index to the pattern language in draft.

A Pattern Language for Designing, Developing, Documenting and Deploying Object-Oriented Software Frameworks




D4 Software Frameworks
More...

Tags: , ,

Mar 19 2009

A point about AgileDesign

Category: .NET | Design Patterns | Frameworks | MethodologyJonathan @ 07:00

Two comments came through to me regarding AgileDesign. It was pointed out that Agile is a loaded term, and perhaps I should look to rename it. Another aspect mentioned to me in an email, was that Extensible and Agile are probably the same or too similar to be different principles. The thing though, is that my AgileDesign, is exactly "Agile" Design, and although Extensible and Agile are both concerned with change, there is a very important difference between them.
More...

Tags: , ,

Mar 18 2009

Software: LackOfEvolution


The majority of Software is quite multicellular. This sounds quite good, but in fact, its not even a small insect yet. or one could argue they are at the bug stage. Software tends to be rude, uncultivated, and unevolved, mainly due to LackOfEvolution.

One of the significant aspects of this, is that focus is granted to the development of the initial project, and then a handful of people (or if you are unlucky, just you), who are burdened with supporting it afterwards. This basically means "bug fixes until death" and lots of phone calls and emails later, you lose the lack of thought and action, but the software does not evolve. Software suffers from LackOfEvolution

Why do I say this
I say this because the vast majority of software only undergoes one full life-cycle. It may then get a smaller cycle of a patch or update, but most do not go to version 2 with the same code base. Version 2 tends to have very little of the original team members, and the code may very likely have completely rewritten areas. Version 3 even less of anything original. It may even have a new technology or language that it uses. Developers also enjoy writing their own code, rather than using other code, so this makes it easier to rewrite.

solution?
The problem is that the software does not get time to age, mature and be cultivated.
We need that extra time. An extra cultivation iteration is needed in all software teams, on any project. Create a planned version 1.1. Get your full team to conduct a special maturing cycle, where they add a few features, refactor code, shuffle things around. Plan it properly just as you would the first life-cycle.

LackOfEvolution for Teams

Software Teams can suffer from LackOfEvolution also. Developers can sometimes get caught in a project and not learn new things while they are busy on a project. You get to the end of a two year development and realize a few things have passed you by.

solution?
It is vital to stimulate debate about code, to have a trainer in for a day, to get show and tell sessions by members of the team, and other useful activities to counter act the stagnant waters. If you don't do SCRUM, have a SCRUM week, where you follow SCRUM for the week and evaluate it. Have a CompetencyFramework fro all developers with a plan on their evolution within a project and technology. We all need evolution, of character, skills and understanding, it is how we get better.

Tags: , ,

Mar 11 2009

ReuseSplit

Category: .NET | Design | Design Patterns | Frameworks | MethodologyJonathan @ 05:16

Not spliff, split.

ReuseSplit is simple.
Getting true reuse takes time, and effort, and thought, but with ReuseSplit, you can achieve a good percentage. It also provides a focus for reuse, where it can grow.

Two (Inter)Faces "if you are as two faced as momma always says, why do you always wear that ugly one?" - anon

Generalization and Specialization. Split your code out into these two (inter)faces. The Generalization should be contained within a separate project. The Specialization within your current project.

Its not revolutionary, its simple. However, the majority of code in the business looks like Specialization only. Then perhaps what is common, then perhaps something reusable. However, by ReuseSplit, you are immediately doing two very important things. You are splitting what changes from what does not, and you are developing with reuse in mind, which creates separate code for reuse later, which means you are developing malleability into your solution as well.

Generalized

When we say, lets create a "Generic" something, we mean something that is versatile, more or less common, more or less reusable, more or less specialized.

By generalizing, we convert, "The quick brown fox jumps over the lazy dog", to "the (adj) animal jumps over the (adj) animal".

Now we know we need two instances of an Animal class, and some descriptive attributes that can be applied to the Animal.
This does not mean inheritance, it could be implemented in any sort of way, its the separation of Animal and Fox that is key.

Specialization

If you need a specific Fox, then build one, using the Animal, whether by composition or inheritance. The Specialization then feeds the Generalization. If it is common move it down.

By using this technique, thinking about ReuseSplit with everything I do, I like to think that I make an extra 10% of reuse on code, without thinking. Like driving a car, I don't think about it as I am doing it, however, reuse is usually higher, when I hit a project.

Tags: , , ,

Feb 27 2009

Pai Mei Software method

Category: MethodologyJonathan @ 05:51

Pai Mei Software Method.
It is Your honour and His Duty.

In my last podcast with Uncle Bob, he mentioned the Apprenticeships and Martial Arts model for programming.
I really like the idea. Having a Sensei to teach you the ways of the enlightenment. So I have decided to write down the first draft of some Teacher/Student principles.

Teacher

When a student does something different, it is because they did not understand your request, they did not understand how to fulfil your request, or they have discovered another way they think is better. In all cases, discipline is very much needed.

Listen first to your student, hear what they have to say, they might have something valuable to contribute. However, since you are the master of your techniques, your student should now be whipped.

If your student asks questions, the correct response is "your question does not make sense", followed by quick assignment of more bug fixes.

Demonstrate your technique to your student. A percentage of your lessons will be taught silently, by example. But largely by a firm bamboo. Around 2 cm in diameter.

You should try to inform the student of their progress and praise them when they do something correct. This wont take much effort as it won't happen often.

Student

Pick the your Teacher wisely as there is no turning back.

Obey your Teacher and do what you are told at all times, accepting all punishments
Work harder than needed, work faster than needed, be diligent and vigilant. Coffee could be required at any time.

Make sure you have pride in your work, your Teacher and your new knowledge, as now one else will.

Spread the words of your Teacher, and question the techniques with care, as you may be beaten.

You will never be ready, unless your Teacher says so, and he might not.

Even when you feel down, accept your fate as the lowly dog that you are.

One day you will rise and become a Teacher, but for now, learn and be inspired. You can take your own out on your students.

Now find your Pai Mei or Obi-wan Kenobi and learn his ways. It is Your honour and His Duty.

Tags: ,

Feb 25 2009

Our Software Methodology Nightmare

Category: MethodologyJonathan @ 02:23

A software developer's hats

I have been buying a lot of hats lately. Real hats, and some nice ones too. I have around 22 hats now. But although the average developer only walks to the bathroom, occasionally, and otherwise sits quite still, I think we probably have more hats to wear as software developers.

We know the usual ones, coder, tester, documenter, team leader, mentor, but there are lot of them that we don't really think about that often. All these hats make it hard to understand what methods should be applied to a team of such diverse people, doing such diverse activities, albeit comfortably sitting in a chair. There are other hats we wear.
More...

Tags: , , ,

Feb 23 2009

Software Development Methodology Tool


A software development tool, capturing project data you can use, no matter the methodology.
However, the word "metric" must now cease. I don't like the word at all. I don't want the useless "10 0009 lines of code of which 5 000" is comments rubbish. I want a tool that actually provides me with valuable info.


Here is my idea for a new development tool extensions, plug-in or add-in. Whatever your lingo, a tool that provides real understanding of the project code. A tool helpful to both developer and manager.

Objective

To provide the Developer, Lead and Manager tools they need to evaluate performance of their current project and previous projects. Towards this purpose, the background tasks of the visual studio environment shall be monitored, for the purpose of presenting value to the team.

Graphs

- The following data captured and presented over a time period graph.
- Classes Created/Removed (methods, properties, fields, events and all the rest)
- Project Assets Created/Removed (Projects, Configuration files)
- Refactoring (when code is moved around, refactoring menus clicked etc)
- How fine grained is the project? A formula using the code stats

graph

Events as MetaData (The attachment icon above represents it)

Two kinds of Events, manual and automatic. Both configurable.

Manual Events
A developer has a small toolbar, with a Create Event button. The developer can press the button, and write a comment at any time, creating a piece of attaching MetaData. So when a server goes down, or when the team system server goes down for some reason leaving people stranded for 2 hours. It is a marker of that event occurring.

Automatic Events
When a certain amount of code lines are reached, without refactoring, raise event.
When a certain amount of classes, functions, methods are created, raise event.


One important aspect, is to be able to compare project to project. So the data should be exportable or comparable to another set of data.

Tags: , , , ,

Feb 23 2009

Software Development Until Done

Category: .NET | c# | Design | MethodologyJonathan @ 06:56

I am touching some code at the moment from a past employee. I cannot say the code is bad, nor that he is at fault. But, the result of half cooked code, is that it takes longer to understand, longer to set up on a new machine, longer to debug, longer to find and fix errors.

I have some brains, but still after 4 hours of delving into a project that utilizes a web service, DotNetNuke and some other projects, could not find the database, then source was checked out, code was duplicated in places (not sure which section was to blame), configuration files named, "development.config", "web.config", "test.config", "x.config", "y.config" made it impossible to find out which things was expected. I have yet to find a single paragraph on what was intended by certain portions of the code.


This is still on going, driving me crazy. I will probably be busy with it for a few days now. More...

Tags: , ,