Junit framework for unit testing.pdf

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.

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):  
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.


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.


1995 ◽  
Vol 10 (6) ◽  
pp. 245 ◽  
Author(s):  
Gang Luo ◽  
Robert L. Probert ◽  
Hasan Ural
Keyword(s):  

Author(s):  
Cody Watson ◽  
Michele Tufano ◽  
Kevin Moran ◽  
Gabriele Bavota ◽  
Denys Poshyvanyk
Keyword(s):  

2017 ◽  
Vol 29 (12) ◽  
pp. e1841 ◽  
Author(s):  
Mohammad Ghafari ◽  
Konstantin Rubinov ◽  
Mohammad Mehdi Pourhashem K.
Keyword(s):  

Author(s):  
Ryma Abassi ◽  
Sihem Guemara El Fatmi

Specifying a security policy (SP) is a challenging task in the development of secure communication systems since it is the bedrock of any security strategy. Paradoxically, this specification is error prone and can lead to an inadequate SP regarding the security needs. Therefore, it seems necessary to define an environment allowing one to “trust” the implemented SP. A testing task aims verifying whether an implementation is conforming to its specification. Test is generally achieved by generating and executing test cases. Some automated testing tools can be used from which model checkers. In fact, given a system modeling and a test objective, the model checker can generate a counterexample from which test cases can be deduced. The main proposition of this chapter is then a formal environment for SP test cases generation based on a system modeling, a SP specification (test purpose), and the use of a model checker. Once generated, these test cases must be improved in order to quantify their effectiveness to detect SP flaws. This is made through the generation of mutants.


2014 ◽  
Vol 568-570 ◽  
pp. 1469-1478
Author(s):  
Ai Ping Xu ◽  
Yong Min Mu ◽  
Zhi Hua Zhang ◽  
Hui Li Li

Path coverage testing is almost impossible to achieve because of the large number of paths. The function calling path coverage analysis method can guaranty adequate test coverage rate effectively on the precondition of unit testing completion. Based on function calling relations, the methods of dynamic generation function calling path is proposed. For cycle and recursive calling, design instrumentation rules and probe function, complete source code instrumentation, ensure the stub point flow can trace to the function calling relations. The function calling path generation algorithms were designed to split the stub point flow to the dynamic function calling path. Experimental results show that the dynamic function calling path generation method based instrumentation can extract the function calling paths which are executed by test cases and gain the coverage of information automatically.


Author(s):  
ALLEN PARRISH ◽  
DAVID CORDES

Abstract data types (ADTs) represent the fundamental building blocks of object-oriented software development. There have been a variety of techniques in the literature for testing ADT modules. Virtually all of the proposed techniques have involved testing sequences of ADT operations (e.g., for a stack ADT, test the sequence PUSH; PUSH; POP) to discover defects in their interactions. However, the operations inside an ADT module are really nothing more than conventional procedures and functions. Consequently, it is conceivable that conventional subprogram unit testing techniques can be adapted to test ADT operations. To support such testing techniques, test cases are best designed and expressed in terms of data values. When test cases are integers, for example, expressing a test case is trivial (e.g., ‘253’). However, when test cases are data abstractions (such as stacks), this problem is much more difficult due to the variety of different formats in which a single data abstraction can be legitimately viewed. In this paper, we provide a conceptual framework for applying classical white-box and black-box unit testing techniques to ADT operations. We then use this framework to develop a collection of guidelines for determining the best format for test case design, given different module characteristics and testing techniques.


2017 ◽  
Vol 16 (6) ◽  
pp. 6977-6986
Author(s):  
Chelsea Ramsingh ◽  
Paolina Centonze

Today businesses all around the world use databases in many different ways to store sensitive data. It is important that the data stored stay safe and does not get into the wrong hands. To perform data management in a database, the language SQL (Structured Query Language) can be used. It is extremely crucial to prevent these databases from being attacked to ensure the security of the users’ sensitive and private data. This journal will focus on the most common way hackers exploit data from databases through SQL injection, and it presents dynamic and static code testing to find and prevent these SQL cyber attacks by comparing two testing tools. It will also present a comparative analysis and static/dynamic code testing of two SQL injection detection tools. Burp Suite and Vega will be used to identify possible flaws in test cases dealing with users’ sensitive and private information. Currently, there are no comparisons of these two open-source tools to quantify the number of flaws these two tools are able to detect. Also, there are no detailed papers found fully testing the open-source Burp Suite and Vega for SQL Injection. These two open-source tools are commonly used but have not been tested enough. A static analyzer detecting SQL Injection will be used to test and compare the results of the dynamic analyzer. In addition, this paper will suggest techniques and methods to ensure the security of sensitive data from SQL injection. The prevention of SQL injection is imperative and it is crucial to secure the sensitive data from potential hackers who want to exploit it.


Sign in / Sign up

Export Citation Format

Share Document