Skip to content

bank-account: add to track - #662

Merged
stkent merged 3 commits into
exercism:masterfrom
FridaTveit:BankAccountAddExercise
Jun 30, 2017
Merged

stkent merged 3 commits into
exercism:masterfrom
FridaTveit:BankAccountAddExercise

Conversation

@FridaTveit

@FridaTveit FridaTveit commented Jun 22, 2017 •

Copy link
Copy Markdown
Contributor

Description


Reviewer Resources:

Track Policies

@stkent

stkent commented Jun 22, 2017

Copy link
Copy Markdown
Contributor

[FYI: Kotlin has an implementation of this exercise that might be inspirational, but I'm not sure if it's compliant with any canonical data!]

@FridaTveit
FridaTveit force-pushed the BankAccountAddExercise branch from e6d5728 to e3021a4 Compare June 27, 2017 18:46
Comment thread config.json
"difficulty": 6,
"topics": [

]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma here!

@FridaTveit
FridaTveit force-pushed the BankAccountAddExercise branch from e3021a4 to ec72772 Compare June 27, 2017 20:05
@FridaTveit FridaTveit changed the title bank-account: dibs on implementing bank-account: add to track Jun 28, 2017
@stkent stkent self-assigned this Jun 28, 2017
assertEquals(0, bankAccount.getBalance());
}

@Ignore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All @Ignore annotations should include the standard hint: "Remove to run test" :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, forgot! Will fix :)

bankAccount.deposit(1000);

for (int i = 0; i < 10; i++) {
adjustBalanceConcurrently();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test fail 100% of the time? If so, would you mind explaining how that works? I'm curious!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see from the hint it is not guaranteed to fail. Can we provide any recommendation as to how many times a user should run this test to be "reasonably certain" their implementation is threadsafe? Alternatively, can we inject a little more thread control into solutions to be able to pull the appropriate levers ourselves and guarantee a concurrent modification attempt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It failed every time I ran it (I think I ran it about 10 times in a row) with a non-threadsafe implementation. Is there any way we can be absolutely guarantee a concurrent modification attempt? I would expect the test to fail every time if their implementation isn't thread safe, but I can't be 100% certain. I could put in the hint that they should run the test a couple of times just to be safe?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I see the same behavior here. Let's add to the hint just to be safe :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do :)

@stkent

stkent commented Jun 30, 2017

Copy link
Copy Markdown
Contributor

Love it! Great add.

@stkent
stkent merged commit 683b7dc into exercism:master Jun 30, 2017
@FridaTveit
FridaTveit deleted the BankAccountAddExercise branch October 17, 2017 16:55
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

Successfully merging this pull request may close these issues.

2 participants