Now what is this Git?

It is an open source version control system. So why do we care? We already have subversion. Here are few points which might get you interested.

It is a distributed version control system – which means every user has a complete copy of the whole repository locally on his/her box, I mean everything with complete history and thus the ability to track the revisions without going to a central server. It brings in the advantage of looking at a file history offline and in no time. It also brings in a side effect of having the repository backup at so many places.

Branching and merging comes in naturally – Since every check out in a way, is a sort of branching by itself, the whole process of branching and merging for Git can be compared to checkout and commit for may be subversion.

Offline and Extremely fast – Remember there is no network latency as everything happens locally, as the local copy on a box is a full-fledged repository. So no matter what we are doing, committing the changes, looking at a previous version of a file, looking at the history, performing a diff or anything else we do not need a network connection to the central server and it is damn fast.

Does need a small space – If every user has a complete repository on his/her local box, so obviously there is a concern for the size of it. Fortunately the way it is packed it is much smaller in size then may be subversion.

Not yet good support for IDEs – Not yet quite there to support most of the features from IDEs like eclipse or may be a windows explorer extension which we have for subversion. Although it does provide command line tools and graphical interfaces like git-gui

Tracking binary files – Git considers each merge of a binary file as a new file and thus do not support tracking and history for such files.

If these are not enough to arouse the interest, may be looking the projects which uses Git for their source code management might as well.

http://git.or.cz/gitwiki/GitProjects

Waste Elimination

Waste by definition, is garbage or rubbish and elimination of it quite literally means removing the bad, rotten, stinking practices from our software development process and code smells (a side effect of not eliminating the rubbish) from our implementation.

When we talk about lean manufacturing or more precisely eliminating the waste, then essentially what we are talking about is

  • Delivering what makes sense to the customer and nothing more, as anything more is a waste. Try and help the customer distinguish between what he really needs against what he might need.
  • Keep paying off the technical debt as soon and as much as possible. I consider paying off technical debts as synonymous to eliminating waste.
  • Keeping a constant flow of work and working at a sustainable pace, eliminating the chance of dip in productivity, quality and motivation.
  • More lines of code when less can do, is a waste. How often we have looked at a big massive codebase and thought to ourselves. What a waste? Get rid of it and every time I have a done it I have felt very good about it. Just think of it as if removing even few grams of weight from your backpack while travelling on an adventurous trip. Code light and it will definitely pay off
  • Eliminate the artifacts which states what we are going to do, by really doing it. Non working, out dated artifacts is something we should always avoid
  • Eliminate specialist roles as that would promote collective ownership and passion to collectively work for the success of the project.

DBUnit – Need for creating tables

While doing unit testing for my DAO’s with DBunit, I never really realized that I have to explicitly create tables in the in-memory database and having an XML for the test data or even a DTD to validate it is not enough. That was till I planned to use JDBC and not hibernate to implement the DAO’s.
While woking with Hibernate it was always so easy to just turn on the hibernate.hbm2ddl.auto to update as part of hibernate properties and that is it, hibernate takes care of creating the schema from the hbm files or the respective annotations. But with JDBC, we have to explicitly create the tables in the in-memory database otherwise executing the test case will throw NoSuchTableException.
The easiest way to do it, is to execute the following.

SimpleJdbcTestUtils.executeSqlScript(new SimpleJdbcTemplate(getDataSource()),
new ClassPathResource("CreateTables.sql"), true);

Obviously we can use the above if we are using spring framework.

Sometimes it helps to think Negative

Sometime not being an optimist pays. It pays when we want to do risk analysis for a project, it pays when we want to do code reviews and it definitely pays when giving the feedback.

Risk Analysis : I guess we have to play a bit of a critic for our own application to really realize the potential risk very early in the project and be able to do the risk analysis and mitigation upfront. Not knowing the risks and not analyzing the application critically may turn out to be the biggest risk eventually. May be knowing about them and playing with our worst fears will lead us making steps to cut down the possibility of them getting true.

Code Reviews: Being critical when doing the code reviews and while pair programming helps in improving the code quality and code design. It might get a little touchy when someone points to a problem we feel we did a good job at, but please keep in mind it is not about being negative to the person who implemented it but about being constructive in improving the coding best practices and code quality. Thumb rule while doing the code reviews hate the bad code not the coder.

Feedback: Think negative about the process, about the people and about the company. If we are not doing it we are not really helping us and everyone around us in learning and improving.

Eclipse Tip : Static import help

While working with easy mock, till now I have to explicitly go and copy paste all the static imports from an earlier test case into the new one as there is no way (at least that is what I thought till now) to make eclipse help me assist with content completion without it.

Even worse is for every new method which I want to use on easy mock; I have to explicitly add a static import myself and then use it or for that matter may be first use it and then add the import.

This was till I found a feature in eclipse where I can specify my favorites for static imports.

static