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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the types of assert methods?

A
  • assertTrue
  • assertEquals
  • assertFalse
  • assertSame
  • assertNotSame
  • assertNull
  • assertNotNull
  • assertArrayEquals
  • assertThat
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
  • Stress Testing
    • Make sure you application can perform well with
      large loads of traffic or large calculations.
  • Acceptance Testing
    • Make sure end users like the new state of the
      application.
    • Easy to understand
  • Compliance
    • Laws
How well did you know this?
1
Not at all
2
3
4
5
Perfectly