Friday, June 24, 2011

Services, practices and tools that should exist in any software development house / department - Part 2.

 We will continue to list and elaborate on simple steps towards shaping up a proper development environment. In the first part we have gone through 3 basic tools 1) Code Repository 2) Issue Tracker 3) Wiki (Part 1). Let's move on.

3. Build Server (Continuous Integration): One of the simplest and accurate descriptions on the definition of continuous integration  is given by Martin Fowler
 "Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible" . Simple as that. A builder & integration server is a software service (usually a web application hosted on an app server) that will offer functionality like - automatic and regular builds of the code saved in the repository, run tests or other quality plugins and produce reports daily regarding the 'health' of the code. Team members will be able to monitor and get notifications about exceptional cases of errors in each aspect of the integration life cycle for example, build errors, number of tests failing after a specific update, quality metrics after analyzing the code. Wikipedia has a quite decent article on the subject.

There are some basic concerns around selecting a continuous integration /build server.
  • (Type-$$) Which one of them? We are lucky enough (yet again) to point that there is a variety of potential solutions both commercial and open source. When it comes to open source you will see services like Hudson /Jenkins /CruiseControl / Continuum . I have worked with most of them in different companies and I would say that all of them keep their promise on providing basic functionality. You will need to examine the different features / release and update cycles of the technology / and integration with other systems - in order to make your choice. When it comes to commercial packages there is a again a large set of available solutions- some of them would be  TeamCity / Bamboo  etc. You will find lots of blog posts around the net listing potential solutions for example this one.
  • (Backup) As already elaborated many times in the previous post.After installing the service and using it, we should be aware that we need to setup a backup strategy and procedure, usually assigning this task to any of our administrators.
  • (People) An integration server is a component that works for the team, the main thing you want to ensure is that it works properly and that people around the software development life cycle pay attention to its work results (notifications, reports and monitoring facilities).Integrating continuous integration into your software development process you make a step towards being proactive on ensuring software quality. It is something that the management should evaluate carefully.
4. Testing (tools and practices) : Testing is one of the most important activities during software development. Eventually many people (even today) consider it as waste of resources and time. There are several things that we can do in order to easy our pain on these things + change our attitude towards this important (quality wise) activity.
  1. Practice- Testing should be supported by the project management & upper  layers. Testing does not start on the technical level when it comes to 'actually doing it'.The testing phase starts when it is slowly being properly integrated in the project plan, in the attitude of the software development process, in the trust that the managers and PMs will put on it. There is no - magic button - called now we do testing - in a any software development team. I have seen the following mistakes through out my carreer. 
    1. Project and task estimates do not include time (in a pragmatic manner) for proper testing either unit testing (done by developers mainly) or functional testing (done by a testing team - if there is one). By not assigning time, the developers are forced to tackle the implementation and testing of their tasks into the same time slot- resulting to skipping the less urgent sub task (the test). You can not easily  persuade a project management or a budget manager of a software project to take into account testing as an activity. The results are obvious after the first releases or after the service/ product goes into production resulting to immediate switch from extreme programming to extreme testing on a problematic solution (something that is again completely wrong - see above the magic button effect).
    2. Developers get lazy: Eventually we can not blame the 'managers all the time. Software developers get lazy from times to times since they consider as well testing - as a second class citizen on their task list. Eventually this attitude should be enforced by senior management and by the overall software development practice followed on each department. For example when you introduce automated testing through the exeucution of tests on a continuous integration server - and you monitor the areas of the code where the developers have indeed performed test - you may apply the correct change of attitude to those not paying attention. Some times the complexity of the software and it's design acts like a another reason of a developer moaning (I can not test) and this something that senior developers and architects should pay attention and modify as soon as possible potential parts of the code - make it modular and use the appropriate technologies in order to help/automate/ and encourage on the developer level the testing practice.
  2. The tools -  There several tools and practices that can be applied in order to implement and ease the work on testing. I will provide a short list on things I have seen in my java related career up until now.You may find many other links here for other programming languages or frameworks, here.
    1. Developer frameworks and tools
      1. JUnit (Unit testing)
      2. TestNG (Unit testing)
      3. JMock (mocking techniques)
      4. Mockito
      5. Ejb3Unit (or standalone contaners nowdays)
      6. XMLUnit
      7. HTMLUnit
    2. Web testing /automating fuctional testing
      1. Selenium (web)
      2. Sahi
      3. JMeter (Performance & Testing)
  3. Code Coverage : Up until now we have talked about basic steps towards integrating testing into our project management and every day coding. How we will be able to tell if we are on the right track? How good or how much are we testing? What about quality constraints applied by potential customers (example: we demand 80% of the business code to be covered by tests or similar requests). This is where code coverage as a practice kick in. It is tool to monitor and efficiently fine tune our testing activities. There are certain tools and frameworks that analyze our source and test source trees and provide metrics regarding the amount of real business being tested. In the Java world you may see tools like :
    1. EMMA
    2. Cobertura
    3. Clover (commercial)

That is all for this second part. I don't want to make the posts huge (they already are). Bare in mind that I expect senior and experienced developers/ architects to already have all the above in place or know about them. The main purpose of these posts is to act a reference point - starting point. I encourage you to post comments and provide your own alternatives on the things mentioned above. See you on part 3.

    5 comments:

    1. i think you should include one more tool on your list... what about a maven repository manager? like jfrog's artifactory or nexus?

      where with maven you "integrate" your Java IDE with the Repository Manager and your CI server with the Repository Manager.

      You should be able to "link" different versions of your project on different versions of your n projects and of course to "link" them with the third party (jar/war) java libraries that are necessary to be used.

      ReplyDelete
    2. Hi George thanks for your comments!! It will be in Part 3 all these tools + IDE practises.

      ReplyDelete
    3. That's cool.

      But i want to see a post like those: http://usesthis.com/
      focused on software mainly. Please :)

      ReplyDelete
    4. a correction on my comment:

      You should be able to "link" different versions of your product (delete the word "project") on different...

      ReplyDelete
    5. I was looking for a good article about increasing my firm’s turnover and tracking employee efficiency, If you have added the fact about implementing time management systems like that of timesheet in your article it would have been great any way it is a good article ...Keep it up and GO ahead with your work..

      ReplyDelete