When the word cloud comes to our mind, we think of big white fluffy fantasy. But technically, cloud is the big white hard drive which stores bulky servers and all your information. It’s cool to think how someone else is managing everything and put the data whenever and wherever you want to store.
Security might be an issue, you want to consider. But it’s nothing compared to the scary thought of cloud service going down. According to ACM article, regular bugs were pointed in seven coding constructs of the function calls, assignments, conditions, pointers, uses of NULL, variable declaration, function declaration and return statements. However, the scenario in cloud is very different.
Bugs developed and pointed at initial coding and integration. Bugs discovered before the deployment like early release candidate and final testing of the product. Bugs found after the product deployment, which are usually not fixed by the original developer.
The first group consists of logic errors, these can be detected through tools and automated testing. While the third group of bugs is a result of miscommunication,incomplete documentation, failures in memory, incorrect error handling. Basically no software can fix them which makes your product disastrous.
Given below are some common bugs which we encounter in cloud environment and these are some best practices to resolve these bugs. These are:
The developers need not work in six programming languages at once, even in the most successful cloud platforms. Languages are always a choice. Now, try sticking to one language instead of changing language frequently. As debugging in cross-language is too much of work.
Suppose you are working with Python and there is a great math library there, but you don’t know how to use it. Instead of exploring and using it, inviting unnecessary bugs rather encapsulate it as web service and call it through REST.
One more thing some languages are more likely prone to errors than the rest. Choose languages with strong variable typing and automatic memory management with garbage collection. This will help you avoid bunch of unnecessary bugs.
An alternate solution to this problem can be opting for higher languages. So if you are good working with languages like Ruby on Rails, then you might simply make lots of problems disappear, making your programming lot more easier and less painful while detecting bugs.
Bugs detected after the deployment of product are the worst kind, these will be detected and fixed by someone else, not you. As at some point of time they may want to extend the product’s functionality. But this can be made a lot easier by little tips and tricks.
Always opt for simple expressions and methods. Using spaces liberally and line feeds make detecting bugs easier. Now having comments in a code or not is not a big deal. But writing wrong comments is a complete no. Similarly, always update comments before checking the code. If you find it difficult to maintain, then your’re changing them.
Just to get things done quickly, developers avoid some basics as they might be working on many languages at the same time. So remember before any action always check the basics. Some of these are mentioned below:
The final tip is to root out data overloading which was once used as quick fix for the code, but currently has no other work than inviting errors. Also there are some logical operations which shelter bugs more than average. Some of these cannot be avoided. Instead try developing test codes.
While using Nested IF/THEN/ELSE statements try using CASE instead of SWITCH. Be careful while avoiding Compound Booleans especially XOR, NOT, Less Than or Greater Than. If the language you are working on do not have primitives for Day, Time of day and Date then use Day/date calculations, specifically the ones which include weekends and holidays. Avoid using calculated indexes for arrays and lists or calculated branches. For example, like GOTO is a complete no.
Use library for 3D coordinate transformations and Geospatial calculations.
Use spaghetti for dinner, not for codes, I guess this quote holds true here. Although cloud keeps code inside web services, this doesn’t mean you can just make it long and complicated like spaghetti. Especially when the modules are extended for things that was not considered during initial construction time.
So here’s the tip, always opt for profilers and network traffic sniffers. This will help you detect chatty web services that may hint to methods which need refactoring. The final spaghetti is seen when the deployment of changes are not complete within different modules.
Use a single source code for all the code, resources, web services nodes and everything. Maintain a checklist of all the steps especially Rollback at the deployment stage.
Yes, in this hi-tech era these issues may seem generating from the last century, but can’t help it. We have to realize the complexity and issues related with cloud environment along with its privileges. These are just some basic tips and tricks to avoid bugs while in cloud as the environment is still being explored.