Ryan Avery

Unit Testing


This assignment, which was done for my CS-471 Software Engineering class, is the second assignment we covered in Software Engineering that dealt with testing, unit testing, code coverage, and the use of a test suite. For this assignment the student was tasked with coming up with a simple Triangle class that would then be properly and thoroughly tested with completelarge project picture code coverage.

The Triangle class is a very simple class which has three angles. Based on the values of these three angles it is possible to determine if that triangle is acute, obtuse, right, or not a valid triangle at all.

Knowing this, I used the JUnit test suite to test all of the possible valid solutions along with edge cases for determining which type of triangle any particular triangle was based on the values of its angles. I then used EMMA, an open sourced toolkit for measuring and reporting code coverage in Java, to determine and document the amount of code that was being covered by my unit tests.

Although this project is not very large, it does document that I have had experience in testing, unit testing, using code coverage software, and the use of a test suite in a development environment. I'll admit that I have never enjoyed writing tests for hours on end, however I strongly believe that properly documenting and testing your code is one of the most important things you can do in order to have confidence in the code that you write.