Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to contribute to OSS with test

How to contribute to OSS with test

Kazushige Tominaga

February 21, 2018
Tweet

More Decks by Kazushige Tominaga

Other Decks in Programming

Transcript

  1. Kazushige Tominaga Kazushige Tominaga tooooooooomy Github : Twitter : creator

    of A testing library for PHP legacy products https://github.com/kazu9su https://twitter.com/tooooooooomy https://github.com/kazu9su/functional-tester
  2. Today I don't talk about... Today I don't talk about...

    Principle of TDD How important test is! Something like that
  3. Today I talk about... Today I talk about... Why do

    I write test? Process of contributing Points of writing test of OSS
  4. I write test just because I like test :) I

    write test just because I like test :)
  5. There are a lot of rules in testing world There

    are a lot of rules in testing world TDD should test all of methods BDD should test behavior Test only provided public methods included in BDD?
  6. What is the point? What is the point? Write test

    just about 1 method Committers can see PR easily Write private methods's test I can find out their testing style explicitly
  7. There is no immediate harm in these tests but you

    should know that unit tests should not try to look into private methods or internal variables. The unit test must confirm the public API of the class works, i.e. how other code will use it. The internal implementation of the class is subject to change (refactoring). The perfect refactoring is when you change the code but don't have to touch the tests. With tests like these, they would also have to be modified if the internal implementation changes in the future.
  8. Finally, I could get usable Finally, I could get usable

    information from the author. information from the author. PR has already been merged, but don't mind :)
  9. Conclusion Conclusion Well-known OSS needs test Communication with committers is

    the most important Make simple, understandable PR Enjoy testing