User guide


Introduction

QualitSpy is a framework for monitoring software development process. Failing to deliver requested feature on eligible schedule and quality may cause serious loss (e.g. financial). Therefore, it is important to keep an eye on the work progress and early identify problems. There are a number of tools employed in most of the software development environment. We believe that these tools are reliable source of metrics that can be used to evaluate project’s current state and predict about the further development. The QualitSpy framework is designed to integrate with the issue tracking system, the version control system, the continuous integration system and the source code itself by collecting raw data as well as software metrics. The collected data is used for research (empirical experimentation, estimation/prediction model creation) and for project evaluation.

Detailed information regarding project concept can be found in an article published in Journal of Theoretical and Applied Computer Science: http://staff.iiar.pwr.wroc.pl/marian.jureczko/QualitySpy.pdf

QualitySpy First Steps

Starting QualitySpy (released version)

To start the application you need:

When the prerequisites is fulfilled do the following:

  1. Download the latest qualityspy-acquisition-*-run.zip package from Download section
  2. > unzip qualityspy-acquisition-*-run.zip
  3. > cd qualityspy-acquisition-*-run
  4. > ./start.sh

(where * is version)

Configuring database

For the correct operation of the tool database is needed. Before first use it is important to create one with name, user and password. In application there is a configuration menu, in which we can then type those credentials. To configure database (assuming you have mysql) you need to type those commands:

 mysql -u root -p

 Enter password: Password_that_you_typed_while_installation

 mysql> CREATE DATABASE qs_dev;

 mysql> USE mysql;

 mysql> CREATE USER 'qs'@'localhost' IDENTIFIED BY 'qspass';

 mysql> GRANT ALL PRIVILEGES ON qs_dev.* to 'qs'@'localhost';

 mysql> FLUSH PRIVILEGES;

 mysql> EXIT;

Configuration with those creates:

* Database: qs_dev

* User: qs

* Password: qspass

Settings for database in application can be found here:

Below you can see how the data is typed to connect correctly:


Starting QualitySpy snapshot version

To build and start the project you need:

When the prerequisites are fulfilled do the following:

  1. > git clone git@bitbucket.org:MarianJureczko/qualityspy.git
  2. > mvn clean install
  3. > cd apps/qualityspy-acquisition/target/
  4. > unzip qualityspy-acquisition-*-run.zip
  5. > cd qualityspy-acquisition-*-run
  6. > ./start.sh

(where * is version)

Features and configuration

Before using QualitySpy tool, a proper configuration for each of QualitySpy's services (external tools/services which will be used with QualitySpy) needs to be provided. In order to do that there is a Configuation tab with 4 subtabs: CKJM, Repository, JIRA and CI:


In this section all configuration steps will be described in details. Each of the subsections describes all setting's fields in a particular Configuration's tabs. All described settings in that section refer to QualitySpy desktop application.

CKJM - Product metrics

Can be executed using Fetch → Metrics (ckjm). It collects metrics from Java code using CKJM extended. More inforomation about CKJM extended - http://gromit.iiar.pwr.wroc.pl/p_inf/ckjm/. The metrics can be calculated from jar or from class file. For the sake of metrics calculation correctness all dependencies of investigated Java code must be provided. They may be given explicit or using Apache Maven (for projects developed with Apache Maven, i.e. having pom.xml file)


ParameterDespcriptionSample DataRequired
ckjmSourceTypeType of the input artifact. Ckjm will be used to calculate metrics for this artifactJAR/CLASS(red star)
ckjmJarName with path (can be relative) of the jar file to analyse. It is used only when
the CkjmSourceType is set to JAR
src/test/resources/catalina.jar
ckjmClassPath to the directory that contains classes to analyse (without package directories).
It is used only when the CkjmSourceType is set to CLASS
src/test/resources/catalina.class
ckjmLibrariesSeparatorThe character that is used to separate libraries on the property CkjmLibraries.
If is not set, the default path separator
 ':' on Linux, ';' on Windows
ckjmLibrariesList of libraries (jar files) that are necessary to calculate metrics. A jar archive
is necessary to calculate the metrics when at least one of the measured classes
refers to a class that is in the jar archive

src/test/resources/lib_Tomcat/servlet-4.0.6.jar;
src/test/resources/lib_Tomcat/commons-modeler-1.1.jar;
src/test/resources/lib_Tomcat/tomcat-util-5.5.7.jar


