Continuous integration testing: What is it and how can you use it?

posted in: Blogs, FileCatalyst | 0

Software testing… It’s a fundamental part of the software development cycle that most keen developers adapt in an attempt to keep their code stable throughout the development of their project. It is an extremely helpful resource that takes a small amount of time to prepare and can help save hours in the development process. What happens to these tests once the project has been fully developed, and only changes are being made throughout the code on a regular basis? In some cases, these tests are simply ignored by programmers, and only run as a debugging tool when a new problem in the code base surfaces.

Instead of brushing these tests into the development dust bin, wouldn’t it be helpful if the tests that you already made for your code could be run through an automated system that would let you know when your changes have broken pre-existing functionality?

Continuous Integration Diagram

That is where the concept of continuous integration testing begins. It is a concept/tool that allows programmers to take the tests made during the development of the code and run them on a system that records and displays the results of the test to the programmer. For software developers, this an extremely useful tool for a variety of reasons. It allows programmers to make changes throughout the day, and then have their changes tested on a system that will display whether or not the changes made broke any of the existing tests that had been developed. Continuous integration testing is also helpful as it helps reduce the amount of time needed to fix bugs that arise during development. Sometimes these software bugs would otherwise be missed. By using a continuous testing framework, bugs are caught during the development process by giving you detailed locations to where in the code the bug could be originating from. In addition to these benefits, continuous integration testing will also replace manual processes with automatic ones, which in turn allows you to apply your time where there is greater need for it. Finally, packaged inside of most of the continuous integration servers are a diverse series of code coverage tools that can be used to automatically produce reports and diagrams about your code’s status. These diagrams are helpful as they help aspects of your code such as: the percentage of lines in your code that were tested, the percentage of conditionals that were covered, and the overall result of the testing jobs over the last few iterations of testing.

All This Talk About Continuous Integration Is Cool And All, But How Do I Get Started?

If continuous integration testing sounds like something that you might want to use during the development of your software, then there is large collection of available options to choose from. Some of these choices include: Bamboo, Cruise Control, Hudson, and Jenkins among many others.

In this article however, I will be focusing on both the Hudson and Jenkins continuous integration servers, as they are two of the most commonly used ones within the industry. Both Hudson and Jenkins provide relatively the same degree of functionality, as they both have roots that stem from the same project. Hudson was the original project that was founded in 2008, and has now been acquired by Oracle. Jenkins on the other hand is a fork on the Hudson project that is supported outside of Oracle community, and it has a much wider range of support behind it.

Both continuous integration testing servers support a wide of range of available programming languages and other programs that programmers use. By default both servers support Java-based programs more than any other programming language. This is because the language in which the server is programmed is Java, and the majority of tools that you would need for running your tests and build processes already exist in the system as they are needed by the system itself. However, there is support for C, C++, JavaScript, Python, and many other languages. If the software you’re developing supports command line calls, can produce parsable XML files that contain the results of your tests, or can be built with one of the many different build languages that are supported within the server, then the tests can be integrated into the system.

Is there any cost? How Hard Is The Process To Get Started?

For programmers there is no hard cost to using these continuous integration servers. The ones listed above are free and are relatively easy to start up and configure if needed. When the server is downloaded, it is packaged with a simple .war file that can be deployed from the command line with the built in Jetty server that is packaged with the software; or it can be deployed on another web server of your choice. Once deployed, it is simply a matter of creating new jobs, views, and other configurations. It will be a matter of time before you’ve got the beginning of a continuous integration framework put together. This time can be seen as a soft cost; however, the value and benefits of continuous testing will by far recover any initial time spent by the development team getting up and running. Over time, continuous testing nets a savings rather than a cost.

If you should ever encounter problems setting the proper configurations, there an abundance of continuous integration forums online that can help you find a solution to your issue.

When In Doubt, There Is Probably A Plugin That Is Patiently Waiting For You

So you’ve started to implement your continuous integration server on your web server of choice and have started to configure the settings needed in order to run your tests in an automated fashion, but there is a problem that has started to take shape. There isn’t the ability to call the specific software you need in order to run your tests, or there isn’t a feature within the server that you need in order to properly run your tests. Most people that work with either Hudson or Jenkins eventually encounter this issue, but typically there is an easily solution for the problem.

Within both of the continuous integration systems, there is a wide arrangement of plug-ins available to anyone that wishes to use them. These plugins are developed by other users of the software, and are free for anyone to use if they so choose. A large amount of the plugins available can be found under the management sections of Hudson or Jenkins, and typically only require a simple installation, and server restart before the plugin can be used. If you can’t seem to find a plugin to support your needs, then feel free to research around the internet other locations that might contain them.

In Summary

Continuous integration testing is an extremely useful tool for all programmers in conjunction with their pre-existing unit and integration tests. It provides an extremely helpful tool that helps reduce the amount of time needed to fix errors within your code base, and gives in-depth analyses of your code in the process. The servers that have been outlined in this article are free of charge, and are relatively easy to set up once you get a grasp on the basic functionality behind all of the available options. Once an established framework has taken hold in your organization, the time savings for development cycles—plus the cost benefits of increased product stability—will recoup any time spent by the development team.