Wednesday 25 September 2019

Optimizing the Code Coverage by Controlling Environmental Dependencies in Unit Testing

Volume 12 Issue 3 January - March 2018

Research Paper

Optimizing the Code Coverage by Controlling Environmental Dependencies in Unit Testing

C. Shobabindu*, K. K. Baseer**, V. Ravikanth***
* Professor, Department of Computer Science and Engineering, JNTUA, Ananthapuramu, Andhra Pradesh, India.
** Associate Professor, Department of Information Technology, Sree Vidyanikethan Engineering College, Tirupati, Andhra Pradesh, India.
*** Department of Computer Science and Engineering, JNTUA, Ananthapuramu, Andhra Pradesh, India.
Bindu, S, C., Baseer, K, K., and Ravikanth, V. (2018). Optimizing the Code Coverage by Controlling Environmental Dependencies in Unit Testing. i-manager's Journal on Software Engineering, 12(3), 8-15. https://doi.org/10.26634/jse.12.3.14555

Abstract

Unit testing in object oriented development aims to determine whether the individual units are working as intended or not, which is accomplished by executing tests, and contains calls to unit under test (class or method) and verifies the output with expected one. Coverage criteria plays a significant role to decide if the unit testing was well performed or not. A successful unit test will have high amount of coverage. But often the execution of unit depends on environmental dependencies like file system, user interaction, database, and networks. Some techniques were developed to address these dependency issues. This paper addresses the networking interactions based on mocking approach, where some of the java.net Application Programming Interface (API) classes like InetAddress, Uniform Resource Locator (URL), Uniform Resource Identifier (URI), Socket, etc., are mocked. Then the work was evaluated against selected java programs, whose source code contains usage of java.net API classes. The results show improvement in the code coverage when unit testing is performed with network mocking.

No comments:

Post a Comment