Unit Test practical course for programmers
You want to write structured and high-quality unit tests for your Java code? You want to test databases, foreign APIs and foreign code? You want to recognize bad and useless unit tests right away and turn them into good unit tests using proven patterns? You finally want to know how Test-Driven-Development looks like in practice and how you can use TDD in a reasonable way? Then look no further. This Java Unit Testing practical seminar is ideal for all Java programmers who want to learn JUnit 5, Mockito and MockPower in an efficient and practical way by means of clear examples and tasks in order to be able to test Java code cleanly and improve it considerably. Learn more about this Unit Test practical seminar..
- Quick and effective introduction to JUnit 5 and Mockito
- Practical introduction to Test-Driven Development (TDD)
- Best practices for Testable Design, Clean Test and Test Smell
- Advanced techniques such as Test Double
- Significantly improve code quality through good testing
By means of many examples and exercises you will learn the most important Java testing frameworks (JUnit 5 & Moskito) as well as advanced techniques such as TDD from a practical point of view and use them successfully in your current project. You will also learn and apply the golden rules for clean testing and code. You will improve the quality and qoodness of your Java production code and thus shorten the development time.
The course covers a selection of the following topics:
- Test Structure
- Name Conversion
- Test Lifecycle
- Test Data
- Parameterized Test
- Test Double
- Mockito Framework
- PowerMock Framework
- Test Driven Development
- Test Smells Catalog
- Test Readability
- Test Maintainability
- Test Trustworthiness
For more details please see the agenda below.
The JUnit 5, TDD and Mockito seminar at the Munich Coding Academy is aimed at programmers with basic Java knowledge. It does not require knowledge of old JUnit versions.
Individuell: wir gehen gezielt auf Dich ein und berücksichtigen Deine Vorkenntnisse, Wunschthemen und Schwerpunkte
Strukturiert und leicht verständlich
Bringe deine Karriere, Studium oder Ausbildung auf die nächste Stufe: mit Zertifikat
Sicher und eigenständig Programme entwickeln (ob privat, beruflich oder für dein Startup)
Viel, viel, viel Praxis: sofort anwendbare Ergebnisse
kleine Gruppen: max. 8 Teilnehmer im 3-Tages-Kurs max. 15 Teilnehmer im Online-Coaching
Von Experten nach der Raed- Methode® entwickelt & auf die Anforderungen von Tech-Unternehmen im Jahr 2020 ausgerichtet
E-Mail-Support auch nach Ende des Kurses
The Unit 5 with Mockito training at the Coding Akademie Munich is scheduled for 3 days and is perfect for all Java programmers who want to test their own or third-party Java code. With unit tests you can check whether your code does exactly what is expected of it. Experience shows that unit tests increase the quality of programming code. This is because writing tests requires a close look at the production code. Often you discover errors (bugs) and come up with better solutions. This Unit Testing course is about mastering the basics of JUnit 5 , Mockito, PowerMock and Test-Driven-Development with the help of many examples and tasks, so that you can use these techniques immediately. Mastering the basics of JUnit 5 , Mockito, PowerMock and Test-Driven-Development with the help of many examples and tasks, so that you can use these techniques immediately.
With JUnit 5 you can test your production code quickly and easily. The principle is relatively simple, it is about the question: what do I expect from my method and what does it deliver exactly, i.e. a target/actual comparison of the values. JUnit 5 is the successor to JUnit 4. It is a testing framework that also helps you to easily test new language concepts such as lambda expressions in Java - as of JUnit 5, test methods are even allowed to have parameters. With Mockito you can test APIs code, database (CRUD operations) and client/server applications by imitating and simulating the behaviour of such code locally.
What do you learn on the first day?
You learn how to write your first unit testing programme. We start slowly and look at the should/actual principle of testing frameworks. You learn how the test structure should look like, how you should name your test methods and how you can find the test data. The equivalence classes and boundary value techniques are suitable for this. You master the syntax and semantics of unit tests such as annotations and assertion. You will also learn and master advanced techniques such as parameterised tests on the first day. After this day, you will already be able to write and apply unit tests for your Java code.
What do you learn on the second day?
On the second day, you learn how to test database and third-party APIs by simulating their code. This is what the Test Double technique is for. Test Double is a collective term for 5 techniques: Dummy, Fake, Stub, Spy and Mock. Since it is quite time-consuming and sometimes difficult to implement such test double techniques from scratch, there are already frameworks that largely realise and simplify these techniques. One of them is Mockito and PowerMocks. You will learn how to set up and run Mockito and PowerMock. For this we look at an order system program written in Java EE or Java Spring. With Mockito and PowerMock we test the ordering process and the basic CRUD database operations (Create, Read, Update, Delete) that are common in such a system.
With JUnit 5, Mockito and PowerMock's basics you will already be able to write extensive tests for your Java code after the second day. You will even notice that this unit test writing, which is seen as a tedious afterthought by many programmers, is not such a chore after all and is even fun and enjoyable when you run the test and suddenly everything is green. It is a nice and pleasant feeling to experience!
What do you learn on the third day?
The last Unit Testing training with Java is about how to write good tests. Here you will learn the SOLID principles for testable design. Then we look at the Test-Driven-Development (TDD) technique. TDD implements the "Test First: Test code before Production code" method. TDD slows down the development speed at the beginning, but later on it catches up massively in speed and is definitely more advantageous than writing the tests afterwards. After all, Clean Code is largely based on writing unit tests before production code, so you have to think about the production code in a fundamental way! You will also learn the important rules for writing meaningful and good tests and the best practices. This will help you recognise the so-called "test smells". Test smells is a term for bad tests that bring more disadvantages than advantages. There is a long catalogue for this, which divides the test smells into 3 categories and in each category there are several test smells cases. We look at the most important test smells cases.
The Unit Test course for Java programmers is conducted by one of the following trainers:
Expert: Java, Python, Clean Code, Clean SW-Architecture, Refactoring, Testing, Train The Trainer
- Doctorate at LMU in the field of programming languages (2022).
References: 17 years of teaching and industry experience, thereof 12 years lecturer at the Ludwig-Maximilians-University Munich for Java, Python, Efficient Algorithms, Multiple awardsfor outstanding teaching at the LMU, book author for Java & soon Python at Springer and Orelly Verlag, developer of the RAED-Teaching Method®, Train the Trainer instructor, team training in Java and Python for BMW, VW, BA, SIEMENS, AGFA-Healthcare, TÜV Süd, Schufa AG, ..
Dr. Matthias Hölzl
- Doctorate at LMU in the field of Software Engineering
References: 30 years of teaching and industrial experience. Of which 18 years at Ludwig-Maximilians-Universität Munich, most recently as Professor for Software and Computational Systems Engineering. Training, technical coaching for machine learning, deep learning, process automation as well as review and improvement of software architecture in large IT projects. Python and Java trainings for Deutsche Bank, BMW, BA, VKB, etc. Editor and author of several books at Springer-Verlag and author of numerous scientific publications.
Dr. Max Meier
Expert: .NET/C#, Software Architecture, Microservice, API-Design, Unit Test and TDD, SQL Database
- Doctorate at the LMU in the field of software engineering
References: 15 years of professional experience as software developer, software architect and consultant in the following industries: system gastronomy, e-commerce, insurance, interactive media. Conception, design, implementation and management of large software projects as the leading architect. Various trainings in C# and .NET, microservices, unit test and database for VW and various IT companies.
Prof. Dr. Peer Kröger
Expert: Artificial Intelligence, Data Science, Big Data, SQL/NoSQL Database, Python, Java
- Doctorate at LMU in the field of Database and Data Science
References: Many years of practical experience in the implementation of data science projects as well as in consulting and training in the automotive industry, financial service providers and SMEs, among others. Approx. 150 peer-reviewed publications (cited over 8000 times) on the topic of data science, data mining, machine learning and AI. Member of the AI competence centre Munich Center for Machine Learning (MCML) at LMU Munich and professor for information systems and data mining at CAU Kiel.
Of course, as a participant in the Java Unit Test course for programmers you will receive a certificate. The prerequisite for this is the complete participation in all course units and programming tasks and the successful programming of a small final project. However, after this intensive unit testing course, this will be more fun than stressful for you.
The agenda is written in English due to the numerous technical terms. Descriptions and course material are in German. You can book the course either in German or English.
All seminar contents are individually adapted to the wishes of our participants. They can vary depending on the level of knowledge and will be defined together with the seminar leader on day 1. In this Java unit test seminar you can choose from the following topics:
Java Unit Testing for Programmers Day 1
- Test Motivation
- Test Frameworks
- JUnit 4 and JUnit 5
- JUnit 5 vs. JUnit 4
- Testing Questions
- Test Structure
- Test Life Cyce
- The AAA-Rule
- Name Conversions
- Test Data
- Happy Path
- Exception Path
- Equivalence classes
- Test Strategy
- Functional Interface
Java Unit Testing for Programmers Day 2
- Testing Database?
- Maven or Gradle
- Spring Example
- System Under Test SUT
- Mockito Idee
- Mockito Annotations
- when then Return
- doReturn when
- when thenThrow
- when thenAnswer
- doNothing when
- given withReturn
- given willThrow
- given willAnswer
- Mockito Steps
- Setting Expectations
- Hamcrest Matcher
- Mockito Spy
- Mockito Restriction
- Final and Private Methods?
- Setting up PowerMock
- Mocking Static Method
- Invoking Private Method
- Mocking a Constructor
Unit Testing with Java Day 3
Test Driven Development
- Baby Steps
- TDD Advantages
- SOLID Principle
- Single Responsibility
- Open Close
- Liskov Substitution
- Interface Segregation
- Dependency Inversion
- Clean Test Rules
- Test Readability
- Test Maintainability
- Test Trustworthiness
- Test Smells Catalog