Home > software > when will you stop coding and start designing

when will you stop coding and start designing

I am recently challenged in my software development work with above statement which I have not understood clearly. This is because I never considered these 2 as separate activities. In quest to understand these 2 activities, luckily I read a very thought provoking article, “Code as Design” written by Jack Reeves way back in 1991.

It emphasizes the same points which I observe in my software development work. The article however true it may be, is not generally accepted by many software experts. After short summary of his ideas below, we have to look at what changes are required in our current methods to implement his ideas.

“Code As Design” Summary

In short, it compares software engineering with other engineering fields like construction and explains what are shortcomings in Software Development Life cycle.

A software development life cycle or SDLC has 4 significant phases: Requirement Analysis, Designing, Coding, and Testing. The general perception is that when compared to construction engineering for example, the Software Coding phase is equivalent to the actual building phase of Construction engineering. ie the Coding activity means implementation of the Design document. This is the point, to which Jack Reeves has disagreed.

He argues that, in other engineering fields the design activity, includes the process of validating and testing the design document by using various mathematical proofs, mock-ups, and simulations before actually handing over the design to the implementation team. In software design activity no such process of validating and testing the design takes place.

There are 2 main reasons for it. One, Life of most Software applications with a few exceptions is more volatile than other engineering products. And Two, Proving the Software Design using simulations and mock-ups is costly compared to just coding the design.

So the design document in other engineering fields is a proven good design, whereas – as Jack Reeves puts it, the design document in SDLC is not a very good design, but design it is. It is this fact which is accepted by Software Industry, not allowing it to be a disciplined science.

If we were to agree that the design document is not the final design in software development then it implies that, Coding and Testing activities are going to affect the Software Design document, and final design document will be generated only after the Code and Test activities are complete. The final master design document is the “Code” itself with auxiliary documents like High Level, Low Level Designs, data flow diagrams etc. that explain various concepts which cannot directly be explained in code via data structures and algorithms.

The building phase of software is merely the compiler building and linking the application based on the design document which is the “Code”.

To further emphasize this idea, he reasoned that “C++ is getting popular among programmers because it is more expressive language. Any advancements in Software development will directly depend on the advancements in Programming languages”.

Methods

As real and practical the above ideas are, there is hardly any formal software development methodology which implements it. Requirement Analysis stands out as distinct phase, whereas Design, Coding and Testing are separated with blurred lines and dependent on each other.

Designing:

Most SDLC methods enforce more time to be spent on Designing and after that start Coding. Until the design is clear, not a single line of code should be written. And many experts argue that if Coding team just implement the design as given without hacking it, SDLC would be more like other engineering process. But we know the software design document is incomplete because it has not been tested or validated.

The changes in design document are bound to happen once the coding or testing activities start. So it is necessary to start coding and testing as early or as synchronously as the design activities start.

Once requirements and functional specifications are documented, we divide the application into various smaller applications or modules. The relationship between these sub-components is captured in system architecture. The system design may capture only the inter-relationships between the sub-components and the data-validation checks, but these are also not necessarily final as there is no testing/validation happening to prove the correctness of these documents.

Coding:

Each developer or a team of developers is assigned a sub-component for which they prepare high-level design. We have observed that the High Level Design doc, UML diagrams do differ from the final software code which is developed. So what is the use of these pretty diagrams when the actual code works differently. Also it is because of this reason that a software company is going to find, replacing a developer most costly. Companies would be in much better scenario if a formal activity existed after code and bug-fixing completes, to get auxiliary design documents from the Developer who has written the code.

The most important question for developers is when to start coding. Actually, there is no silver bullet answer for this. Sometimes, a little extra thought on design before actually coding can save hours of rectifying the mistakes, and sometimes even after weeks of designing and brain-storming, we may actually miss some scenario which will come up in testing or after the deployment.

You can look at some articles on Coding Methods which i found useful: software design principles and No Silver bullet  in software development .

So the only real answer here is that Code – Data Structures, Methods,  must be written in such a manner that it can easily be changed or replaced. It should be modular and must follow the patterns which we all read about on the internet. The success of the project lies on this single “Coding” activity, so it is necessary for people who design the system to be  involved in coding of all the critical parts of the system.

We now have so many languages and platforms, C#,Java,Rails that have all been popular because they have been even more expressive than C++. So it is absolutely necessary for today’s developers to think of how his/her code affects the overall design of the system. Any reason which a developer in “High Level languages” gives about coding not as design activity has not understood his job as Software Engineer and Programmer.

Testing and Bug-Fixing:

Any good developer loves identifying the bugs in the code and fix it while keeping in mind various variables and modules its going to affect. This is because Testing and Bug-Fixing is a high engineering activity. To fix a bug you are changing the code, which means that you are changing the design of the application. Have a look at some of the debugging tips here.

It is no shame that testing and bug-fixing take at least 50% of overall time of SDLC because it is the only place where entire system design and code built until now will be validated and tested.

To summarize this method has to enforce 2 points.

1. Developers have to acknowledge that the system design is not a final design and is subject to change. Code must be done in a modular way to handle all future changes.

2. System Designers have to validate their design by testing the completed code and suggest changes.

3. The best approach is that a person who have designed a component of a system, codes it.

Agile and Prototyping methods are the only methods which come close to implementing these ideas. They ensure that coding starts in the early phases of Software Development and people who are involved in design are available for development.

A lot more discussions and ideas are required to solve this crisis.

Advertisement
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.