Test
  • Introduction
  • Regression Testing
  • Unit Test
  • reflection
  • terminology
  • Defect Life Cycle
  • NullVSNotNull
  • @Before VS @BeforeEach VS...
  • JUnit Runner
  • run only functional test or integration test
  • cucumber/tags
  • cucumber/ options
  • cucumber/runwith
  • parallel cucumber test
  • cucumber/some eg
  • Hamcrest for testing
  • continuous integration
  • work flow for functional test
  • unit test for server side
  • other
  • Mock
  • jacoco&mutation
  • PowerMockito
  • performance test
Powered by GitBook
On this page
  • 1. Assert.assertEquals(expected, actual, delta)
  • 2. positive testing&negative testing
  • Positive Testing:
  • Negative Testing:

Was this helpful?

Unit Test

PreviousRegression TestingNextreflection

Last updated 5 years ago

Was this helpful?

1. Assert.assertEquals(expected, actual, delta)

While delta is the maximum difference(delta) between expected and actual for which both numbers are still considered equal.

eg:

Assert.assertEquals(0.0012f, 0.0014f, 0.0002); //true
Assert.assertEquals(0.0012f, 0.0014f, 0.0001); //false

2. positive testing&negative testing

Positive Testing:

Positive Testing is testing process where the system validated against the valid input data. In this testing tester always check for only valid set of values and check if a application behaves as expected with its expected inputs. The main intention of this testing is to check whether software application not showing error when not supposed to & showing error when supposed to. Such testing is to be carried out keeping positive point of view & only execute the positive scenario.Positive Testingalways tries to prove that a given product and project always meets the requirements and specifications. Under Positive testing is test the normal day to day life scenarios and check the expected behavior of application.

Negative Testing:

Negative Testing is testing process where the system validated against the invalid input data. A negative test checks if a application behaves as expected with its negative inputs. The main intention of this testing is to check whether software application not showing error when supposed to & showing error when not supposed to. Such testing is to be carried out keeping negative point of view & only execute the test cases for only invalid set of input data.

https://www.softwaretestingclass.com/positive-and-negative-testing-in-software-testing/