Testing strategies beyond TDD - PHPMad

Ed39ca0d44a6e6cdefc76ac548de5f41?s=47 Marabesi
March 27, 2019
110

Testing strategies beyond TDD - PHPMad

Testing is an important part of the software development life cycle, therefore it is neglected by developers. Often software testing is related to TDD only, though there are acceptance testing, integration testing, stress testing and so on.

Also, developers tend to think that to apply TDD is not possible in an ongoing project, the goal of this talk is to give an example of a strategy to getting started with software testing in an existing project.

TDD is an essential part of C.I and C.D, therefore sometimes a different approach is needed in order to get to the unit testing.

Talk topics
- Software testing definition
- The need to refactor, the change is a constant in software development
- TDD the context and definition
- Integration test and acceptance test
- Approaches to create a strategy for effective testing
- Choosing a test tool
- Refactoring definition
- The project example 1 - API and front end
- The project example 2 - monolith approach
- Challenges and lessons learned

Ed39ca0d44a6e6cdefc76ac548de5f41?s=128

Marabesi

March 27, 2019
Tweet

Transcript

  1. Testing strategies beyond TDD PHPMad -

  2. Hello! I am Matheus Marabesi You can find me at

    @MatheusMarabesi ✌
  3. Agenda ▣ Software testing definitions ▣ Strategies □ Monolith □

    Api + Frontend ▣ Tools ▣ Takeaway
  4. Developer Testing in the IDE: Patterns, Beliefs, and Behavior Beller

    M. et al. Developer Testing in the IDE: Patterns, Beliefs, and Behavior. In IEEE Transactions on Software Engineering, p. 261 - 284 (2019)
  5. 1. DEFINITIONS

  6. ‘’ Testing is intended to show that a program does

    what it is intended to do and to discover program defects before it is put into use. Sommerville Ian, Software Engineering (10th Edition). 2016. p. 227.
  7. Bug free Testing doesn't mean bug free.

  8. ‘’ Professional testers must still perform investigative testing. R. Jeffries,

    G. Melnik, Guest Editors' Introduction: TDD--The Art of Fearless Programming. 2017, p. 24 - 30.
  9. M. Cohn, SUCCEEDING WITH AGILE. 2010, p. 312.

  10. M. Cohn, SUCCEEDING WITH AGILE. 2010, p. 312.

  11. ‘’ Automated user interface testing is placed at the top

    of the test automation pyramid because we want to do as little of it as possible. M. Cohn, SUCCEEDING WITH AGILE. 2010, p. 312.
  12. M. Cohn, SUCCEEDING WITH AGILE. 2010, p. 312.

  13. ‘’ Service-level testing is about testing the services of an

    application separately from its user interface. M. Cohn, SUCCEEDING WITH AGILE. 2010, p. 313.
  14. M. Cohn, SUCCEEDING WITH AGILE. 2010, p. 312.

  15. ‘’ Unit testing is the process of testing program components,

    such as methods or object classes. Individual functions or methods are the simplest type of component. Sommerville Ian, Software Engineering (10th Edition). 2016. p. 232.
  16. R. S. Pressman, B. R. Maxim, SOFTWARE ENGINEERING - A

    Practitioner's Approach. 2015, p. 470.
  17. Similarities Testing strategy starts from unit moving onward to integration.

  18. None
  19. Integration Functional Acceptance e2e

  20. Integration

  21. ‘’ For some people integration testing means to test through

    the entire stack of your application connected to other applications within your system. Ham Vocke, The Practical Test Pyramid, 2018, https://martinfowler.com/articles/practical-test-pyramid.html
  22. 72: Taylor Otwell - Testing Laravel Applications 72: Taylor Otwell

    - Testing Laravel Applications, http://www.fullstackradio.com/72
  23. PHPT

  24. Functional

  25. Acceptance

  26. ‘’ Sometimes you'll hear the terms functional test or acceptance

    test for these kinds of tests. Sometimes people will tell you that functional and acceptance tests are different things. Sometimes the terms are conflated. Ham Vocke, The Practical Test Pyramid, 2018, https://martinfowler.com/articles/practical-test-pyramid.html
  27. e2e It's a term often related to front end instead

    of backend
  28. ‘’ End-to-end tests (also called Broad Stack Tests) give you

    the biggest confidence when you need to decide if your software is working or not. Ham Vocke, The Practical Test Pyramid, 2018, https://martinfowler.com/articles/practical-test-pyramid.html
  29. Functional, Acceptance, e2e

  30. ‘’ Now that we’ve written some acceptance tests, functional tests

    are almost the same, with one major difference: Functional tests don’t require a web server. Codeception, Functional testing, https://codeception.com/docs/04-FunctionalTests
  31. Pyramid (redefine) A modern approach

  32. e2e Unit - Application - Classes - Methods - Events

    - Components Frontend Integration
  33. Acceptance Integration Unit - Classes - Methods - Events -

    Database - File system - External services Backend - Application
  34. 2. STRATEGIES

  35. TDD, Unit test Terms often used together

  36. ‘’ We drive development with automated tests, a style of

    development called Test-Driven Development (TDD). Beck Kent, Test-Driven Development By Example. 2002, p. 9.
  37. Often this is not the case 72: Taylor Otwell -

    Testing Laravel Applications, http://www.fullstackradio.com/72
  38. ‘’ Refactoring is the process of changing a software system

    in such a way that it does not alter the external behavior of the code yet improves its internal structure. M. Fowler, K. Beck, J. Brant, W. Opdyke, D. Roberts, Addison-Wesley Professional. 1999, p. 9.
  39. Monolith (legacy) Adding new features or maintenance tasks often leads

    to behavior change
  40. Alister Scott, Software Testing Ice-Cream Cone. https://watirmelon.blog/testing-pyramids

  41. Monolith (legacy) e2e Refactor Unit

  42. Alister Scott, Software Testing Ice-Cream Cone. https://watirmelon.blog/testing-pyramids Anti pattern

  43. API + Frontend Frontend and backend

  44. API Unit Integration Acceptance

  45. Frontend Unit Integration e2e

  46. TDD != UNIT TEST When to not use TDD? Playing

    with new technology
  47. TDD != UNIT TEST When to not use TDD? Playing

    with new technology The goal is not clear
  48. TDD != UNIT TEST When to not use TDD? Playing

    with new technology The goal is not clear P.O.C
  49. 3. TOOLS

  50. PHPunit PHPUnit is a programmer-oriented testing framework for PHP. It

    is an instance of the xUnit architecture for unit testing frameworks. https://phpunit.de
  51. Codeception Codeception collects and shares best practices and solutions for

    testing PHP web applications. With a flexible set of included modules tests are easy to write, easy to use and easy to maintain. https://codeception.com
  52. Cypress Fast, easy and reliable testing for anything that runs

    in a browser. https://www.cypress.io
  53. 4. TAKEAWAY

  54. Definitions

  55. Bug free Testing doesn't mean bug free.

  56. Tools

  57. Bye! I am Matheus Marabesi You can find me at

    @MatheusMarabesi