JUnit Testing
Duration: 1 to 3 days |
Participants: This course is for users, developers, and technical staff at all levels. |
Objectives:
Upon successful completion of this course you will be able to:
- Use JUnit in an Eclipse, RAD or similar environment. - Use best practices for testing. - Use Test Driven Development. - Use JUnit to debug your Java code. |
Overview: This course will allow you to use JUnit to write repeatable tests. JUnit is a unit testing framework for the Java programming language and has been important in the development of test-driven development. JUnit is traditionally written with a green "J" and a red "U". |
Prerequisites: Requires knowledge of Java Programming and experience using Eclipse. |
Format: Lecture with extensive hands-on workshops to reinforce the lecture material. |
Topic Outline:
- JUnit Testing Testing Approach Typical Testing Stages Summary of Testing - Testing Steps JUnit Setup in Eclipse/RAD Create an Interface with Three Methods Generate Java programs with empty methods Create Test Program @Test fail Method Run JUnit Add Tests "assert" test methods @Before @Before /@BeforeClass @After / @AfterClass Test Floating Point with Deltas JUnit Annotations / Order JUnit Rules for Test Class JUnit Terminology - Testing in SDLC: TDD - Test Runners Test Case Test Suite JUnitCore façade - Runner AllTests.java - JUnit Test Suite - More JUnit Testing assertSame versus assertEquals @Ignore - Good Practice Testing for Expected Exceptions - old and new approaches @Test(expected= @Test (other options - Parameterized Tests @RunWith @Parameters Limitations in JUnit 4 No Test Suites for Parameterized Tests - Theories Theories Testing Imports for Theories Parameterized Tests Theories Tests Theories Output @Theory @DataPoint - JUnit Best Practices - JUnit 5 Additional annotations Different meanings from JUnit 4 Jupiter Platform Vintage |
|