Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
BY
KATE SOGLAEVA
TYPES OF TESTS
Test Type To Confirm That:
Unit Tests
Low level functions and classes work as expected under
a variety of i...
Impact on business
Time to fix
fewer bugs on
production
Save
money
>> Unit tests are written by
programmers to ensure that the
code does what they intend it
to do.
Uncle Bob (Robert Martin)...
LEGACY CODE
- Edit and Pray Cover and Modify.
TEST TYPES
11
Clas
s Clas
s
Clas
s
Clas
s
Clas
s
Clas
s Clas
s
DB
Unit
Integration
Acceptance
GOAL
- isolate each part of the program
- show that the individual parts are correct.
Clas
s Clas
s
Clas
s
Clas
s
Clas
s
C...
KPI
100 % coverage != good tests
BENEFITS
UNIT TESTS
TEST COMPLEX
SCENARIOS QUICKLY
YOU ENSURE
READABILITY
YOU ENSURE
MAINTAINABILITY
FEEL SAFER
REFACTOR WITHOUT
WORRIES
SAVE TIME ON
TESTING
BONUS: KNOW EXACTLY
WHAT IS BROKEN
WRITING CLEARER
CODE
TOOLS
UNIT TESTS
TOOLS
TDD
BDD
User story
As a [Role]
I want [Feature]
So that I receive [Value]
Test scenario
Given [Context]
When [Event Occurs]
Th...
MOCKITO
Seller seller = mock(Seller.class);
Shop shop = new Shop(seller);
public void shouldBuyBread() throws Exception {
...
DEMO
UNIT TESTS
WHAT COULD BE
TESTED
Custom Business
logic
Validation Frontend
API
INTEGRATION
TLOG
Unit tests
Integration
tests
IOS MOBILE APP
Kiwi
GHUnit
OCHamcrest
OCMockito
Unit tests benefits
Unit tests benefits
Unit tests benefits
Unit tests benefits
Unit tests benefits
Unit tests benefits
Upcoming SlideShare
Loading in …5
×

Unit tests benefits

3,628 views

Published on

The presentation explains JUnit tests benefits for business

Published in: Technology
  • Be the first to comment

Unit tests benefits

  1. 1. BY KATE SOGLAEVA
  2. 2. TYPES OF TESTS Test Type To Confirm That: Unit Tests Low level functions and classes work as expected under a variety of inputs. Integration Tests Integrated modules work together and in conjunction with infrastructure such as message queues and databases. Acceptance Tests Your application and key user flows works as a complete black box when driven via the user interface. Load Tests Your application performs well under simulated real world user load. Performance Tests The application meets performance requirements and response times under real world load scenarios. Simulation Tests Your application works in device simulation environments. (This is growing in importance in the mobile world where you need to test software on diverse emulated mobile devices.) Smoke Tests Tests to validate the state and integrity of a freshly deployed environment. Quality Tests Application code is high quality – identified through techniques such as static analysis, conformance to style guides, code coverage etc.
  3. 3. Impact on business Time to fix
  4. 4. fewer bugs on production Save money
  5. 5. >> Unit tests are written by programmers to ensure that the code does what they intend it to do. Uncle Bob (Robert Martin) >> It is difficult to claim that you are Agile, if you are not writing lots of automated test cases, and writing them before you write the code that makes them pass.
  6. 6. LEGACY CODE
  7. 7. - Edit and Pray Cover and Modify.
  8. 8. TEST TYPES 11 Clas s Clas s Clas s Clas s Clas s Clas s Clas s DB Unit Integration Acceptance
  9. 9. GOAL - isolate each part of the program - show that the individual parts are correct. Clas s Clas s Clas s Clas s Clas s Clas s Clas s DB Unit
  10. 10. KPI 100 % coverage != good tests
  11. 11. BENEFITS UNIT TESTS
  12. 12. TEST COMPLEX SCENARIOS QUICKLY
  13. 13. YOU ENSURE READABILITY
  14. 14. YOU ENSURE MAINTAINABILITY
  15. 15. FEEL SAFER
  16. 16. REFACTOR WITHOUT WORRIES
  17. 17. SAVE TIME ON TESTING
  18. 18. BONUS: KNOW EXACTLY WHAT IS BROKEN
  19. 19. WRITING CLEARER CODE
  20. 20. TOOLS UNIT TESTS
  21. 21. TOOLS
  22. 22. TDD
  23. 23. BDD User story As a [Role] I want [Feature] So that I receive [Value] Test scenario Given [Context] When [Event Occurs] Then [Outcome]
  24. 24. MOCKITO Seller seller = mock(Seller.class); Shop shop = new Shop(seller); public void shouldBuyBread() throws Exception { //given given(seller.askForBread()).willReturn(new Bread()); //when Goods goods = shop.buyBread(); //then assertThat(goods, containBread()); }
  25. 25. DEMO UNIT TESTS
  26. 26. WHAT COULD BE TESTED Custom Business logic Validation Frontend API
  27. 27. INTEGRATION TLOG Unit tests Integration tests
  28. 28. IOS MOBILE APP Kiwi GHUnit OCHamcrest OCMockito

×