17
Benefits of Unit Testing By Barkan Saeed

Benefits of Unit Testing

Embed Size (px)

DESCRIPTION

Benefits of Unit Testing Presentation

Citation preview

Page 1: Benefits of Unit Testing

Benefits of Unit TestingBy Barkan Saeed

Page 2: Benefits of Unit Testing

• One bug left before release

• Done!

• Send version to QA,

• QA: It doesn’t work!

Problem #1

Page 3: Benefits of Unit Testing

Programmer

Page 4: Benefits of Unit Testing

Problem #2

- Developer 1 writes web-services on day 1 and 2

- Developer 2 is scheduled to write an app to consume those services on day 3 and day 4

- Problem : Services don’t work as expected

How will this affect schedule?

Page 5: Benefits of Unit Testing

Client

Page 6: Benefits of Unit Testing

Problem # 3

• We don’t like changes

• But business requirements change thats why we work agile.

• Developer problem: Changes are not good because they break code

Page 7: Benefits of Unit Testing

Developer when seeing Change Request

Page 8: Benefits of Unit Testing

Problem # 4

Page 9: Benefits of Unit Testing

Delays in Schedule

• Unexpected Bugs

• Client frustration

• Delays in schedules

Page 10: Benefits of Unit Testing

Where does it hurt?

Page 11: Benefits of Unit Testing

What is Unit Test?

• Verifies an atomic piece of code

• Tests one specific behavior

• Each Test is autonomous [TestMethod] public void CheckPassword_ValidUser_ReturnTrue() { bool result = CheckPassword(“user”, “pass”); Assert.IsTrue(result); }

Page 12: Benefits of Unit Testing

Does it take more time? Yes!

Page 13: Benefits of Unit Testing

How can these unit tests help us?

Page 14: Benefits of Unit Testing

Be Confident about our code.

Page 15: Benefits of Unit Testing

Welcome Change

Page 16: Benefits of Unit Testing

Automated tests are the only way to achieve a good test coverage in

each sprint

Page 17: Benefits of Unit Testing

Future

- NewBie’s - Should understand XUnit

- Start with Regression areas first