JUnit Flashcards
1
Q
What does a Unit refer to?
A
The smallest testable subset of an application. In most languages that’s functions or methods.
2
Q
What are some annotations?
A
- Test - Denotes a method as a test.
- Before - Runs before every test.
- BeforeClass - Runs once before the class is run.
- After - Runs after each test.
- AfterClass - Runs once after the tests are done.
- Ignore - ignore a test temporarily
3
Q
What are the types of assert methods?
A
- assertTrue
- assertEquals
- assertFalse
- assertSame
- assertNotSame
- assertNull
- assertNotNull
- assertArrayEquals
- assertThat
4
Q
What are some of the different types of testing?
A
- Unit Testing
- Make sure methods/functions are working properly.
- Not meant to catch bugs
- Regression Testing
- New features don’t break old ones
- BDD - behavior driven
- Integration Testing
- Make sure new code is compatible with the existing
code base - Complete system testing
- Make sure new code is compatible with the existing
- Stress Testing
- Make sure you application can perform well with
large loads of traffic or large calculations.
- Make sure you application can perform well with
- Acceptance Testing
- Make sure end users like the new state of the
application. - Easy to understand
- Make sure end users like the new state of the
- Compliance
- Laws