4. Consensus on testing
• “Include unit tests when you contribute new features, as they help to a)
prove that your code works correctly, and b) guard against future breaking
changes to lower the maintenance cost.” –Tensorflow
• “High-quality unit testing is a corner-stone of the scikit-learn development
process.” “The tests…check the validity of the algorithms and the different
options of the code.” -Scikit-learn
• “Nothing is more frustrating than starting a review, only to find that the
tests are inadequate or absent. Very few pull requests can touch the code
and NOT touch tests.” – Kubernetes
• “Developers are required to create test cases for any bugs fixed and any
new features added, and to contribute them along with the changes.” -
Swift
5.
6. “The regular practice of test-driven development will help you to
increase your accuracy and productivity; and will greatly enhance the
confidence you have in the code you produce.” -Uncle Bob
8. Rules of test-driven development
You are not allowed to write any production code unless it is to make a
failing unit test pass.
You are not allowed to write any more of a unit test than is sufficient to
fail; and compilation failures are failures.
You are not allowed to write any more production code than is
sufficient to pass the one failing unit test.
14. TDD versus BDD
In developer TDD, you write a test that will satisfy a developer.
BDD or Behavior Driven Development is also a test-first approach, but
differs by testing the behavior of the system from the end users
perspective.
19. Project Description Contributing file
Pandas
Data analysis /
manipulation
Explains TDD, functional testing,
hypothesis, performance
benchmarking with asv
NodeJS Javascript runtime
Provides a table of contents for
testing directory
Scikit-learn Machine learning
Shares expectation of 90% code
coverage and provides a workflow to
improve test coverage
Swift
Apple's programming
language
Advises to write tests at the
appropriate level and ensure they
run quickly
33. Project Description Continuous integration
Kubernetes
Container scheduling
and management
Sig-testing guild helps with
designing tests, maintains testing
and CI infrastructure, provides
testgrid
Rust Low-level language
Uses auto branch to run full test
suite against every branch as if it
were merged to master
34.
35.
36. Resources
• Test Driven Development: By Example- Kent Beck
• Refactoring: Improving the Design of Existing Code- Martin Fowler
• Working Effectively with Legacy Code- Michael Feathers
• Clean Code- Robert C. Martin (Uncle Bob)
• The Pragmatic Programmer: From Journeyman to Master- Andrew
Hunt and Dave Thomas
• The Evolution of TDD- Nat Pryce and Fabio Pereira
• TDD Changed My Life-Eric Elliott
TDD lowers barriers to contributing and maintaining your project.
It improves design and code quality by encouraging developers take a building-block approach that checks assumptions each step of the way.
https://www.icemobile.com/test-driven-development
Credit to this great walk through! http://benalexkeen.com/interacting-with-the-twitter-api-using-python/
Next up: create a test for get twitter access token!