Investigating the Effect of Aspect-Oriented Refactoring on the Unit Testing Effort of Classes: An Empirical Evaluation

Author(s):  
Mourad Badri ◽  
Aymen Kout ◽  
Linda Badri

This paper aims at investigating empirically the effect of aspect-oriented (AO) refactoring on the unit testability of classes in object-oriented software. The unit testability of classes has been addressed from the perspective of the unit testing effort, and particularly from the perspective of the unit test cases (TCs) construction. We investigated, in fact, different research questions: (1) the impact of AO refactoring on source code attributes (size, complexity, coupling, cohesion and inheritance), attributes that are mostly related to the unit testability of classes, (2) the impact of AO refactoring on unit test code attributes (size, assertions, invocations and data creation), attributes that are indicators of the effort involved to write the code of unit TCs, and (3) the relationships between the variations observed after AO refactoring in both source code and unit test code attributes. We used in the study different techniques: correlation analysis, statistical tests and linear regression. We performed an empirical evaluation using data collected from three well-known open source (Java) software systems (JHOTDRAW, HSQLBD and PETSTORE) that have been refactored using AO programming (AspectJ). Results suggest that: (1) overall, the effort involved in the construction of unit TCs of refactored classes has been reduced, (2) the variations of source code attributes have more impact on methods invocation between unit TCs, and finally (3) the variations of unit test code attributes are more influenced by the variation of the complexity of refactored classes compared to the other class attributes.

2012 ◽  
Vol 2012 ◽  
pp. 1-13 ◽  
Author(s):  
Mourad Badri ◽  
Fadel Toure

The aim of this paper is to evaluate empirically the relationship between a new metric (Quality Assurance Indicator—Qi) and testability of classes in object-oriented systems. The Qi metric captures the distribution of the control flow in a system. We addressed testability from the perspective of unit testing effort. We collected data from five open source Java software systems for which JUnit test cases exist. To capture the testing effort of classes, we used different metrics to quantify the corresponding JUnit test cases. Classes were classified, according to the required testing effort, in two categories: high and low. In order to evaluate the capability of the Qi metric to predict testability of classes, we used the univariate logistic regression method. The performance of the predicted model was evaluated using Receiver Operating Characteristic (ROC) analysis. The results indicate that the univariate model based on the Qi metric is able to accurately predict the unit testing effort of classes.


Author(s):  
Saurabh Rawat ◽  
Anushree Sah ◽  
Ankur Dumka

Testing of software remains a fundamentally significant way to check that software behaves as required. Component-based software testing (CBST) is a crucial activity of component-based software development (CBSD) and is based on two crucial proportions: components testing by developers with the source code (e.g., system testing, integration testing, unit testing, etc.) and components testing by end users without source code (black box testing). This work proposes a black box testing technique that calculates the total number of interactions made by component-based software. This technique is helpful to identify the number of test cases for those components where availability of source code is questionable. On the basis of interaction among components, the authors draw a component-link graph and a direct-indirect-link matrix, which helps to calculate the number of interactions in component-based software.


Author(s):  
Xiaobing Sun ◽  
Xin Peng ◽  
Hareton Leung ◽  
Bin Li

Regression testing is essential to ensure software quality during software evolution. Two widely-used regression testing techniques, test case selection and prioritization, are used to maximize the value of the continuously enlarging test suite. However, few works consider both these two techniques together, which decreases the usefulness of the independently studied techniques in practice. In the presence of changes during program evolution, regression testing is usually conducted by selecting the test cases that cover the impact results of the changes. It seldom considers the false-positives in the information covered. Hence, the effectiveness of such regression testing techniques is decreased. In this paper, we propose an approach, ComboRT, which combines test case selection and prioritization together to directly generate a ranked list of test cases. It is based on the impact results predicted by the change impact analysis (CIA) technique, FCA–CIA, which generates a ranked list of impacted methods. Test cases which cover these impacted methods are included in the new test suite. As each method predicted by FCA–CIA is assigned with an impact factor value corresponding to the probability of this method to be impacted, test cases are then ordered according to the impact factor values of the impacted methods. Empirical studies on four Java based software systems demonstrate that ComboRT can be effectively used for regression testing in object-oriented Java-based software systems during their evolution.


