Grants talk:IEG/Lua libs for behavior-driven development
"Coverage" of docs and tests
editA very coarse check of coverage of docs and tests for some language versions of Wikipedia. It is not a very thorough check, it is just a check on existence of pages.
dawiki | dewiki | enwiki | nowiki | nnwiki | svwiki | all | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Num | Rel | Num | Rel | Num | Rel | Num | Rel | Num | Rel | Num | Rel | Comment | ||
1 | / | 121 | 56 % | 172 | 63 % | 2248 | 80 % | 2073 | 94 % | 20 | 37 % | 123 | 55 % | Should find all subpages |
2 | /do[ck][^/]*\$ | 69 | 32 % | 107 | 39 % | 661 | 24 % | 1000 | 45 % | 5 | 9 % | 45 | 20 % | |
3 | ^[^/]*/do[ck][^/]*\$ | 53 | 25 % | 63 | 23 % | 348 | 12 % | 102 | 5 % | 4 | 7 % | 36 | 16 % | |
4 | /test[^/]*/ | 0 | 0 % | 3 | 1 % | 9 | 0 % | 0 | 0 % | 1 | 2 % | 1 | 0 % | Noisy, contains /doc |
5 | /test[^/]*\$ | 3 | 1 % | 7 | 3 % | 165 | 6 % | 23 | 1 % | 4 | 7 % | 14 | 6 % | |
6 | /[ck]onf[^/]*/ | 2 | 1 % | 3 | 1 % | 21 | 1 % | 19 | 1 % | 0 | 0 % | 0 | 0 % | Noisy, contains /doc |
7 | /[ck]onf[^/]*\$ | 8 | 4 % | 4 | 1 % | 23 | 1 % | 12 | 1 % | 1 | 2 % | 1 | 0 % | |
8 | /[^/]*dat[ae]n?/ | 2 | 1 % | 1 | 1 % | 620 | 22 % | 1746 | 79 % | 0 | 0 % | 0 | 0 % | Noisy, contains /doc |
9 | /[^/]*dat[ae]n?\$ | 5 | 2 % | 1 | 1 % | 52 | 2 % | 8 | 0 % | 0 | 0 % | 2 | 1 % | |
10 | All Module-pages | 216 | 272 | 2796 | 2207 | 54 | 223 | |||||||
11 | Real modules | 95 | 44 % | 100 | 37 % | 548 | 20 % | 134 | 1% | 34 | 63 % | 100 | 45 % | |
12 | Modules with tests | 3 % | 7 % | 30 % | 17 % | 12 % | 14 % | |||||||
13 | Modules with doc | 56 % | 63 % | 64 % | 76 % | 12 % | 36 % |
Nearly all the columns called "Rel" have relative numbers normalized to row 10, "All Module-pages", except for row 12. The relative numbers can be said to be the amount of pages of a specific type within the namespace. When dawiki has 56 % in row 1, then 56 % of the pages in the Module namespace is a subpage. Some projects use a lot of subpages to configure modules, which is visible in row 1 and 8 for enwiki and nowiki.
An interesting row is row 11 "Real modules", which is the difference between all module-pages and all subpages in that namespace, and row 12 "Modules with tests", which is row 5 normalized against row 11. Ideally the numbers in row 11 should be 100 %. Numbers below 100 % means that we have modules without tests. At some projects there are almost no tests at all. At enwiki there are an impressive number of tests, even if it should be better there too. Other projects lags considerably behind.
The row 13 "Modules with doc" is made like row 12, but the relative numbers comes from row 3.
There are a lot of spurious hits in the rows 4, 6, and 8, but none of those hits are removed. It is the titles ending in a forward slash (/) that are wrong, as a lot of the pages are documentation subpages. They are retained here as it is a pretty obvious question what happen in those subspaces.
An ultimate goal of the project would be to move from the present situation in row 12 to something more like the present situation in row 13. Tests should come naturally as part of the development of the code. — Jeblad 19:46, 12 April 2016 (UTC)
Showcases/documentation in project plan?
editUnder "Risks" you acknowledge that no matter how good the result turns out, there's a risk that very few users would actually use it. Lots of wikipedia users (most?) writing Lua code are not pro developers, and may not familiar with BDD. So I think good documentation and showcases could be essential for this to be a success. You note that "it could be an idea to make some showcases that directly compares different ways to write tests", but haven't included this in the project plan. Would it be an idea to do so? Danmichaelo (talk) 17:43, 14 April 2016 (UTC)
- I did not include showcases as this is only a three month project. There will be sufficient documentation to write tests (a reference manual), possibly as LuaDoc, but only a very limited text on how to write them (a programmers manual) on the usual /doc page. If the code will be in an extension (it probably will be), then the doc page must be a separate help page. It will probably contain references to text books providing best practices, but not giving the rationale for why something are considered best practices.
- We don't have a good solution for how to update on-wiki reference manuals from off-wiki texts. Only solution is to add external links. This is more or less the same problem as with the rest of the code for Mediawiki, but a lot more visible here as the Lua-code is for the general community and not for the pro developers. — Jeblad 07:46, 15 April 2016 (UTC)
On the title of the proposal
editThe name is not quite accurate. We want to support behavior-driven development but to do that we provide the tools to do spec-style unit testing. See RSpec for an example. We can't really make the developers do behavior-driven development, but we can expose tested modules and make the community expect tests to be in place. — Jeblad 08:24, 15 April 2016 (UTC)
Eligibility confirmed
editThis Individual Engagement Grant proposal is under review!
We've confirmed your proposal is eligible for review and scoring. Please feel free to ask questions and make changes to this proposal as discussions continue during this community comments period (through 2 May 2016).
The committee's formal review begins on 3 May 2016, and grants will be announced 17 June 2016. See the round 1 2016 schedule for more details.
Questions? Contact us at iegrants wikimedia · org .
--Marti (WMF) (talk) 05:11, 28 April 2016 (UTC)
Scribunto extension changes?
editHello!
Do you know if changes to mw:Extension:Scribunto are required to be written and deployed in order for this proposal to be completed successfully? If so, have you reached out to the maintainers of that extension to discuss it? Thanks! YuviPanda (talk) 03:27, 16 May 2016 (UTC)
- @YuviPanda: No changes to Scribunto are necessary for this extension. The extension is strictly for testing code from, and within, the module namespace. The "extension" in this case is nothing more than a Lua lib, localization, and a few gadgets. And no, I'm not using Busted. — Jeblad 22:03, 16 May 2016 (UTC)
- If this is meant to be used by many projects, perhaps it would make sense to include it in the scribunto standard libraries list (e.g. Like what happened with mw.html library). Although, if so, it would probably be better to wait and see how popular it is. Bawolff (talk) 11:03, 21 May 2016 (UTC)
- It needs localization, so it is more than just a standard library. It also adds a Javascript gadget to make it possible to rerun tests. — Jeblad 13:48, 21 May 2016 (UTC)
- If this is meant to be used by many projects, perhaps it would make sense to include it in the scribunto standard libraries list (e.g. Like what happened with mw.html library). Although, if so, it would probably be better to wait and see how popular it is. Bawolff (talk) 11:03, 21 May 2016 (UTC)
Goals and Measurable Results
editCheck against Grants:Evaluation/Program Goals and Measurable Results. — Jeblad 16:00, 29 May 2016 (UTC)
Aggregated feedback from the committee for Lua libs for behavior-driven development
editScoring rubric | Score | |
(A) Impact potential
|
7.1 | |
(B) Community engagement
|
6.4 | |
(C) Ability to execute
|
7.8 | |
(D) Measures of success
|
6.3 | |
Additional comments from the Committee:
|
-- MJue (WMF) (talk) 00:44, 3 June 2016 (UTC) on behalf of the IEG Committee.
- Some answer, I'm not sure about all the statements/questions.
- I am one of those crazy dudes that has used both Scheme and Forth. Lua is weird, and that makes it a bit fun. Developing in Lua is a continuous back and fort between the source, the console, testing in templates, checking if something breaks, and then often saving just to see that 5623 transcluded templates did break. So you start over again. And again. And again.
- Not many dare to touch the template mess, or fix it with Lua, because it is so extremely fragile. You touch something with that ten-foot-pole and something explode. The real problem is all those involved templates, but to fix them we need to write some modules, but then to do that we need better and more efficient testing. We try to fix ten years of complete mess with a toothpick and some floss. Perhaps we need that ten-foot-pole to drive out the garbage.
I guess it is also about how and what you define as content. Templates are pretty much about presentation of content, and fixing them would not make the content any better, even if the presentation would be better and more efficient. - I'm not sure if I would call it more friendly. My idea when I wrote the proof of concept was clean tests for limited set of cases, and to make the cycles rapid. I wanted to get out of the situation where I repeatedly posted the same tests in the console.
- I was afraid the "one popular module" as it can easily spiral down into fights. I have listed a few modules that can be used to test some core functionality, and those should be pretty safe. Further demos could be done at the end of the project to avoid impact of disagreements over the color of the dogs house.
I have an idea about a follow-up, its about user case testing from the general editor population. That would be really interesting, allowing editors to easily probe modules as part of their discussion posts.
This project is strictly about the on-wiki developers own testing. - Not quite sure about this point. Visibility of testable code might impact the willingness to write tests. Yes, there will be a cost of integrating the plugin, but I believe it will be fairly low. Server load is the major problem if people starts to write very heavy tests.
- I guess some testing will be done at Norwegian Wikipedia, and in fact it seems like we are somewhat more inclined to do testing than other major wikis. That in itself is a bit interesting.
- I have proposed a way to measure the success of the adoption of the new tool, but there are no good solution to measure the impact on the content itself. One indirect success indicator could be the adoption of testable modules compared to untested ones, ie the impact on the rendered pages, but we don't have any baseline and no clear way to normalize the data.
- Not sure about this.
- Number of tests are easy, coverage is not easy. It is possible to figure out if tests hits public interfaces (members) by monkey-patching, but not internal coverage. It is possible to do monkey-patching internally in a module, but it creates a bit dirty code.
- It is about fixing a problem, ... an interpreted language in an server running an interpreted language, ...
- I hope to get more focus on tests, not just "it seems to work" or "it did work when I wrote it".
- :)
- I wrote some code to demo that it was in fact doable, ie a proof of concept. It is not completed.
- I was a bit amazed by the endorsements. :)
- Lua development is strange. Most of the development is copy-pasting existing code from other projects. What I really misses is interaction with Lua developers outside the Wikimedia-umbrella. There are extremely good libraries out there, and we don't use them.
- I'm a bit afraid of starting to write tests for a highly visible module early on, that can easily derail the whole project. There should be sufficient examples to write more tests, but those examples should be easy to understand and adapt.
- Problems with modules impacts all users.
- :)
- I believe the need is evident from the lack of good testable modules. I would not call the existing testing regime on most wikis functional, but that is me. :)
- :)
- Note that real coverage in Lua as it is used in Wikimedia-projects is a hard problem.
- A normal week in Norway is 37.5 hours.
- There are additional info on mw:Help:Spec. — Jeblad 01:02, 19 June 2016 (UTC)
Round 1 2016 decision
editCongratulations! Your proposal has been selected for an Individual Engagement Grant.
The committee has recommended this proposal and WMF has approved funding for the full amount of your request, $12,000
Comments regarding this decision:
The committee is pleased to support the development of an extension for testing of Lua-modules. We appreciate the expertise you bring as both a Wikimedia volunteer and a participant in the broader developer community. We look forward to seeing how you will combine that expertise to ensure your tool will achieve impact among the existing community of Wikimedia volunteers currently using Lua.
Next steps:
- You will be contacted to sign a grant agreement and setup a monthly check-in schedule.
- Review the information for grantees.
- Use the new buttons on your original proposal to create your project pages.
- Start work on your project!
Extension request, new completion date
editRequest for a change to the completion date and start date for our grant
editI am requesting an extension of the project completion date for "Lua libs for behavior-driven development".
- The new proposed completion date is 30. June 2019. Current development, mostly cleanup, started 22. Dec. 2018.
- The extended delay is all on me me, getting tired of the project that grew way out of size. It was a combination of several factors. One was a slight adjustment of scope, that I should have rejected because it changed the project from the initial quite narrow focus. Another was that I had to do more documentation than expected, which also extended the scope from a purely technical project. In short I ran out of time, but still with a lot left to do. I failed to see the consequences of small feature creeps (also my own due to generalizations) and then backed away.
- The project is still viable, and the code is mostly done and in good shape. For now I'm cleaning up the technical doc, and expect to start on the missing parts shortly. I am not going to promise any fast closure of the project, as I assume there are at least two months full-time work before its finished.
Note that the help page is at mw:Help:Pickle, and the extension page is at mw:Extension:Pickle. Repository is at Github: jeblad/Pickle, with project page at [1]. Technical documents are organized in the on-site wiki, with formatting that can be reused in a mediawiki instance if necessary. If it works out there should be a Vagrant role available soonish.
Sorry for the delay. — Jeblad 13:54, 3 January 2019 (UTC)
- @Jeblad: Thanks for the explanation, Jeblad. I'm sorry that the project grew beyond the scope you expected it to, and I understand why that would be overwhelming and make it difficult to complete the work. This extension for 30 June 2019 has been approved. I also appreciate your summary of the completed work so far. Thanks, I JethroBT (WMF) (talk) 18:43, 4 January 2019 (UTC)
- Please note that the new final report due date is 30 July 2019. Thank you. -- JTud (WMF), Grants Administrator (talk) 23:06, 4 January 2019 (UTC)