ckjmMavenProjectDirectoryPath to Maven project directory. Should contains pom.xml filemodule/core/maven/main
ckjmMavenHomeInstalation directory, needed for resolving dependencies using maven

ckjmJavaHomeInstalation directory, needed for resolving dependencies using maven

addTestHomeTO REMOVE?



Repository

QualitySpy can collect data from two different version control systems, i.e. Subversion and git. One of them must be selected in the configuration. Some of the parameters are relevant only for one of them.

Parameter:SVNGitDescription:
reposvnpass

Password to the svn repository. Password is unnecessary to login to the git repository.
reposvnuser

Login to the svn repository. User is unnecessary to login to the git repository
repofileseparator

A charactes used as a path separator. Default is '/'. Allowed values are '/' (slash) or '\' (backslash).
reposrcpathpostfixregex

Source code postfix defined by a regular expression eg. *.java.
reposrcpathprefixregex

Source code prefix defined by a regular expression eg. */src/main/java.
repotype

Type of used repository. Allowed values are: "svn" or "git".
repourl

URL of the svn or remote git repository, e.g. http://svn.apache.org/repos/asf/tomcat/trunk. Allowed values: url addresses
repopath

Exact path to the project's repository (continuation fo URL specified in repourl field). Allowed values: char sequence divided by separators specifying repository's access path.
repocontentregex

Obtains information about files in repository based on filenames, which are described by inserted regular expression. Allowed values: regular expression
repodiffregex

Regular expression describing on which files should diff operation be executed (comparing files between the revisions and setting how many lines were added/deleted).
repoworkingcopy

Path for a local repository copy (working directory). Allowe values: char sequence divided by separators defining a path in the file system.
repostartrev

Specifies the revision where the analyze should start. It's a number for the svn. And for git it`s a date (char sequence). Git accepts different formats - description below*
repoendrev

Specifies the revision where the analyze should end. It's a number for the svn. And for git it`s a date (char sequence). Git accepts different formats - description below*

*Git accepts various date formats (+0200 signifies timezone):

  • rfc2822: Mon, 3 Jul 2006 17:18:43 +0200
  • iso8601: 2006-07-03 17:18:43 +0200
  • local: Mon Jul 3 15:18:43 2006
  • short: 2006-07-03 (not in 1.9.1, works in 2.3.0)
  • default: Mon Jul 3 17:18:43 2006 +0200
  • relative: e.g. "yesterday", "today", "5 minutes ago", "1 month 2 days ago",
    "six minutes ago", "last Tuesday", "3PM GMT" etc. 

(For full explanation of dates in git visit this page or the stackoverflow issue here.)

Issue Tracker

QualitySpy can collect data from two different issue trackers, i.e. JIRA and GitHub's Issues. One of them must be selected in the configuration. Some of the parameters are relevant only for one of them, e.g. only JIRA supports JQL strings.

JIRA & GitHub issue trackers settings

FieldField TypeGitHub SupportJIRA SupportDescriptionSample DataDefaultRequired
BugtrackerConnection Info

Name of the issue tracking tool"jira" or "github"
(red star)
trackerUrlConnection Info

URL address of the JIRA system. Required if Bugtracker is setted to "jira"https://jira.attlasian.com
(red star)
LoginConnection Info

Login to the JIRA or GitHub systemuser123

PasswordConnection Info

Password for JIRA or GitHub userpwd123

TimeoutConnection Info

Timeout given in ms after which application should abort trying to establish connection.500060000
jiraJQLStringFilter

JQL query which is a filter for searching issues in JIRAproject = crucible and fixVersion = 3.0.2

githubIssueRepoConnection Info

GitHub repository nameoctobox

githubOwnerConnection Info

Username of the GitHub repository ownerandrew

stateFilter

State of the issues which should be contained in the search results."open" / "closed" / "all""open"
TitleFilter

Issue title on GitHub"Add Development doc"

numberFilter

Issue number on GitHub, preceded by "#" sign#123

ReporterFilter

Username of the user who created an issue on GitHubarthurnn

assigneeFilter

Username of the user who is assigned to an issue on GitHub"user123" / "none" / "*""*"
labelsFilter

Allows filtering issues by label(s) which identifies issues on GitHub"bug" (any label which occurs on specified GitHub)

CreatedAtFilter

