Discussion:
GSoC 2014: JavaScript Unit Test Coverage
Paul Vincent Beigang
2014-03-03 16:14:12 UTC
Permalink
Hei guys,

I am interested in the „JavaScript Unit Test Coverage“ proposal added by Aaron Jorbin. I am quite unsure if he is active here on the mailing list since I never saw him posting here, anyway: My rough idea how to make this a success are the following three steps I would like to follow.

1. Identify:
What are the most important parts of WordPress powered by JavaScript? Which WP JS parts were error prone in the past? … So the general idea is to spend time and effort to find the right parts which should be covered by JS unit tests at first.

2. Cover:
Write the actual unit tests for the in 1. identified parts.
Eventually: Refactor established JS which „is not testable at the moment“. (As mentioned by jorbin in the proposal)
I really like to have some hard numbers here, think of test coverage percentage.

3. Educate:
Build the foundation (docs, how to´s) so that more people can join the JS Unit Test force in the future.

I am thankful for feedback on this plan, especially concerning 1.: What would you say is the ultimate functionality to cover with JS unit tests?

Best Regards,
Paul
Aaron Jorbin
2014-03-07 00:35:05 UTC
Permalink
Hi Paul,

In general, I like your plan. A couple of notes on it:

Step one should be accomplished as a part of the pre-dev section. On
http://www.google-melange.com/gsoc/events/google/gsoc201<http://www.google-melange.com/gsoc/events/google/gsoc2014>
*4* this is identified as "Students get to know mentors, read
documentation, get up to speed to begin working on their projects." This
way you can start coding on day one.

I don't think aiming for a certain test coverage percentage is the right
route to go. When you do that, all you end up with is a lot of tests and
not really useful tests. I think it would be much more useful to identify
actual bugs and then adding tests for those (part of what you mentioned
doing as prep work).

Coming up with some more complete documentation seems like a good idea.
http://make.wordpress.org/core/2013/09/13/javascript-unit-tests-for-core/is
the only real source right now. The main goal of GSOC though is
producing code, not producing documentation. This portion should really
take place only at the end

Functionality that I think could really use some tests are things that are
more API/library than specific interaction focused. heartbeat is something
that springs to mind.

http://aaron.jorb.in
twitter: twitter.com/aaronjorbin
Post by Paul Vincent Beigang
Hei guys,
I am interested in the "JavaScript Unit Test Coverage" proposal added by
Aaron Jorbin. I am quite unsure if he is active here on the mailing list
since I never saw him posting here, anyway: My rough idea how to make this
a success are the following three steps I would like to follow.
What are the most important parts of WordPress powered by JavaScript?
Which WP JS parts were error prone in the past? ... So the general idea is to
spend time and effort to find the right parts which should be covered by JS
unit tests at first.
Write the actual unit tests for the in 1. identified parts.
Eventually: Refactor established JS which "is not testable at the moment".
(As mentioned by jorbin in the proposal)
I really like to have some hard numbers here, think of test coverage percentage.
Build the foundation (docs, how to´s) so that more people can join the JS
Unit Test force in the future.
I am thankful for feedback on this plan, especially concerning 1.: What
would you say is the ultimate functionality to cover with JS unit tests?
Best Regards,
Paul
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...