Java JUnit for Unit Testing with TestNG, Mockito, EclEmma

JUnit 4.0, Unit Testing, Automatic Software Testing using JUnit, TestNG, Eclipse, EclEmma, Mockito, BlueJ)
4.6 (19 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
536 students enrolled
$19
$20
5% off
Take This Course
  • Lectures 51
  • Length 6.5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 4/2016 English

Course Description

Java JUnit for Unit Testing

This course is an introductory course for unit test and the unit test tool JUnit for Java programming language.


The topics in this course including the following: 
(1) Overview of the course
(2) JUnit software installation on Eclipse and BlueJ
(3) JUnit test fixture, annotations, test case, test suite, and parameterized 
tests. 
(4) Unit Test Strategy: white box testing techniques are discussed for 
students to gain in-sight understanding of how a test case should be built for 
unit test. 
(5) Unit Test/Integration Test/Functional Test Strategty: black box testing 
techniques are used for these tests.  JUnit can not only support unit test.  
It can also be used to support integration test and functional test.  Black 
box testing techniques are discussed for these tests.  EclEmma is 
introduced for code coverage. 
(6) TestNG API: TestNG is the next generation test software (API) which is 
inspired and can be co-operated with JUnit to provide more robust unit test and 
higher level test. 

(7) Mockito API: Mockito can work with JUnit and TestNG as a very powerful 
API to support testing mechanism using mock which allows many test patterns 
involving simulated test, test with substitutes such as dummy, fake object, spy, 
stub and others. 

Software Used: 

JUnit, TestNG, Eclipse, BlueJ, Apache Maven, Mockito, EclEmma, JaCoCo

What are the requirements?

  • Some degree of involvement in Java Programming

What am I going to get from this course?

  • Learn JUnit which is the top software testing tool for mobile application including Android and iOS. http://codecondo.com/10-best-frameworks-for-mobile-app-testing/
  • Learn Eclipse and BlueJ tool for JUnit Testing setup development.
  • Learn general software development concept through JUnit. Experience with JUnit can be used for testing of all other programming language and platform.

What is the target audience?

  • Java Programmer who want to know JUnit test
  • Java Program Tester
  • Java Software Integrator
  • Java Software Quality Assurance Team Member
  • Java Software Test Engineer

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
02:35

This course is an introductory software testing course focused on Unit Testing using JUnit (Java) and some other tools. 

11:24

Introduction to Unit Test and using JUnit in BLuJ. The program can be converted to Eclipse and Netbeans. That will be shown in later lectures.

01:45

Show the internet resources available for eC Learning Channel by Dr. Eric Chou to support this course. 

My Udemy: https://www.udemy.com/user/eric-chou/

Youtube channel: https://www.youtube.com/channel/UCXGHpbLr9O5GydD0Ja9C7Nw

Facebook: https://www.facebook.com/profile.php?id=100007999848206

Quora: https://www.quora.com/profile/Eric-Chou-21 

Twitter: https://twitter.com/eCwarlephant

Email: echou510@gmail.com

Section 2: Introduction to JUnit Software Testing
09:35

Introduction of JUnit API and its relationship with other language/platform and testing theory.

13:37

Demonstrate the advantages of BlueJ as the first Integrated IDE for beginning students.

07:22

Introduce the steps to create a test class and test methods both by ad hoc testing and JUnit testing.

08:08

Discussion of how to run group of tests and interpret the test results from JUnit.

09:42

Use Eclipse for JUnit Testing

Article

Eclipse library files. 

Article

Show student the resources and other educational materials provided by the Lecturer.  To guide student to learn Programming step by step. 

5 questions

Quiz on Introduction to JUnit and the Software Testing

Section 3: JUnit Framework
09:29

Discuss the use of Test Fixture as an introduction for the rest of the chapter. Many different kinds of test fixtures will be presented in the following lectures.

11:57

JUnit Test Framework from the TestCase, TestSuite, Runner, Result, and Test design patterns point of view. Covering both JUnit 4 and 3.

10:09

JUnit Annotations Explanation

08:20

Introduce the testing of execution program and provide example in both BlueJ and Eclipse

02:14

Explain and provide code example for Annotation @Ignore

08:19

JUnit Unit Test for the assertion of certain Exception's occurrence. 

02:53

Test if a program pass a certain Time Limit test. 

02:43

Suite Test and Parameterized Test is where BlueJ starts to show its insufficiency. Therefore, we started to show how to use Eclipse to do JUnit Test. (This is the part one of Suite Test, We used this to warm up the use of Eclipse.) This lecture will be followed by another example program on the Eclipse Suite Test.

03:02

importing the five files for the Test Framework lecture into Eclipse and show it as an example for JUnit Suite Test.

09:43

Parameterized Test Fixture for a simple addition method.

05:30

Parameterized JUnit Test for Java language for web-site domain name using regular expression matcher.

11 questions

JUnit Framework and Building Test Fixtures and Test Cases. 

Section 4: JUnit Concept
03:28

Discuss the general Unit Test concepts. STLC (Soft Testing Life Cycle), software test program development cycle and the advantages and disadvantages of JUnit Test.

07:13

Explain the white box testing and black box testing as the introduction for different goal-driven testing program development.

Section 4 Quiz:
5 questions
Section 5: White Box Testing
06:35

First white box testing example. Also, the simplest one on boolean expression.An alternative for parameterized testing using arrays is given.

04:27

Demonstrate how to design a test program for a loop.

05:50

Test Program setup for methods using isPalindrome() as example.

06:58

Discuss the various ways of preparing the test program for the classes and objects. Also introduce a very simple control flow (create account, withdraw, depost and getBalance()). Please download the attached controlFlowTesting.pdf to investigate into the details about Control Flow Test.

09:07

Overview of Test Coverage using White Box Testing.  And, white box testing techniques Part 1: Exhaustive Testing and Data Flow Testing

08:02

In this lecture, we combine the concept of input space partitioning, branch test coverage, Monte Carlo Testing and corner case handling for white box testing into one example test program. 

09:08

Use a delete element project to demonstrate the idea of corner case, edge case and path coverage.  The delete element method has two version.  One with path node monitor and one without. The path is clearly shown. 

09:03

Review the Test Coverage topics and the EclEmma tool installation.. 

Section 5 Quiz:
5 questions
Section 6: Black Box Testing
11:15

Discuss briefly about software testing life cycle and different testing stages. 

07:17

Overview of various black box testing techniques. 

12:39

Use the BlueJ Object and Class management system to demonstrate the idea of error guessing testing, equivalent class partitioning and ad host testing using an integer reversing example. 

14:42

Discuss cause-effect graphing, decision table and solution space analysis and put them all together into the vending machine change calculation program as an example. 

All Pairs Testing
05:42
Section 6 Quiz:
10 questions
Section 7: Advanced Testing Topics
14:16

Describe the installation of TestNG tool and use it for an example time out Test for simple performance testing..

05:58

Compare JUnit 4 and TestNG to show the advantages of next generation test (TestNG). 

08:53

Part 2 for comparison between JUnit4 and TestNG programs.  In this lecture, we focused on the parameterized test, group test, and the dependency tests. 

08:27

Introduction to Mockito API package and its installation. 

04:47

Unit Testing: Stubs, Mocks and Fakes.  Stubs are an objects to simulate the tester program.  Mocks are objects as substitutes to the real objects. A Fake is a generic term for Mocks en Stubs; objects that replace dependencies.

11:59

Introduce the basic stubbing and the related setup of Mock, Assertion, and Verification: the so-called 3 phases for using mocks. 

15:38

Launch a series of two lectures on one example for the stub in Mockito. 

09:46

Part 2 of two lectures on one example for the stub in Mockito. 

08:52

Mocking by using spy pattern.  Five example programs area given. 

07:52

Covers the use of Mockito Annotations and Dummy and Fake Objects. 

Section 7 Quiz:
6 questions
Section 8: Wrap-up
05:15

Using a simple TicTacToe Program to explain that, after testing, how to pack up a project into an executable .jar file (need JRE) and, then, an executable .exe file (no need for JRE)

03:29

This lecture is the conclusion of this course. We covered the topics, tools and what is not covered in this course.  the lecture works as a guideline for student to move on to the next stage. 

Section 9: Appendix A: Software Issues
06:36

(Additional Lecture) Installation of BlueJ from AP Computer Science Part 1: Java Programming Essentials

https://www.udemy.com/ap-computer-science-a-java-programming-essentials

Article

People are using Eclipse, Netbeans, IntelliJ and many other Java IDE tools.  Why BlueJ is picked as one of the tool? 

Section 10: Appendix B: eC Learning Channel Review and Recent Changes to the Courses
Article

Keep the video access to the eC Learning Channel reviews for all courses in recent month. 

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Dr. Eric Chou, IEEE Senior Member, an engineer and an inventor

I love computational research and its application to real world. i have involved in many large-scale computer/communication product research development in many world-leading company such as HP, Micrel, and many startups. I also involved in founding a startup company. I also enjoy sharing my ideas through teaching. I hold many US and international patents in technical fields such as software development, mobile computing, IC design and communication receiver design. I am also a certified coach in Taekwondo in both UAST and AAU.

Ready to start learning?
Take This Course