Search for issues which was created on specified time or later. Time should be given in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ2017-01-13T20:15:30Z

UpdatedAtFilter

Search for issues which was updated on specified time or later. Time should be given in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ2017-01-13T20:15:30Z

mentionedFilter

Search for issues in which given user was mentionedarthurnn

CI (Continuous integration)

QualitySpy can collect data from two different continuous integration systems, i.e. Jenkins and Hudson. One of them must be selected in the configuration.

ParameterDescriptionSample DataRequired
CI server typeName of continuous integration server usedHudson/Jenkins

(red star)

CI server URLURL address of CI serverhttp://snow.iiar.pwr.wroc.pl:8082(red star)
CI server loginUser login for CI serverjan007
CI server passwordUser password for CI server1q2w3e4R
CI job name

Job name for CI server

QualitySpy(red star)


Browse through collected data

One of the most important activities in QualitySpy project is to fetch the data collected so far. To retrieve the data - press "Fetch X" button, where X would be replaced with one of the following:

  • SVN/GIT (Version Control/Repository)
  • CKJM (Metrics)
  • JIRA (Issue Tracker)
  • CI (Continuous Integration)

After this operation, collected data will contain informations about the project chosen by us. In order to present the collected data in a transparent way, the output would always be organized as follows:

  • on the left side there are some entries with the particular attributes of the project
  • on the right side there are values of these attributes

The collected data output might cover:

  • ProjectHistories - these entries are connected with particular versions of project
  • Job - CI's system (e.g. Jenkins) jobs alongside with their details and build made by that particular job.
  • Revisions - version control system (e.g. GIT/SVN) entries
  • Classes - Java code metrics values
  • Issue - issues entries obtained from issue tracking system along with their details, for example:




Every single issue consists of several directories. These directories are issue description, issue change, issue comments and issue logs. Directory has its own attributes. For example: issue description has "summary" attribute which containts information about this issue. Another one attribute called issue key (e.g. CRUC-6555) is an ID of the issue.

Web application


To start web application you need:

Then you should do the following:

  • Clone a project with git from https://bitbucket.org/opendce/qualityspy.git
  • Execute command: mvn clean install (or mvn clean install -DskipTests if you want to skip tests)
  • Run MySQL (e.g. using Xampp)
  • Find a jar file (\apps\qualityspy-webapp\target) and run qualityspy-webapp from command line (java -jar qualityspy-webapp-0.5-SNAPSHOT.jar) 
  • You can access your application from: http://localhost:10080
  • Web application has Actuator endpoints that allow you to monitor application, those endpoints are available on http://localhost:8081. For more details check out Actuator documentation.
  • In a web browser you can see a start page of web application:



Web application has only one functionality: when you click Swagger UI, you can see a list of available REST endpoints:

Using QualitySpy to moving project to new Jira instance

The first step is to run QualitySpy application and fetch choosen project. Below is the instruction how to create a new project, configure IssueTracker and collect data.

1. Select from main menu "Project" → "New" or click icon "Create new project", type name of the project, version and then click "Ok".

2. Necessary fields are: bugtracker and trackerUrl. Set bugtracker field to "jira" and trackerUrl to your address for Jira system (e.g. https://jira.atlassian.com/). If your repository is protected you need to enter login and password. 

3. You can also set more options:

  • timeout - given in miliseconds after which application should abort trying to establish connection
  • jiraJQLString - query which is a filter for searching issues in Jira (e.g. "project=NameOfProject" will import project named "NameOfProject") 

4. Next choose your project version, select "Fetch" from menu and click Issue Tracker option. After collecting data you should see information "Collected!" in message box. Click "OK".

5. Run web application (link), open your web browser and type in the address field: http://localhost:10080/swagger/index.html

6. Find projects section and click "get" button. Click "Try it out"  button. 

 

7. Next execute it by clicking button.

8. You should receive list of collected projects. Remember number that is in projectHistories tags.

9. Find and click "/jiraexport/projecthistory/{projectHistoryId}" section. Select "text/csv" from "Response content type" list. Next press "Try it out" button and type number from projectHistories tag into projectHistoryId input. Click "Execute" button.


10. Copy data from "Response body" to any text editor and save it with.csv extension.

11. Importing .csv file to Jira server is described on official website: https://confluence.atlassian.com/adminjiraserver071/importing-data-from-csv-802592885.html.