News for hackers. Stuff that matters.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by harunurhan on Tuesday October 31, 2017 @03:07PM (#15595718)
Looks nice, 0 dependency, simple design but there is one issue...

I see that you don't have a single unit test or integration or functional etc.

Even if your in house developers know what they are doing (which is a myth, stuff will break) it's going to be difficult accept contributions from community without any tests that make (almost) sure existing features are working with the changes.

Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by vortico on Wednesday November 01, 2017 @07:05AM (#15600155)
How would you even test a UI library? For example, if some weird input makes the bar charts too spread apart, how do you convert that to a unit test? If you tried to unit test this, you'd either be fully reproducing the actual source code for spacing logic or you'd be hard-coding in thresholds that might all break if the maintainer decides on a UI change such as "increase the spacing for bar charts having many grouped bars". It seems for UI projects, testing can only cover about 1-10% of the issues that eventually end up on the GitHub issue tracker, so 25% of your time on this project would go toward writing tests, which would save you 1-10% of your time. Doesn't make sense.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by cloverich on Tuesday November 07, 2017 @08:31PM (#15649312)
You can test more than you'd realize: The generated math, the number of axes and number of visible points, etc. I'm not saying its def. a valuable use of time here, but I've been surprised how investing a little bit in helper methods (like, `getSelectedOption` or `isVisible`, etc) can generate quite useful and expressive unit tests.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by sillysaurus3 on Tuesday October 31, 2017 @03:57PM (#15596039)
Judge work by what it does, not by what it doesn't have.

Like users, programmers don't care whether programs have tests as long as it does what it needs to do.

Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by simplify on Tuesday October 31, 2017 @04:14PM (#15596171)
Tests are a way to judge what it does. It does the judging for you, ensuring features work as advertised, and provide usage examples that are guaranteed to work.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by Fifer82 on Tuesday October 31, 2017 @06:30PM (#15597185)
They are also boring as fuck and assume no talent for a project of this scope.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by opmac on Wednesday November 01, 2017 @12:13AM (#15598752)
Speak for yourself... that's quite the generalization. I'm a programmer, and I care when something doesn't have tests, especially if it's my own code.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by dabernathy89 on Tuesday October 31, 2017 @04:51PM (#15596430)
While this is true for you and me, this isn't true for a huge number of developers.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by harunurhan on Tuesday October 31, 2017 @04:01PM (#15596069)
So I should wait until stuff starts breaking, then start complaining.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by sillysaurus3 on Tuesday October 31, 2017 @04:07PM (#15596121)
Yeah.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by harunurhan on Tuesday October 31, 2017 @04:16PM (#15596184)
I am glad that this approach works for you but I am not brave enough to use a new library without a single test.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by foodstances on Tuesday October 31, 2017 @04:53PM (#15596451)
I guess this project isn't for you then.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by anon335dtzbvc on Tuesday October 31, 2017 @06:25PM (#15597143)
Well I would use it, but I wouldn't contribute, because I write all my code in a test driven programming way. AFAIK Chuck Norris writes the code first, never the test.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by XR0CSWV3h3kZWg on Tuesday October 31, 2017 @04:07PM (#15596116)
If nothing breaks why would you complain?
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by anon335dtzbvc on Tuesday October 31, 2017 @06:36PM (#15597234)
It's not a question of wether something might break, it's a question of when will it break and how long a new introduced bug might be undetcted, that could have easily detected by some tests? Bugs always happen in projects, if someone says otherwise, he either proved his program to be correct (e.g. in COQ) or is wrong (and sometimes both :).
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by harunurhan on Tuesday October 31, 2017 @04:12PM (#15596151)
In that case, I wouldn't. But I believe that it will happen eventually, this is not a 10lines project, has many lines of code and since it's new, I expect a lot to be changed. Then those changes are going to break features.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by XR0CSWV3h3kZWg on Tuesday October 31, 2017 @04:32PM (#15596291)
If you are worried about them breaking it as they develop it, but like the current implementation then just use the current implementation.

If you feel like having tests are a blocking feature for you then just watch this issue: https://github.com/frappe/charts/issues/7

Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by handbanana on Tuesday October 31, 2017 @04:46PM (#15596392)
I see where your coming from, but I disagree. This isn't a new OS, its a tiny charts library/utility. I'm more inclined to contribute because there are no tests. Either way, someone could PR tests if they wished. Perhaps your comment should have been such a PR? ;)
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by methodin on Tuesday October 31, 2017 @04:59PM (#15596510)
Why would lack of tests be a measure for your desire to contribute?
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by dflock on Tuesday October 31, 2017 @06:59PM (#15597378)
Possibly because it doubles the amount of work to make small changes, because you also have to learn the testing setup and write tests for your change?
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by trevor-e on Tuesday October 31, 2017 @10:09PM (#15598395)
> Perhaps your comment should have been such a PR? ;)

I really hate seeing this used in discussion. Just because it's open source does not mean it's immune from criticism. Yes, technically some random HN'er could spend tens of hours writing unit tests and submit a PR, but really this is a task for the library author/maintainer.

Having tests is a measure of quality, and should be cared about if you want people using your library.

Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by joshwcomeau on Tuesday October 31, 2017 @11:27PM (#15598609)
The library author has already invested probably hundreds of hours creating the library; if someone who benefits from it only has to spend tens of hours writing the unit tests, they've saved an order of magnitude of time.

We need to stop thinking of OSS as something we're entitled to, that if a stranger doesn't put in enough free labour we're allowed to complain about it. I try to view my dependencies as favours other people have done for me. You wouldn't nitpick about a lack of tests after someone wrote a whole charting library for you; you'd thank them and add your own tests.

Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by trevor-e on Wednesday November 01, 2017 @01:34AM (#15598994)
And we need to stop thinking of criticism as complaining. I'm very grateful for the OSS dependencies that I use in my projects and often contribute back to them, but I wouldn't touch a project without tests with a ten foot pole. I don't mean that in a bad way, for others it might fit their requirements fine. I'm guessing the author of this project would like people to actually use it, so I don't know why we should avoid giving this sort of feedback just because it's free labour.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by joshwcomeau on Wednesday November 01, 2017 @03:19PM (#15604626)
Yeah, it's fair to provide criticism... my issue was more with the idea that the library author is responsible for doing what the consumers request, that the burden is 100% on the author. In my ideal world, this project would now be a community effort, and anything the community wants can be implemented by the community.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by handbanana on Wednesday November 01, 2017 @11:53AM (#15602423)
I was hoping the winking face would have led readers to understand that my suggestion was made in jest.

My point was: Many are dogmatic about tests these days, and I find it refreshing there are no tests.

Tests can be added later for something like this library, if/when the need arises - or when someone decides to spend "tens of hours" writing them.

Tests can be a measure of quality, but they aren't the only measure - and do not apply in all cases

Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by thrownaway954 on Tuesday October 31, 2017 @05:12PM (#15596636)
maybe you could start contributing to the project by helping writing some tests? i see that this is a library for a product that develop, so this might be a project they just extracted from that. as such it most likely was already has the "works on my box" seal of approval :)
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by codazoda on Tuesday October 31, 2017 @03:44PM (#15595942)
Some of us believe that tests increase work by 25% while only reducing defects by 60%.

https://www.microsoft.com/en-us/research/wp-content/uploads/...

Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by iamflimflam1 on Tuesday October 31, 2017 @03:58PM (#15596042)
Interesting - that 25% seems to come from managers estimating the impact, not from developers.

  Increase in time taken to code the feature because 15–20% 25–35% 15% 25–20%
  of TDD (%) [Management estimates]
And this seems to imply that any increase in time was offset by reduced maintenance costs due to improved quality.

  Another interesting observation from the outcome measures in Table 3 is the increase in
  time to develop the features attributed to the usage of the TDD practice, as subjectively
  estimated by management. The increase in development time ranges from 15% to 35%.
  From an efficacy perspective this increase in development time is offset by the by the
  reduced maintenance costs due to the improvement in quality (Erdogmus and Williams
  2003), an observation that was backed up the product teams at Microsoft and IBM.
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by RubenSandwich on Tuesday October 31, 2017 @03:54PM (#15596017)
I don't see how that isn't a good trade as defects only compound on larger projects. In fact without tests, which basically function as a spec, how can you be sure that your refactor still works as the previous version?
Re:Show HN: Frappe Charts – GitHub inspired JavaScript chart... by bonyboy on Tuesday October 31, 2017 @06:17PM (#15597074)
Microsoft uses WordPress?

TIL