Course Summary
JUnit training course provides an introduction to Java's most-popular automated unit testing framework.
You will learn about the unit testing, JUnit framework and how to set it up and use it with your Java projects. You will also get familiar with the test-driven development as a methodology for writing highly reliable Java code
Duration
1 day.
Objectives
By taking this class, students will be able to:
- Explain JUnit's role in Java testing
- Setup, integrate, and get started with JUnit
- Understand the differences between JUnit 3 and JUnit 4
- Design, organize, and develop JUnit tests in either JUnit 3 syntax or JUnit 4 syntax.
- Use best practices in both testing and software development
- Improve the quality and effectiveness of their software and tests
Audience
This course is designed for Java developers, quality-assurance engineers, and development managers.
Solid understanding of Java technology is needed to get the full benefit of this course.
Prior familiarity with testing concepts (e.g. unit, integration, functional, load) is recommended.
Additional Notes
About Your Instructor
Aleksandar (Sasa) Gargenta is the technology brains at Marakana. Always on top of latest in software, Aleksandar is company's radar for technology that matters.
Aleksandar is the author of Marakana's Java, Advanced Java, Spring/Hibernate, JBoss, Apache, XML/XSL, and JUnit/TestNG courses. Phew. And if that's not enough, he's also the chief architect of Marakana Spark, the on-demand software platform that powers marakana.com and a number of other training companies.
As an instructor he's taught hundreds of courses for everyone from Apple to Disney, from NASA to the Department of Defense. His instructor ratings are consistently between Great and Outstanding.
Aleksandar also runs the San Francisco Java and San Francisco Android User Groups with over a thousand members between the two.
Sasa is also a father, photographer, hiker, and a race-car driver.
About The Version
The course explains both JUnit 3 and JUnit 4, since the older version is still in wide-spread use, but JUnit 4 has more advantages with its annotation-driven syntax. Exercises can be done in either style of JUnit.
Java Meetup Organized by Marakana
Marakana team organizes and runs the San Francisco Java Meetup - an interactive group of Java developers. In our monthly meetings, we discuss Java landscape from both technology and business angles. We often have great presentations by industry experts, group discussions, as well as hands-on sessions. If you are in San Francisco Bay Area, we encourage you to join the group and meet other Java developers.
Outline
On Testing
- Why testing?
- Test, Test, and Test Some More
- Overview of JUnit's role in testing (automated, unit, isolated, etc.)
Introducing JUnit
- JUnit 101
- JUnit 3 vs. JUnit 4 vs. TestNG
- Getting started
- Using JUnit within Eclipse
- Test methods: testMethod or @Test method
- Assertions in TestCase
- Testing for exceptions
- Testing isolations
- Creating and organizing test fixtures with setUp/tearDown and @Before/@After
- Composing Test Cases into Test Suites
- Combining Test Suites
- Organizing Tests and Test Suites
- Executing Tests
- Showing Test Results
- Integration with Ant
- Reporting (XML and HTML)
Why JUnit?
- Testing with JUnit – Advantages
- Testing with JUnit – Disadvantages
- Exercise – Testing Simple Data Structures
JUnit Extensions
- Overview of JUnit Extensions: dbUnit, sqlUnit, httpUnit, htmlUnit, EasyMock, xmlUnit, etc.
- Testing with Stubs
- Testing with Mocks using EasyMock
Test-Driven Development
- Best Practices with JUnit and TDD
- Designing Java code with testing in mind
- Integration and functional testing with JUnit
- Exercise – Testing Complex Data Structures
Course Testimonials
Great class - love it!