Skip to main content

Posts

Showing posts from August, 2012

Unit Testing

Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended. It is important to write the unit test code early and update it as the application code changes. Unit testing is very important in all phases of the development cycle. Unit Testing: Benefits Finds Problems easily              In test-driven development, unit tests are created before the code itself             is written. When the tests pass, that code is considered complete. Facilitates change             Unit testing method allows the program to change in the future and             make sure that it works properly. Simplifies integration             By testing the parts of a program first and then testing the sum of its...

Python : Basic Conventions

While we write any code, the predominant matter to be noticed is that the readability of our code is very much important. Even if our code is logically correct, it is not considered to be perfect if it is difficult to understand. It is said that our code is read much more often than its written. So here are some very basic conventions to be followed while writing any python program. Python Enhancement Proposal(PEP)  8 describes the style guide for python code. Reading The Zen of Python will be interesting as well as informative before you move on. Indentation Use four spaces per each indentation level Preferably use only white spaces for indentation and never mix up tabs and spaces Continuation lines should align wrapped elements either vertically using Python's implicit line joining inside parentheses, brackets and braces, or using a hanging indent. Limit the maximum number of characters to be 79 in a line.         ...

Git: Some Basics

Git is a Distributed Version Control  System that records changes to a file over time so that you can recall specific versions later. The main advantage of Git  over other VCSs is that we can do most of the operations in Git offline and hence Git is a much faster VCS. Using Git, our files can reside in any one of the three states: committed, modified and staged. Committed means that data is safely stored in the local database Modified means that we have changed the file but have not committed it to the database yet. Staged means that we have marked a modified file in its current version to go into the next commit snapshot. Installing Git and Configuring the settings: To install Git in Linux, we have to run the following command:    $ apt-get install git-core  To install Git on various other operating systems, please refer to more details After installing, the next step is to configure the settings where you have to provide...