1

Етап 1

Глава 6

05 грудня—11 грудня

2

Етап 2

Глава 7

12 грудня—18 грудня

3

Етап 3

Глава 8

19 грудня—25 грудня

4

Етап 4

Глава 9

26 грудня—31 грудня

5

Етап 5

Глава 10

02 січня—08 січня

1

Етап 1

Глава 6

05 грудня—11 грудня

2

Етап 2

Глава 7

12 грудня—18 грудня

3

Етап 3

Глава 8

19 грудня—25 грудня

4

Етап 4

Глава 9

26 грудня—31 грудня

5

Етап 5

Глава 10

02 січня—08 січня

05 грудня 2016 08 січня 2017
Мета завершена % date%

Автор мети

Кар'єра та робота

Дочитать книгу Test-driven Java development

Есть такая шикарная книга по TDD

Читаю в оригинале, и часто бывает очень лень. Этой целью хочу добить эту книжку. И да, для лучшего понимания писать после прочтения Summary писать короткий отзыв по главе - чтобы что-то оставалось в головушке.

 Критерій завершення

книга прочитана

 Особисті ресурси

время

 Екологічність мети

хорошее понимание методологии TDD

  1. Глава 6

    6: Mocking – Removing External Dependencies

    • Mocking
    • Mockito
    • The Tic-Tac-Toe v2 requirements
    • Developing Tic-Tac-Toe v2
    • Integration tests
    • Summary
  2. Глава 7

    7: BDD – Working Together with the Whole Team

    • Different specifications
    • Behavior-driven development
    • The Books Store BDD story
    • JBehave
    • Summary
  3. Глава 8

    8: Refactoring Legacy Code – Making it Young Again

    • Legacy code
    • The Kata exercise
    • Summary
  4. Глава 9

    9: Feature Toggles – Deploying Partially Done Features to Production

    • Continuous Integration, Delivery, and Deployment
    • Feature Toggles
    • A Feature Toggle example
    • Summary
  5. Глава 10

    10: Putting It All Together

    • TDD in a nutshell
    • Best practices
    • This is just the beginning
    • This does not have to be the end
  • 1192
  • 05 грудня 2016, 15:09


Висновок

25день
Радмир29 груд 2016, 21:38

So, let's sum up all the things here.

TDD approach based on red-green-refactor pillar. From fail to success till perfection. One of the forms of TDD is BDD, what stands for Behavior Driven Development. Unlike TDD, BDD is written by any member of a team and then implemented in code.

Best practices

  • Write tests before implementation
  • Only write new code the the test is failing
  • Rerun all tests every time the implementation code changes
  • All tests should pass before a new test is written
  • Refactor only after all tests are passing
  • Write simplest code to pass the test
  • Write assertions first, act later
  • Minimize assertions in each test
  • Do not introduce dependencies between tests
  • Tests should run fast
  • Use test doubles (mocks, spies)
  • Use set-up and tear-down methods
  • Don't use base classes in test

Tools

Code coverage: JaCoCo, Clover, Cobertura

Continuous integration: Jenkins, Hudson, Travis, Bamboo

BDD: JBehave, Cucumber

Щоденник мети

25день

Запис до етапу «Глава 10»

Радмир29 груд 2016, 21:30

Well, the 10th chapter is already done. Yeah! I've finished reading the book!

25день

Запис до етапу «Глава 9»

Радмир29 груд 2016, 21:20

The 9th chapter has been finished. When you use continuous integration/delivery/deployment it's stated that every your commit that passes all the test during the build might be delivered right to customer. But in some cases this decision should be made by a PM or someone else, not by machine or a process. Also there's an issue that can be caused by a fact that feature is done partially, and even it passes all the tests, the functionality could not yet be ready. For solving this two issues there's an approach calling Feature Toggles. You have some settings file with the list of your features. And your services always check this file whether a feature is enabled or not. For more convenient code there're some libraries for solving this issue:

And the rest of the chapter was about example of using these libs. Quite simple.

20день

Запис до етапу «Глава 8»

Радмир24 груд 2016, 14:15

Have finished the 8th chapter. About legacy code and refactoring of it.

"Legacy code" means code without tests - by Michael Feathers. Other ways to recognize legacy code:

  • a patch on top of a patch, like living Frankenstein;
  • known bugs;
  • changes are expensive;
  • fragile;
  • difficult to understand;
  • old, outdated, static or non-existend documentation;
  • shotgun surgery;
  • broken windows.

While non-legacy application is:

  • easy to change;
  • generalizable, configurable and expansible;
  • easy to deploy;
  • rubust;
  • no known defects or limitations;
  • easy to teach to others/to learn from others;
  • extensive suite of tests;
  • self-validating;
  • able to use keyhole surgery.

There was an example with lack of dependency injecton. So it should be changed to DI mechanism and tested.

  1. The legacy code change algorithm:
  2. identify change points;
  3. find test points;
  4. break dependencies;
  5. write tests;
  6. make changes and refactor.

Mentioned techniques and tools: DbUnit, RestAssured - library to test REST and JSON, http://xunitpatterns.com

14день

Запис до етапу «Глава 7»

Радмир18 груд 2016, 10:59

Well, I've finished the 7th chapter. It was about BDD approach.

BDD states for Behaviour-Driven-Development. It similar to TDD and has in common that you should write tests first. But there are some differences:

  • BDD tests works much longer than TDD (unit-tests);
  • BDD tests are used for acceptance, they don't dive into implementaion details;
  • BDD test are readable by anyone of project team, not only developer like in TDD.

Frameworks & tools:

  • JBehave (BDD framework)
  • Cucumber (BDD framework)
  • Selenium, Selenide for UI tests
  • PhantomJS - headless browser for UI tests (COOL!)

In BDD you write scenario - plain text about some specification, readable by any of project team, not only developers. It uses given-when-then notation. This scenario is mapped on a parsing and implementaion class, where scenario phrases mapped (via regexp) on your methods (via annotations).

More info:

https://habrahabr.ru/post/139674/

http://agilerussia.ru/practices/introducing-bdd/

6день

Запис до етапу «Глава 6»

Радмир10 груд 2016, 16:05

Поскольку книга на английском, решил, в целях сочетания полезного с полезным, публиковать отчеты о главах тоже на английском. Итак, 6 глава прочитана.

Well, the 6th chapter has been read. In this chapter was introduced mocking technique. Mocking - means when you isolate and substitute your dependencies with dummy, or `mock` objects. There used Mockito - one of the most popular mocking framework.

Main use case looks like this:

List list = mock(List.class);

doReturn(10).when(list).size();

There are 2 kinds of mock objects: mock and spy. Mock is a real dummy objects that doesn't anything unless we specify otherwise. Spy uses a real object and invokes real methods unless we specify otherwise.

Mocking is used in TDD approach in order to:

  1. increase speed of your unit-tests.
  2. uncouple your dependencies from your testing module.

Вы тоже можете
опубликовать свою
цель здесь

Мы поможем вам ее достичь!

310 000

единомышленников

инструменты

для увлекательного достижения

Присоединиться
Реєстрація

Можливості
безмежні.
Настав час
відкрити свої.

Уже зарегистрированы?
Вхід на сайт

Заходьте.
Відкрито.

Ще не зареєстровані?
 
Підключіться до будь-якого з ваших акаунтів, ваші дані будуть взяті з акаунту.
Забули пароль?
Артур
Александр
Денис
Aleksey
Juliya