Course Schedule :: AY 10/11 - Semester 2

Tools

Introduction

Any decent software development team will have in their repertoire a set of useful tools that they use consistently throughout the development life cycle. Here, we describe some tools that might be of use to you.

However, you are not limited to the set of tools listed here. But tools are not silver bullets! Knowing all the tools here does not mean that your productivity will increase or your project will be a success. It depends on how well you integrate them into your development work. For example, how should you partition your code into packages, which directory to place documentation, who does the integration, how to resolve bugs during system testing etc. These are things tools can't help you with. Hence, if you want to maximize the potential of the tools, you need to integrate them into your work in such a way that it flows with your team's dynamics.

A Word of Advice

The best time for you to get acquainted with the tools is during the initial stages. During this time, come up with some standard conventions for your team e.g. naming conventions, where to store source code of different members, how to do integration testing etc. The first iteration is where you put the tools into serious use. Unfortunately, most teams will find the tools to be more of a hindrance than of help during this period. There are two reasons:
  1. Each tool has a high learning curve. Because you're not familiar with the tools, you will find it tedious and cumbersome to use them initially. Please do not give up ! Once you cross the initial hurdle, you will find the tools to be indispensable.

  2. The project is less complex and smaller in the initial phase. You will probably find the tools to be an overkill during the first iteration because most of the tools are meant for large projects. However, as you move into the next few iterations where your program starts to get larger and more complex, you will realize the benefits of the tools.
We would like to re-emphasize the importance of using tools in your project. They can really help to reduce your development time and improve the quality of your product. Of course, you can still progress in the project without using any of the tools, but you'll probably lose out to teams that use them as their end products are usually of a higher quality.

Below are a few short guides we wrote on how to use the tools. Note that they are not substitute for the documentation that comes with the tools. They are meant to help you get started and thus will not cover everything.


Testing Frameworks

Unit testing is an integral part of your project. Unit testing frameworks (and tools) help you automate the process of unit testing. With those tools, running your suite of test cases is as easy as clicking of a button. The tool will faithfully test your software against each test case and reports any failed test cases. If you have a comprehensive set of test cases (you should!) , you no longer need to worry about any side effects of your latest changes, just run do a regression test by running the test cases and the tool will check whether your latest changes have broken any part of the rest of the system.

When to write unit tests...

Your collection of test cases should grow with the functionality you implement. ( indeed, some advocates 'test first development' where test are written before the program!). Remember, unit testing goes at least in parallel with development, certainly NOT at the end of the project.

How much of unit testing to do...

It's not unusual for your test code to be more than 50% of the total amount of code - and it's worth every bit of effort. You may feel too lazy to write test cases at first, but once you are test-infected, it makes programming so much more fun, and way less frustrating. All that effort of writing test cases will help you excel towards the end, when you need to do changes to the code base that has beocme large and complex over time.

Tools

CPPUnit is a free and open source unit testing tool for C++ developers. It integrates well with VisualStudio.NET and relatively well documented. For more info, go to http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page 

What about integration testing...?

From a tools perspective, integration testing is not much different from unit testing. You can use the tools given above.

What about C++ assertions..?

As you'll discover, unit testing does not replace the need for assertions. Keep using assertions (provided by C++) where they make sense. Assertions and unit testing serve two different purposes.


Version Control System - Subversion (SVN)

As your team progresses into the project, you all will be creating more and more source code. As each of you are working independently on different parts of the system, you will occasionally need to pass your set of codes to other members for integration. During integration, a bug may be uncovered in your code. So, you make a change and send the code out again to the rest of your members. A new one may then be discovered and the cycle continues. In the end, each member ends up with so many versions you don't know which is the latest one.

Well, that's where SVN comes in. SVN stands for Subversion. The strength of SVN comes from the fact that it is able to provide record keeping (i.e. revision control) as well as facilitate collaboration. Many of the current open source projects (consisting of hundreds of developers) use SVN. SVN is not a difficult tool to use. Furthermore, there are many good documentation available.

Each group has been assigned a repository at https://subversion.comp.nus.edu.sg/svn/cs3215/group<no>. A repository is simply a central location where files shared among group members will be mounted.  However, different from the standard file sharing, the repository also track changes that have been made to the shared files. The repository will serve as the SVN server. Simply login with your SOC UNIX ID. One can also browse the repository content by accessing the above URL through their favorite web browser.

A short guide to get you started with using SVN from windows can be found here. The guide is just to give you a head start by introducing you to some basic usage of SVN. You are expected to refer to the documentation listed in the references to enhance your usage of the SVN. You can also visit the SVN website for more info.


Refactoring

Let's face it, not even the best programmers will get everything right the first time. As the work progresses, you will realize many things that could have improved the system, if only you realized them earlier. To give a simple example, you might realize that a certain method  name is no longer reflects what the method does, leading to confusion among the users of that method. Ideally, you should change the name right away to a better name. Doing such changes is called Refactoring. More formally...

"Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure." (more...)

In most such cases, you will hesitate to refactor, because of the additional workload  (have to modify many places in the code) and the risk (of breaking something while modifying the code)  involved.

To ease the workload of refactoring, there are automated refactoring tools. For example, you can select a method and say 'change name from foo to bar' and the modification will be carried out automatically, including in all places where the method is used. Changing method name is just one of the many refactorings such tools can help you with. VS.Net 2005 comes with built-in refactoring tool - it can be accessed from the `Refactor' menu bar or right clicking the desired code to refactor from within VS.Net IDE.

For a reference, please refer to:

To reduce the risk involved in refactoring, you should refactor in small steps and run unit tests after each refactoring. The better your suite of unit tests is, the bolder you can be in refactoring. If things got messed up, you can always use SVN to revert to an earlier version.

Modelling Tools

Use UML diagrams to document your design. Here is a pointer to a public domain UML diagramming tool that is quite sufficient for the project:

An alternative is Microsoft Visio, that is downloadable from the workshop at https://mysoc.nus.edu.sg/~agreemt/agree.php

 

*** Maintained by YinXing Xue and Marcel Boehme ***