Author(s):  
Stefan Zugal ◽  
Cornelia Haisjackl ◽  
Jakob Pinggera ◽  
Barbara Weber

Declarative approaches to process modeling are regarded well suited for highly volatile environments as they provide a high degree of flexibility. However, problems in understanding and maintaining declarative process models impede their usage. To compensate for these shortcomings, Test Driven Modeling (TDM) has been proposed. This paper reports on an empirical investigation in which TDM is viewed from two different angles. First, the impact of TDM on communication is explored in a case study. Results indicate that domain experts are inclined to use test cases for communicating with the model builder (system analyst) and prefer them over the process model. The second part of the investigation, a controlled experiment, investigates the impact of TDM on process model maintenance. Data gathered in this experiment indicates that the adoption of test cases significantly lowers cognitive load and increases the perceived quality of changes.


2020 ◽  
Author(s):  
Praveen Kumar Venkatesan ◽  
Rikhil Gade Rozario ◽  
Jinan Fiaidhi

Testing software before deploying is a mandatory task in SDLC. Various types of testing tools are used to test the software. This research focuses on JUnit framework to perform unit testing for Java applications. We have developed a Banking Inventory application using spring framework by connecting the application to the MongoDB. The application contains operations such as Create, Update, Delete and find for the customers and Unit test cases has been developed for all the modules using JUnit framework and the test cases are discussed and validated.


Author(s):  
Jennifer Thompson ◽  
Calum Davey ◽  
Richard Hayes ◽  
James Hargreaves ◽  
Katherine Fielding

Permutation tests are useful in stepped-wedge trials to provide robust statistical tests of intervention-effect estimates. However, the permute command does not produce valid tests in this setting because individual observations are not exchangeable. We introduce the swpermute command, which permutes clusters to sequences to maintain exchangeability. The command provides additional functionality for performing analyses of stepped-wedge trials. In particular, we include the withinperiod option, which performs the specified analysis separately in each period of the study with the resulting period-specific intervention-effect estimates combined as a weighted average. We also include functionality to test nonzero null hypotheses to aid in the construction of confidence intervals. Examples of the application of swpermute are given using data from a trial testing the impact of a new tuberculosis diagnostic test on bacterial confirmation of a tuberculosis diagnosis.


Author(s):  
Saiful Bahri Hisamudin Et.al

Uncontrollability is troublesome for unit testing. It causes a non-deterministic behavior where the same input can produce different results based on different executions. The non-deterministic characteristic makes it impossible to test the internal logic of a method because it suffers from tight coupling, a single responsibility principle violation, being an untestable code, being non-reusable or hard to maintain. This paper describes a tool, namely the non-deterministic Code Detection Tool (nCODET) that aims to assist novice developers to write testable codes by avoiding the non-deterministic characteristic in their codes. Our research focuses on the unit testability of classes; particularly the effort involvedin constructing unit test cases.


The software system evolves and changes with the time, so the test suite must be maintained according to code changes. Maintaining test cases manually is an expensive and time-consuming activity, especially for large test suites, which has motivated the recent development of automated test-repair techniques. Several researchers indicate that software evolution shows a direct impact on test suites evolution, as they have strong relationships and they should be evolved concurrently. This article aims to provide statistical evidence of having this significant relationship between the code production and its associated test suites. Seven systems along with releases are collected and eight metrics were calculated to be used in this study. The result shows how the systems under study are evolving and have a high impact on their test suites, although two metrics provide a negative significant relationship.


2020 ◽  
Author(s):  
Praveen Kumar Venkatesan ◽  
Rikhil Gade Rozario ◽  
Jinan Fiaidhi

Testing software before deploying is a mandatory task in SDLC. Various types of testing tools are used to test the software. This research focuses on JUnit framework to perform unit testing for Java applications. We have developed a Banking Inventory application using spring framework by connecting the application to the MongoDB. The application contains operations such as Create, Update, Delete and find for the customers and Unit test cases has been developed for all the modules using JUnit framework and the test cases are discussed and validated.


Sign in / Sign up

Export Citation Format

Share Document