Skip to content

kaushalnavneet/Relative-Complexity-of-Test-and-Application-Code

Repository files navigation

	Test Code and Application Code Relative Complexity:
	---------------------------------------------------
		It is the study of the relative complexities of test code and application code. 
		And based on the analysis it is concluded which one possesses relatively more complexity.
		Different steps have been taken to study and analyze the relative complexity. 
	
	Project Report
	--------------
		Kindly read the report file of the project (Report_on_TestCode_and_ApplicationCode_RelativeComplexity.pdf).

	Python Scripts
	--------------
		Different python scripts are written and used to automate the filtering and to get the actual data before analysis.
		For this, Python 3.7 is used, and codes are writeen using PyCharm (IDLE) IDE.
		Steps to downaload python 3.7: https://www.youtube.com/watch?v=Wx8XU2L2k6Q

		The scripts can be found in the folder: /Python Scripts/

	Understand Tool
	---------------
		All the metrics (CC and LOC data) about the test and application codes are generated using the Understand tool.
		For which the tool is downloaded from the SciTools website (https://scitools.com/feature/)
		Further, the student license is required to use the software, as it is not a open source tool.

	Metrics
	-------
		The generated metrics for test and application code for each open source project is stored in the folder: /Metrics from Understand tool/

	Docs
	----
		The document of how to use Understand tool is placed under this folder: /Docs/
		The raw data about the language of each test/application code is stored in this folder having file name 'LanguageOfCode.doc'

	Python Scripts
	--------------
		Inside /Python Scripts/ folder, there are five python scripts:
		1. TestCodeFilter.py : Python Script to find the test files (by looking for string set of test/Test/TEST/) from a given path and storing the test file paths in a text file, 
							   and also storing the paths of remaining files in a different text file.
							   How to use? and what it does?: 
							   1. Run it using a python platform like IDLE Python or using command prompt.
							   2. As an input, give the directory path of the main folder where all the folders having open source project exist.
							   3. It will separate the paths of test and application files, and it generates three txt files ofr each open source project. Please see the 'Path - text files' section here to know about these files.
		 
		2. FileCopy.py : Python Script to segragating the test code files and application code files based on the text files generated by TestCodeFilter.py.
						 These text files contain the test and application code paths. This script will create two folders separately for test and application files. 
						 How to use? and what it does?: 
						 1. Run it using a python platform like IDLE Python or using command prompt.
						 2. As an input, give the directory path of the main folder where all the folders having open source project exist. It's same as given to TestCodeFilter.py.
						 3. It will create two different folders one for test and other for application for each open source project, and will copy the relevant files into these folders based on tfile.txt and afile.txt. Please see the 'Path - text files' section here to know about these files.
						 
		3. csvFilter.py : Python Script to find the .csv files in a given directory and saving the paths of these files into a text file.
						  How to use? and what it does?: 
						  1. Run it using a python platform like IDLE Python or using command prompt.
						  2. As an input, give the directory path of the folder where all the metrics files are stored who were generated using Understand tool.
						  3. It saves the paths of these files into a text file.

		4. GraphPlotter.py : Python Script to plot the LOC and CC graphs at function level for a given text file where paths of metrics files are stored. It automatically saves the plots too.
							 How to use? and what it does?: //Before using it, based on the programming language, create different text files as discussed in second section of 'Path - text files' here. Because few .csv files may have java code where 'Method' is used in place of 'Function' which is difficult to filter. 
							 1. Run it using a python platform like IDLE Python or using command prompt.
							 2. As an input, give the directory path of the folder where csvFile__.txt files are saved. Give the relevant csvFile__.txt file name too as a second input.
							 3. It plots four graphs, two (CC vs Functions, and LOC vs Functions) at function level and other two (SumCyclomatic vs Files, and LOC vs Files)  at file level.
							 4. It keeps on saving these graphs as image files.

		5. HistoPlotter.py : Python Script to plot the histogram and descriptive table for a given column of a csv file. It automatically saves the plots too.
							 How to use? and what it does?: //It's an improved version of GraphPlotter.py which automatically includes all kinds of functions as well as methods, so no need to create language specific csvFile__.txt.
							 1. Run it using a python platform like IDLE Python or using command prompt.
							 2. As an input, give the directory path of the folder where csvFile.txt file is saved. 
							 3. It plots two histogram graphs of CC and LOC. Additionally, it also creates two descriptive statistics tables for CC and LOC data.
							 4. It keeps on saving these graphs and tables as image files.

	Grpahs
	------
		All the graphs generated from the python scripts are stored in the folder: /Graphs/ 
		And these graphs are divided into three different sub-folders:
		1. /Graphs/CC-LOC/ : The CC and LOC graphs generated by GraphPlotter.py are stored as an image files
		2. /Graphs/Descriptive Stats/ : The Descriptive Statistics table generated by HistoPlotter.py are stored as an image files
		3. /Graphs/Histograms/ : The histogram graphs generated by HistoPlotter.py are stored as an image files

	Path - text files
	-----------------
		/Path - text files/Code path/
		Inside this sub-folder, different folders are there which contain the .txt files generated by TestCodeFilter.py script.
		There are three files in each folder of case study:
		1. appFile.txt [directory paths of all files/folders of the Open Source Project downloaded from the GitHub as a part of case study]
		2. tfile.txt [Filtered directory paths from the appFile.txt which are considered as test files]
		3. afile.txt [All the remaining directory paths of files which are not filtered in tfile.txt, So basically the remaining ones are application files]

		/Path - text files/csv-Path-txt/
		It contains three text files:
		1. csvFile.txt [Directory/file location of all metrics (.csv) files, of the open source project, which are generated using Understand Tool]
		2. csvFile_J.txt [File locations of all the metrics files having Java (and not C) as code's programming language. /Docs/LanguageOfCode.doc is referred to check the language.]
		3. csvFile_C.txt [File locations of all the metrics files having C (and not Java) as code's programming language. /Docs/LanguageOfCode.doc is referred to check the language.]
		4. csvFile_CJ.txt [File locations of all the metrics files having both C and Java as code's programming language. /Docs/LanguageOfCode.doc is referred to check the language.]


	Thank you for reading it, and knowing about this project.

	-Navneet Kaushal
	 Graduate Student, Master of Engineering,
	 Department of System and Computer Engineering
	 Carleton University, Ottawa, Canada

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages