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
(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
(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.
JUnit, TestNG, Eclipse, BlueJ, Apache Maven, Mockito, EclEmma, JaCoCo
This course is an introductory software testing course focused on Unit Testing using JUnit (Java) and some other tools.
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.
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
Introduction of JUnit API and its relationship with other language/platform and testing theory.
Demonstrate the advantages of BlueJ as the first Integrated IDE for beginning students.
Introduce the steps to create a test class and test methods both by ad hoc testing and JUnit testing.
Discussion of how to run group of tests and interpret the test results from JUnit.
Java 8 Standard Edition Installation Guide (Standard-alone Version)
Eclipse library files.
Show student the resources and other educational materials provided by the Lecturer. To guide student to learn Programming step by step.
Quiz on Introduction to JUnit and the Software Testing
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.
JUnit Test Framework from the TestCase, TestSuite, Runner, Result, and Test design patterns point of view. Covering both JUnit 4 and 3.
JUnit Annotations Explanation
Introduce the testing of execution program and provide example in both BlueJ and Eclipse
Explain and provide code example for Annotation @Ignore
JUnit Unit Test for the assertion of certain Exception's occurrence.
Test if a program pass a certain Time Limit test.
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.
importing the five files for the Test Framework lecture into Eclipse and show it as an example for JUnit Suite Test.
Parameterized Test Fixture for a simple addition method.
Parameterized JUnit Test for Java language for web-site domain name using regular expression matcher.
JUnit Framework and Building Test Fixtures and Test Cases.
Discuss the general Unit Test concepts. STLC (Soft Testing Life Cycle), software test program development cycle and the advantages and disadvantages of JUnit Test.
Explain the white box testing and black box testing as the introduction for different goal-driven testing program development.
First white box testing example. Also, the simplest one on boolean expression.An alternative for parameterized testing using arrays is given.
Demonstrate how to design a test program for a loop.
Test Program setup for methods using isPalindrome() as example.
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.
Overview of Test Coverage using White Box Testing. And, white box testing techniques Part 1: Exhaustive Testing and Data Flow Testing
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.
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.
Review the Test Coverage topics and the EclEmma tool installation..
Discuss briefly about software testing life cycle and different testing stages.
Overview of various black box testing techniques.
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.
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.
Describe the installation of TestNG tool and use it for an example time out Test for simple performance testing..
Compare JUnit 4 and TestNG to show the advantages of next generation test (TestNG).
Part 2 for comparison between JUnit4 and TestNG programs. In this lecture, we focused on the parameterized test, group test, and the dependency tests.
Introduction to Mockito API package and its installation.
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.
Introduce the basic stubbing and the related setup of Mock, Assertion, and Verification: the so-called 3 phases for using mocks.
Launch a series of two lectures on one example for the stub in Mockito.
Part 2 of two lectures on one example for the stub in Mockito.
Mocking by using spy pattern. Five example programs area given.
Covers the use of Mockito Annotations and Dummy and Fake Objects.
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)
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.
(Additional Lecture) Installation of BlueJ from AP Computer Science Part 1: Java Programming Essentials
People are using Eclipse, Netbeans, IntelliJ and many other Java IDE tools. Why BlueJ is picked as one of the tool?
Keep the video access to the eC Learning Channel reviews for all courses in recent month.
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.
I also serve as an adjunct faculty for on-line M.S. program in Computer Science/Data Science at Lewis University, IL, USA.