HomeBarCamp Bangalore2.0

Bar Camp Day2 Post Lunch Session 2 : Pair Programming and Test Driven Development

Like Tweet Pin it Share Share Email

Speaker : Maha,Thoughtworks

It was on pair programming and Test Driven Development(TDD).A live demo was shown using JUnit.

The advantage point of view is that “You are fully comitted towards your job and you dont take personal calls,dont chat etc”

There had many scenarios on which test cases were built:

Scenario 1:
We should be able to put money into the wallet
—>Test cases were generated using this test case.Also,just for checking the functionality , neagtive money was put into the wallet(Damn,Is this possible?)

Scenario 2:
As a wallet owner , you would like to take out money from the wallet
—>Test case was developed for this scenario
—>Now what happens,if you try to take out more money from the wallet than what you have?

Scenario 3:
As a account owner , I would like to draw more money from the account than what I have?
—>This is in contrast with the test case 2 hence revamp of the existing code 🙂

Scenario 4:
As an account owner,I should be notified through email when I overdraw my money
—>This means every owner has an account associated with him.
—>Create a new method to notify the owner of the account,through email

Test Driven Development:

  1. Written test first
  2. Tests should fail and fail fast
  3. Tests protect functionality
  4. Test encourages fearless refactoring
  5. Test First Development(TFD) forces you to design well
  6. RDD improves design
  7. TDD supports evolutionary design
  8. Need driven development

Pair Programming:

  1. Ping Pong Programming
  2. Brain Storming
  3. Ongoing code review
  4. Driver thinks tactically and navigator strategically
  5. Two people are more pragmatic than one
  6. Knowledge sharing between pairs