Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

largest-series-product forces implementation #10

Closed
markijbema opened this issue Mar 16, 2014 · 7 comments
Closed

largest-series-product forces implementation #10

markijbema opened this issue Mar 16, 2014 · 7 comments

Comments

@markijbema
Copy link
Contributor

The tests for this exercise test a lot of the helper methods. I think given that it's this late in the path, it isn't needed. Also, it takes away a lot of freedom from the implementer. I think the tests should be guiding more by functionality needed than by methods defined.

@kytrinyx
Copy link
Member

I've started playing around with aruba for making acceptance tests that make no choices about the design/classes/methods. I don't really want to introduce a new dependency, but we could definitely write fewer tests and not specify the steps along the way.

@markijbema
Copy link
Contributor Author

I think it's mostly the tests should require more functionality each time, but through the one tested final method. But by having a trivial first example, and keep on adding bordercases, this can be done most of the time. I don't think the testing framework itself matters too much.

fluxusfrequency pushed a commit to fluxusfrequency/xruby that referenced this issue May 9, 2014
@kotp
Copy link
Member

kotp commented Jun 15, 2015

Related information:

Listed here for my convenience.

kotp added a commit that referenced this issue Jun 16, 2015
Does not rely on on any specifically named 'helper' methods.  Tests
things through the implementation via public facing API

re: #10
@kotp
Copy link
Member

kotp commented Jun 16, 2015

@markijbema and @kytrinyx hopefully this is what you had in mind.

@kotp
Copy link
Member

kotp commented Jun 16, 2015

BTW: in the spirit of "Look to exercism for awesome code" I took the following measurements:

Flogging your code!
    44.7: flog total
     5.6: flog/method average

    11.9: Series#separate                  example.rb:30
     7.1: Series#largest_product           example.rb:9
     6.7: Series#collection_of_digits      example.rb:36
     6.4: Series#analyzer                  example.rb:17
Your code reeks this much!
example.rb -- 2 warnings:
  [19]:Series#analyzer contains iterators nested 2 deep (NestedIterators)
  [26]:Series#reduce_to_product doesn't depend on instance state (UtilityFunction)

kotp added a commit that referenced this issue Jun 17, 2015
As per discussion in PR #170

re: #10

This tests the existence of `largest_product` via error rather than
failure.

Provides the small numbers as the first two tests.
@kotp
Copy link
Member

kotp commented Jun 17, 2015

   42.6: flog total                                     
    4.3: flog/method average                            

    6.7: Series#collection_of_digits      example.rb:45 
    6.5: Series#analyzer                  example.rb:22 
    6.4: Series#validate_length           example.rb:17 
    6.1: Series#separate                  example.rb:39 

kotp added a commit that referenced this issue Jun 17, 2015
re: #10
Changes per discussion at PR: #170
@kytrinyx
Copy link
Member

That's a much nicer result.

@kotp kotp added ready and removed in progress labels Jun 18, 2015
@kotp kotp closed this as completed Jun 18, 2015
@Insti Insti removed the ready label Aug 28, 2016
gchan pushed a commit to gchan/xruby that referenced this issue Oct 18, 2016
kotp pushed a commit that referenced this issue Oct 23, 2017
Fix two-bucket solution

Added short-cut for case where non-starting bucket size is equal to goal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants