Vijay Krishna's Notes http://vijaykrishna.posterous.com Most of my notes as a student of computer software and everything around it. posterous.com Thu, 17 Feb 2011 17:37:25 -0800 Code Integration http://vijaykrishna.posterous.com/code-integration http://vijaykrishna.posterous.com/code-integration It has been a week of thorough introspection and rough hours at work. With ever changing requirements and demands of the software world and its clients, i guess any developer goes through this phase early in his career. The phase where he not only has to produce good code but also keep changing it as per those requirements, and fast!! And all the while, you have to produce bug free code. So what is the secret? How do you keep writing good error free code, with the fast paced changes? Well, let me break the bad news to you: No one can write bug free code in its entirety with significant changes in the software model/requirements being made every other day. But here is the good news: You can reduce the number of bugs by being careful about the changes that you incorporate in your software/code. And this whole process of being careful is called Integration testing. For those of you who treated STQA (Software Testing and Quality Assurance) with little or no respect during your engineering/undergrad days, bear this in mind: You will regret it, for that is the final barometer of a good coder. So, if you did not pay enough attention to that aspect of development, you still have the time. And yes, it is an integral part of code development itself. While many may feel that it is the job of the testers to actually test out code, i fundamentally disagree. Until and unless every form of testing, which the testers do at a more sophisticated level, starts at the developers' desks at a very basic and rudimentary level, you can never produce good software. Never! Don't testers have to learn programming languages, in the basics, to start testing the code? Then why can't developers get some basic levels of testing done at their own end? And it really does not have to be a very daunting task. Here are two very basic guidelines anyone can use to get that basic testing done right from the very beginning: Assuming you are a decent coder, most of the mistakes you will make is while integrating features or different code modules with your software. Take care when you do this. Remember integration of code is not a mathematical addition of the number of lines of code in both modules. Rather, it is the multiplication, or the product of the number ways the data streams going in and out of both these modules will start to interact with each other. How these data paths join together gives rise to new scenarios, which you would not have considered before. Try finding those scenarios. There is always something new. And that is where most bugs reside. It is easy to work in a localized context and develop small modules of code. The idea should always be to think of how, what you code will, effect the over all scheme of things. The other equally important way to counter unforeseen issues in such integrations is to write decoupled code as far as possible. Thus, in its pure essence, a lot of trouble can be averted, if one were to write independently functional code, to begin with. There should be a middle ground (fragments of transformers) where the mappings or collaborations between these sets of independent modules of code should be performed. This also localizes the errors as well. If the modules by themselves are working well, (and this can be unit stress tested), then all you really need to look at as a developer/tester is how the transformer code is really doing. Thinking of your code structure in this way will also give you some ideas about how software should be designed. These are two very radical approaches, one which relies on the fundamentals of testing, while the other relies on the foundations of designing principles. While most coders i find crib about not being able to be a part of the designing process, i wonder how many of them design their own small modules of code, in the best manner possible. Coding is least about writing lines of text in a particular computer language which generates fancy outputs. It is about writing good logic, in a readable manner, which can be well managed thus resulting in easy verifications. I think that every piece of code deserves all of these elements to their core. No Exceptions!!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1369599/pic.jpeg http://posterous.com/users/hcGXxsTkwP6SS Vijay Krishna Palepu vpalepu Vijay Krishna Palepu