Unit Under Test Identification Using Natural Language Processing Techniques

Unit under test identification (UUT) is often difficult due to test smells, such as testing multiple UUTs in one test. Because the tests best reflect the current product specification they can be used to comprehend parts of the production code and the relationships between them. Because there is a s...

Full description

Bibliographic Details
Main Authors: Madeja Matej, Porubän Jaroslav
Format: Article
Language:English
Published: De Gruyter 2020-12-01
Series:Open Computer Science
Subjects:
Online Access:https://doi.org/10.1515/comp-2020-0150
id doaj-10afe9488f1d4871ae6d06f1d1a35858
record_format Article
spelling doaj-10afe9488f1d4871ae6d06f1d1a358582021-10-03T07:42:29ZengDe GruyterOpen Computer Science2299-10932020-12-01111223210.1515/comp-2020-0150comp-2020-0150Unit Under Test Identification Using Natural Language Processing TechniquesMadeja Matej0Porubän Jaroslav1Department of computers and Informatics, Technical University of Košice, 042 00, KošiceDepartment of computers and Informatics, Technical University of Košice, 042 00, KošiceUnit under test identification (UUT) is often difficult due to test smells, such as testing multiple UUTs in one test. Because the tests best reflect the current product specification they can be used to comprehend parts of the production code and the relationships between them. Because there is a similar vocabulary between the test and UUT, five NLP techniques were used on the source code of 5 popular Github projects in this paper. The collected results were compared with the manually identified UUTs. The tf-idf model achieved the best accuracy of 22% for a right UUT and 57% with a tolerance up to fifth place of manual identification. These results were obtained after preprocessing input documents with java keywords removal and word split. The tf-idf model achieved the best model training time and the index search takes within 1s per request, so it could be used in an Integrated Development Environment (IDE) as a support tool in the future. At the same time, it has been found that, for document preprocessing, word splitting improves accuracy best and removing java keywords has just a small improvement for tf-idf model results. Removing comments only slightly worsens the accuracy of Natural Language Processing (NLP) models. The best speed provided the word splitting with average 0.3s preprocessing time per all documents in a project.https://doi.org/10.1515/comp-2020-0150natural language processingunit under testprogram comprehensionautomated identificationsoftware maintenance
collection DOAJ
language English
format Article
sources DOAJ
author Madeja Matej
Porubän Jaroslav
spellingShingle Madeja Matej
Porubän Jaroslav
Unit Under Test Identification Using Natural Language Processing Techniques
Open Computer Science
natural language processing
unit under test
program comprehension
automated identification
software maintenance
author_facet Madeja Matej
Porubän Jaroslav
author_sort Madeja Matej
title Unit Under Test Identification Using Natural Language Processing Techniques
title_short Unit Under Test Identification Using Natural Language Processing Techniques
title_full Unit Under Test Identification Using Natural Language Processing Techniques
title_fullStr Unit Under Test Identification Using Natural Language Processing Techniques
title_full_unstemmed Unit Under Test Identification Using Natural Language Processing Techniques
title_sort unit under test identification using natural language processing techniques
publisher De Gruyter
series Open Computer Science
issn 2299-1093
publishDate 2020-12-01
description Unit under test identification (UUT) is often difficult due to test smells, such as testing multiple UUTs in one test. Because the tests best reflect the current product specification they can be used to comprehend parts of the production code and the relationships between them. Because there is a similar vocabulary between the test and UUT, five NLP techniques were used on the source code of 5 popular Github projects in this paper. The collected results were compared with the manually identified UUTs. The tf-idf model achieved the best accuracy of 22% for a right UUT and 57% with a tolerance up to fifth place of manual identification. These results were obtained after preprocessing input documents with java keywords removal and word split. The tf-idf model achieved the best model training time and the index search takes within 1s per request, so it could be used in an Integrated Development Environment (IDE) as a support tool in the future. At the same time, it has been found that, for document preprocessing, word splitting improves accuracy best and removing java keywords has just a small improvement for tf-idf model results. Removing comments only slightly worsens the accuracy of Natural Language Processing (NLP) models. The best speed provided the word splitting with average 0.3s preprocessing time per all documents in a project.
topic natural language processing
unit under test
program comprehension
automated identification
software maintenance
url https://doi.org/10.1515/comp-2020-0150
work_keys_str_mv AT madejamatej unitundertestidentificationusingnaturallanguageprocessingtechniques
AT porubanjaroslav unitundertestidentificationusingnaturallanguageprocessingtechniques
_version_ 1716846164982104064