| Literature DB >> 33286826 |
Edna Dias Canedo1, Bruno Cordeiro Mendes1.
Abstract
The correct classification of requirements has become an essential task within software engineering. This study shows a comparison among the text feature extraction techniques, and machine learning algorithms to the problem of requirements engineer classification to answer the two major questions "Which works best (Bag of Words (BoW) vs. Term Frequency-Inverse Document Frequency (TF-IDF) vs. Chi Squared (CHI2)) for classifying Software Requirements into Functional Requirements (FR) and Non-Functional Requirements (NF), and the sub-classes of Non-Functional Requirements?" and "Which Machine Learning Algorithm provides the best performance for the requirements classification task?". The data used to perform the research was the PROMISE_exp, a recently made dataset that expands the already known PROMISE repository, a repository that contains labeled software requirements. All the documents from the database were cleaned with a set of normalization steps and the two feature extractions, and feature selection techniques used were BoW, TF-IDF and CHI2 respectively. The algorithms used for classification were Logist Regression (LR), Support Vector Machine (SVM), Multinomial Naive Bayes (MNB) and k-Nearest Neighbors (kNN). The novelty of our work is the data used to perform the experiment, the details of the steps used to reproduce the classification, and the comparison between BoW, TF-IDF and CHI2 for this repository not having been covered by other studies. This work will serve as a reference for the software engineering community and will help other researchers to understand the requirement classification process. We noticed that the use of TF-IDF followed by the use of LR had a better classification result to differentiate requirements, with an F-measure of 0.91 in binary classification (tying with SVM in that case), 0.74 in NF classification and 0.78 in general classification. As future work we intend to compare more algorithms and new forms to improve the precision of our models.Entities:
Keywords: feature extraction; functional requirements; machine learning; non-functional requirements; support vector machines; text normalization
Year: 2020 PMID: 33286826 PMCID: PMC7597130 DOI: 10.3390/e22091057
Source DB: PubMed Journal: Entropy (Basel) ISSN: 1099-4300 Impact factor: 2.524
Descriptions of each type of Non-Functional Requirement (NFR) [11].
| Type | Description |
|---|---|
| Availability (A) | Describes how likely the system is accessible for a user at a given point in time. |
| Fault Tolerance (FT) | Degree to which a system, product or component operates as intended despite the presence of hardware or software faults. |
| Legal & Licensing (L) | Certificates or licenses that the system must have. |
| Look & Feel (LF) | Describe the style of the product’s appearance. |
| Maintainability (MN) | Degree of effectiveness and efficiency with which a product or system can be modified by the intended maintainers. |
| Operability (O) | Degree to which a product or system has attributes that make it easy to operate and control. |
| Performance (PE) | Performance relative to the amount of resources used under stated conditions. |
| Portability (PO) | Degree of effectiveness and efficiency with which a system, product or component can be transferred from one hardware, software or other operational or usage environment to another. |
| Scalability (SC) | Degree to which a product or system can effectively and efficiently be adapted for different or evolving hardware, software or other operational or usage environments. |
| Security (SE) | Degree to which a product or system protects information and data, so that persons or other products or systems have the degree of data access appropriate to their types and levels of authorization. |
| Usability (US) | Degree to which a product or system can be used by specified users to achieve specified goals with effectiveness, efficiency, and satisfaction in a specified context of use. |
Figure 1Phases of requirements classification pipeline.
Number of requirements per label.
| Type of Requirement | Number of Requirements |
|---|---|
| Functional Requirement (FR) | 444 |
| Availability (A) | 31 |
| Legal & Licensing (L) | 15 |
| Look & Feel (LF) | 49 |
| Maintainability (MN) | 24 |
| Operability (O) | 77 |
| Performance (PE) | 67 |
| Scalability (SC) | 22 |
| Security (SE) | 125 |
| Usability (US) | 85 |
| Fault Tolerance (FT) | 18 |
| Portability (PO) | 12 |
| Total | 969 |
Figure 2Distribution of requirement classes on dataset.
Corpus before the text cleaning.
| Text | Class | |
|---|---|---|
| 1 | The system shall refresh the display every 60 s. | PE |
| 2 | The application shall match the color of the schema set forth by Department of Homeland Security. | LF |
| 3 | If projected the data must be readable. On a 10 × 10 projection screen 90% of viewers must be able to read Event/Activity data from a viewing distance of 30. | US |
| 4 | The product shall be available during normal business hours. As long as the user has access to the client PC the system will be available 99% of the time during the first six months of operation. | A |
| 5 | If projected the data must be understandable. On a 10 × 10 projection screen 90% of viewers must be able to determine that Events or Activities are occurring in current time from a viewing distance of 100. | US |
| … | … | … |
| 965 | The system should be portable to various operating environments. | PO |
| 966 | Registered User must be able to maintain his/her session information for at least 60 min of inactive session before the system prompts him to log out of the system. The registered user must be provided with all the options of the E-store regardless of the time when he/she logs in. | F |
| 967 | The entire website must be user-friendly and easily navigable. The website must be provided with a site map for quick access to a particular link according to the requirement specification. The user must be able to find what he/she wants from the site without any difficulty. The website must adhere to branding schemes and the layout of the web pages must be uniform throughout. | US |
| 968 | The system shall support up to 10,000 simultaneous users against the central database at any given time and up to 5000 simultaneous users against the local servers at any one time. The performance of the website must be optimal increase of huge loads and hence appropriate load balancing must be done to achieve this. There can be any number of mirror servers readily available in case of huge loads without the user getting any delay. | PE |
| 969 | The website must provide highest degree of security to the registered users. All the transactions that are made must be secured. The sensitive information passed to and from the website must be secured. Identity theft and other security related issues must be solved. Unauthorized transmission of sensitive information of the user to third party websites for reference must be avoided. On the basis of user agreement the information must be processed. All the information about the registered user must be securely stored in the central database. | SE |
Corpus after the text cleaning.
| Text | Class | |
|---|---|---|
| 1 | System shall refresh display every second. | PE |
| 2 | Application shall match color schema set forth department homeland security. | LF |
| 3 | Project data must readable projection screen viewer must able read event activity data view distance. | US |
| 4 | Product shall available normal business hour long user access client pc system available time first six month operation. | A |
| 5 | Project data must understandable projection screen viewer must able determine event activity occur current time view distance. | US |
| … | … | … |
| 965 | System portable various operate environment. | PO |
| 966 | Register user must able maintain session information least minute inactive session system prompt log system registered user must provide option regardless time log. | F |
| 967 | Entire website must easily navigable website must provide site map quick access particular link accord requirement specification user must able find want site without difficulty website must adhere brand scheme layout web page must uniform throughout. | US |
| 968 | System shall support simultaneous user central database give time simultaneous user local server one time performance website must optimal in case huge load hence appropriate load balancing must do achieve number mirror server readily available case huge load without user get delay. | PE |
| 969 | Website must provide high degree security registered user transaction make must secure sensitive information pass website must secure identity theft security relate issue must solve unauthorized transmission sensitive information user third party website reference must avoid basis user agreement information must process information registered user must securely store central database. | SE |
Listing 1Corpus leaning.
Top 10 most important features.
| Position | BoW | TF-IDF |
|---|---|---|
| 1° | must | must |
| 2° | information | information |
| 3° | user | sensitive |
| 4° | website | website |
| 5° | security | registered |
| 6° | registered | security |
| 7° | secure | secure |
| 8° | sensitive | user |
| 9° | high | third |
| 10° | agreement | issue |
Listing 2Classification with cross-validation.
Results of Bag of Words (BoW), Term Frequency–Inverse Document Frequency (TF-IDF) and Chi Squared binary classification with Support Vector Machine (SVM), Multinomial Naive Bayes (MNB), k-Nearest Neighbors (kNN) and Logist Regression (LR).
| Binary Classification | |||||||||
|---|---|---|---|---|---|---|---|---|---|
|
|
|
| |||||||
| Precision | Recall | F1-score | Precision | Recall | F1-score | Precision | Recall | F1-score | |
| SVM | 0.90 | 0.90 | 0.90 | 0.91 | 0.91 | 0.91 | 0.90 | 0.90 | 0.90 |
| MNB | 0.91 | 0.91 | 0.91 | 0.91 | 0.91 | 0.90 | 0.89 | 0.89 | 0.89 |
| kNN | 0.82 | 0.82 | 0.82 | 0.87 | 0.87 | 0.87 | 0.84 | 0.84 | 0.84 |
| LR | 0.88 | 0.88 | 0.88 | 0.91 | 0.91 | 0.91 | 0.89 | 0.89 | 0.89 |
Results of BoW, TF-IDF and Chi Squared classification with SVM, MNB, kNN and LR with 11 granularities (Non-Functional Requirements).
| Non-Functional Requirements Classification | |||||||||
|---|---|---|---|---|---|---|---|---|---|
|
|
|
| |||||||
| Precision | Recall | F1-score | Precision | Recall | F1-score | Precision | Recall | F1-score | |
| SVM | 0.68 | 0.67 | 0.66 | 0.73 | 0.73 | 0.72 | 0.72 | 0.71 | 0.71 |
| MNB | 0.71 | 0.73 | 0.72 | 0.71 | 0.71 | 0.71 | 0.69 | 0.70 | 0.68 |
| kNN | 0.56 | 0.48 | 0.49 | 0.66 | 0.66 | 0.66 | 0.62 | 0.63 | 0.62 |
| LR | 0.71 | 0.71 | 0.70 | 0.75 | 0.75 | 0.74 | 0.70 | 0.71 | 0.70 |
Results of BoW, TF-IDF and Chi Squared classification with SVM, MNB, kNN and LR with 12 granularities (Functional Requirements and Non-Functional Requirements).
| Classification with 12 Granularities | |||||||||
|---|---|---|---|---|---|---|---|---|---|
|
|
|
| |||||||
| Precision | Recall | F1-score | Precision | Recall | F1-score | Precision | Recall | F1-score | |
| SVM | 0.73 | 0.73 | 0.72 | 0.78 | 0.78 | 0.78 | 0.77 | 0.77 | 0.76 |
| MNB | 0.77 | 0.77 | 0.77 | 0.76 | 0.77 | 0.76 | 0.74 | 0.74 | 0.73 |
| kNN | 0.63 | 0.60 | 0.60 | 0.72 | 0.73 | 0.72 | 0.67 | 0.69 | 0.68 |
| LR | 0.76 | 0.77 | 0.76 | 0.78 | 0.79 | 0.78 | 0.76 | 0.77 | 0.76 |
Results of TF-IDF with SVM classifications (12 granularities—Functional Requirements and Non-Functional Requirements).
| SVM Classification Using TF-IDF (12 Granularities) | |||
|---|---|---|---|
| Precision | Recall | F1-score | |
| Availability (A) | 0.77 | 0.74 | 0.75 |
| Functional Requirement (F) | 0.87 | 0.92 | 0.89 |
| Fault Tolerance (FT) | 0.70 | 0.39 | 0.50 |
| Legal & Licensing (L) | 0.88 | 0.47 | 0.61 |
| Look & Feel (LF) | 0.78 | 0.65 | 0.71 |
| Maintainability (MN) | 0.52 | 0.50 | 0.51 |
| Operability (O) | 0.64 | 0.53 | 0.58 |
| Performance (PE) | 0.82 | 0.82 | 0.82 |
| Portability (PO) | 0.50 | 0.17 | 0.25 |
| Scalability (SC) | 0.57 | 0.55 | 0.56 |
| Security (SE) | 0.71 | 0.77 | 0.74 |
| Usability (US) | 0.66 | 0.72 | 0.69 |
Figure 3Comparison between the F-measure and proportion of each type in the dataset.