Beruflich Dokumente
Kultur Dokumente
Pune-412207
Submitted by:
Kirti Reddy(BEA_39)
Charul Joshi(BEA_40)
Danesh Bastani(BEA_48)
pg. 1
DEPARTMENT OF COMPUTER ENGINEERING
CERTIFICATE
Date:
pg. 2
ACKNOWLEDGEMENT
This is a great pleasure & immense satisfaction to express our deepest sense of
gratitude & thanks to everyone who has directly or indirectly helped us in
completing our Project work successfully.
pg. 3
INDEX
Page
Sr. No. Chapters (14 points)
No
List of figures 2
1. Abstract 3
2. INTRODUCTION 6
3. MOTIVATION 7
PROPOSED SYSTEM 9
5.
METHODOLOGY
6. SYSTEM REQUIREMENTS 10
ADVANTAGES AND 11
7.
DISADVANTAGES
8. APPLICATIONS 11
9. CONCLUSION 13
10. REFERENCES 14
pg. 4
LIST OF FIGURES
pg. 5
ABSTRACT
A unit test is a piece of code written by a developer that executes a specific functionality in the
code to be tested and asserts a certain behavior or state. The percentage of code which is tested
by unit tests is typically called test coverage. System Integration Test is done to test the
complete integrated system. Modules or components are tested individually before integrating
the components. Once all the modules are tested, system integration testing is done
by integrating all the modules and the system as a whole is tested.
pg. 6
CHAPTER 2
INTRODUCTION
JUnit
Integration test
Integration testing is the phase in software testing in which individual software
modules are combined and tested as a group. Integration testing is conducted to
evaluate the compliance of a system or component with specified functional
requirements. It occurs after unit testing and before validation testing.
pg. 7
CHAPTER 3
MOTIVATION
JUnit is a framework for implementing testing in Java.
It provides a simple way to explicitly test specific areas of a Java program, it is
extensible and can be employed to test a hierarchy of program code either
singularly or as multiple units.
Using a testing framework is beneficial because it forces you to explicitly
declare the expected results of specific program execution routes. When debugging
it is possible to write a test which expresses the result you are trying to achieve and
then debug until the test comes out positive.
JUnit is an open source unit testing tool that helps to test units of code. It is mainly
used for unit testing Java project, however, it can be used with Selenium tool to
automate testing of Web applications. So you can even perform automation testing
of a web application with JUnit.
pg. 8
CHAPTER 4
Creating the right test gives precise feedback loop mechanism between both
developers and test engineers.
Tests run faster compared to end to end tests.
pg. 9
CHAPTER 5
pg. 10
CHAPTER 6
SYSTEM REQUIREMENTS
Software Requirement:
Eclipse
Jdk 8.0
pg. 11
CHAPTER 7
ADVANTAGES:
Every time you make a small or a big modification in the code (in any function), you
can make sure that the function is performing well and has not broken any older
functionality by executing all JUnit test cases in one go written for that function.
Easily create and most importantly manage a rich unit test case suite for the entire
software.
JUnit has become a standard for testing in Java programming language and is
supported by almost all IDE’s e.g Netbeans, Eclipse etc. So, you work in any
standarized IDE environment, you would find the support of JUnit in it.
You can also integrate Ant with JUnit to allow executing test suites (all unit test cases)
as part of the build process, capturing their output, and generating rich color enhanced
reports
JUnit ensures that every single part or functioning in your software is tested even
before module or System level testing is performed.
pg. 12
DISADVANTAGES:
There is a limit to the number of scenarios and test data that the developer can use to
verify the source code. So after he has exhausted all options there is no choice but to stop
unit testing and merge the code segment with other units
pg. 13
CHAPTER 8
APPLICATIONS
pg. 14
Code for Testing
Code :
TestJunit.java
pg. 15
junittest.java
import org.junit.Test;
@Test
public void test()
{
TestJUnit test = new TestJUnit();
int result = test.addNumber(5, 7);
assertEquals(12,result);
int result1 = test.subNumber(8, 7);
assertEquals(1,result1);
int result2 = test.mulNumber(5, 7);
assertEquals(35,result2);
}
pg. 16
Chapter 7
OUTPUT:
pg. 17
fig7.1 .Output of JUnit testing
This is the final output of junit testing. In this there are two files i.e
Testunit.java and junittest.java. Test class is used in junit.java and junit tool
class is used in junittool.java. We used two methods in junit.java and
junitool.java. This program is finally run without any error.
pg. 18
CHAPTER 9
CONCLUSION
pg. 19
REFERENCES
1. https://www.google.com/search?q=junit+testing&rlz=1C1CHB
F_enIN865IN865&oq=junit&aqs=chrome.2.69i59j69i57j0l2j6
9i60l2.8251j0j7&sourceid=chrome&ie=UTF-8
2. http://softwaretestingfundamentals.com/integration-testing
pg. 20