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.
Periodicity:January - March'2018
DOI : 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, which contains calls to unit under test (class or method) and verifying the
output with expected one. Coverage criteria play 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 are developed to address
these dependency issues like file system and database interactions. This paper addresses the networking interactions
based on mocking approach, where some of the java.net API classes like InetAddress, URL, URI and Socket, etc were
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.

Keywords

Dependenciest, Unit Testing, Junit, Mocking.

How to Cite this Article?

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

References

Purchase Instant Access

Single Article

North Americas,UK,
Middle East,Europe
India Rest of world
USD EUR INR USD-ROW
Pdf 35 35 200 20
Online 35 35 200 15
Pdf & Online 35 35 400 25

If you have access to this article please login to view the article or kindly login to purchase the article
Options for accessing this content:
  • If you would like institutional access to this content, please recommend the title to your librarian.
    Library Recommendation Form
  • If you already have i-manager's user account: Login above and proceed to purchase the article.
  • New Users: Please register, then proceed to purchase the article.