Designite introduced “trend analysis” feature in version 1.30.3 that reveals the smells-trend for the analyzed software. Specifically, the trend shows how many smells (all architecture, design and implementation) have been introduced, remained, and removed from one version to another. It is useful in many cases including when the development team wanted to observe the quality of the software after a refactoring cycle.
NUnit is a well-known open-source unit-testing framework for .NET. The oldest available version of the tool is NUnit 2.0 which was released way back in 2002. Since then, it has been under active development. It is interesting to see how the software evolved in recent years from the design and implementation smells perspective. We took 10 different versions of the software from version 2.5.9 (released in December 2010) to version 3.2.1 (released in April 2016) and analyzed them using Designite.
Let us use Designite’s trend analysis feature to see how the smell profile of the software evolved during this period. Start Designite and select “Trend analysis” option from the “Analysis” menu to initiate the analysis. It will open a window (see above) where we have to specify different versions of the software to be analyzed. There are two ways to do so.
- We can specify different versions one by one. Clicking on the ellipsis opens the standard Windows File-open dialog. We locate the solution file of a specific version and select it. Also, we specify the version (up to 5 characters) and click on the “Add the solution” button.
- If we are planning to execute a trend analysis (of same versions of the software) periodically, then specifying each version separately every time is cumbersome. In such a situation, we can prepare a batch file containing version and path of all the versions that we would like to analyze. Each line of the file should contain version string (not more than 5 characters long) and absolute path of the solution file of the specified version separated by a semi-colon. The batch file that we used for analyzing various versions of NUnit is given below. Specify this file by clicking on “Import solution list for trend analysis”.
2.5.9;c:\Workspace\nunit\NUnit-220.127.116.1148\nunit.sln 2.510;c:\Workspace\nunit\NUnit-18.104.22.16892\nunit.sln 2.6.0;c:\Workspace\nunit\NUnit-22.214.171.12451\nunit.sln 2.6.1;c:\Workspace\nunit\NUnit-2.6.1-src\nunit.sln 2.6.2;c:\Workspace\nunit\NUnit-2.6.2\nunit.sln 2.6.3;c:\Workspace\nunit\NUnit-2.6.3\nunit.sln 3.0.0;c:\Workspace\nunit\NUnit-3.0.0-src\nunit.sln 3.0.1;c:\Workspace\nunit\NUnit-3.0.1-src\nunit.sln 3.2.0;c:\Workspace\nunit\NUnit-3.2.0-src\nunit.sln 3.2.1;c:\Workspace\nunit\NUnit-3.2.1-src\nunit.sln
We click on “Analyze” and wait for the tool to complete the analysis. The waiting period depends on the number of versions and the size of the project. We get the following trend for the selected versions of the software.
The trend analysis summary shows the total number of design and implementation smells that have been introduced, remained, and removed in each of the analyzed versions of NUnit. Version 3 of NUnit was written almost from the scratch and therefore, the number of new smells introduced is very high. At the same time, it is interesting to observe that smell density in the version 3.0.0 has been reduced (refer the table below the stacked column chart). It indicates that despite a lot of new code has been written for version 3, the development team managed to write higher quality code.
We can dig a little deeper by looking at design smells and implementation smells views separately. The detailed views allow us to see specific smells that have been introduced, remained, or removed in each version.
Stacked column charts are interactive that enable us to filter the results shown in the grid below the chart. So, if we wanted to see smells that have been removed in version 3.2.0, we can click on the green column for the said version (as shown below).