Exercises in Unit Testing for Java Developers
What you'll learn
- Understanding the importance of testing activity from developers point of view
- The advantages of unit testing
- How to write test code from main code.
- How to anticipate pessmistic scenarios before writing main code.
Requirements
- Java hands on experience
- JUnit basics
- Eclipse IDE (recommended)
Description
This course points out the importance of unit testing, from a preventive point of view, since it is a task that represents the intersection between software development and software testing, corroborated by a workshop with a couple of exercises using Eclipse IDE and JUnit.
Indeed, JUnit allows the execution of test cases independently, using specific annotations.
Eclipse IDE provides a useful plugin called JUnit-Tools that generates test classes in a easy and fast manner.
Assertions (provided by JUnit) are essential when it comes to verifying results produced by tested methods. However, sometimes, test cases' expected result is an Exception. JUnit, provides the necessary semantic to address this situation. It is important to note that expected and actual are two important keywords to use for variables when working with assertions.
This course is outlined as the following:
Introduction
Software Testing
Unit Testing
Integration Testing
Why Test code ?
Best approach for developers ?
JUnit Workshop
Conclusion
Resources:
"Clean Code: A Handbook of Agile Software Craftsmanship" by Robert C. Martin (Fifteenth printing, September 2015);
"Head First Java, Second Edition" by Kathy Sierra & Bert Bates;
"Software Engineering, Ninth Edition" by Ian Sommerville.
Workshops prerequisites:
Java 8+
Eclipse IDE (or any IDE of your choice)
JUnit 5
Maven
Who this course is for:
- Junior to intermediate level Java developers
Instructor
I have been officially involved with software development since 2003 as a student.
I have extensive professional experience, mainly in Java (Spring, JUnit, Mockito), Databases (DB design and SQL), ETL, and algorithm analysis (check my blog).
Code quality and best practices are on top of my priorities.
I created four open-source projects on sourceforge.