# TDDD04 Software Testing

### Exercises

This is an optional exercise for those of you who would like to try out some new testing tools during the course.

1 | Download the Java source code of a simple interval arithmetic library from sourcefourge http://interval.sourceforge.net/interval/index.html |

2 | Interval arithmetic is the arithmetic of quantities that lie within specified ranges (i.e. intervals) instead of having definite known values. Interval arithmetic can be especially useful when working with data that is subject to measurement errors or uncertainties. For a short overview of interval arithmetic please consult the Wikipedia webpage. http://en.wikipedia.org/wiki/Interval_arithmetic |

3 | Create and compile sample project in Eclipse that integrates the Java interval arithmetic library that you have just downloaded. |

4 | In the next step you should download and install JUnit on you Eclipse environment (if it is not already installed, most of the Eclipse installations already have the JUnit plug-in installed). There are several good tutorials on the internet on how to install and use JUnit in the eclipse environment. The folowing tutorial might be a good starting point: http://www.vogella.de/articles/JUnit/article.html |

5 | Create some unit test for yor application and especialy for the interval library. Learn how to write unit tests and how to use JUnit togehter with your projects. |

6 | In the next step you will learn how to use a testing coverage tool. Start with installing the EclEmma tool. |

7 | Get comfortable with EclEmma and compute some coverage metrics. Check how JaCoCo (the coverage engine that EclEmma uses) computes the cylomatic complexity of the module under the test. |

Page responsible: Ola Leifler

Last updated: 2014-03-06