s ravi chandran wrote:regarding the two test cases i was telling about, limited_product_quantity doesn't give useful info as to the purpose of the test?
Junilu Lacar wrote:
s ravi chandran wrote:regarding the two test cases i was telling about, limited_product_quantity doesn't give useful info as to the purpose of the test?
I don't get what you're trying to say with "limited product quantity". They are all English words and individually, they have a meaning but taken together and in the context of the fill functionality, I don't know what the thought is behind it.
"Fill with limited product quantity"
"Wait, what?"![]()
Maybe you meant "Fill with specific quantity" instead? That makes more sense to me.
1. Press "MAINT" button to enter maintenance mode
2. Press "REPORT" button to print report of current quantities
3. Press "FILL" button to fill up a tray to capacity, press "ENTER" or "CANCEL". Note down quantity displayed.
4. Optional: Press "FILL PART" button to partially fill a tray, enter quantity loaded then press "ENTER" or "CANCEL"
5. Optional: Press "REPORT" button to print report of current quantities after loading
6. Press "MAINT" button to exit maintenance mode
s ravi chandran wrote:wrong selection of words...
We have already covered testcases for fill and fill_part we can add now, after this only maintenance and report will remain.
s ravi chandran wrote:I added these for FILL_PART.
Junilu Lacar wrote:
s ravi chandran wrote:I added these for FILL_PART.
You have a test smell here. You should only test for one aspect of the behavior in a test method. This test checks two aspects: 1. Legal input and 2. Illegal input.
If you create two separate tests, the specification of the behavior is more focused and you adhere to the principle of separation of concerns
. what is it defining?getCurrentLevel_returns_quantity_remaining_in_a_tray
s ravi chandran wrote:Need to check this:
. what is it defining?getCurrentLevel_returns_quantity_remaining_in_a_tray
Junilu Lacar wrote:
s ravi chandran wrote:is it possible that REPORT gives current quantities of all the trays?
Like:
1. Press the REPORT button
2. Machine displays
"#1=6"
#2=8"
#3=5"
#4=0"
s ravi chandran wrote:will this work? getCurrentQuantityForTray(FIRST_TRAY)
Junilu Lacar wrote:Well, there's a bit more code to be written to get a full simulation. But I think you should have a pretty good idea now. You really need to read up on the articles I cited about Design Principles SOLID, DRY, SLAP and keep those in mind. Most of all, practice, practice, practice.
I'll let you run with this now and will post feedback as you make progress (or make regressions). Don't worry about making regressions, that's all part of the learning process. It took me a couple of years of solo TDD to really get a hang of it. It's tough without other people to set you straight but I read lots and lots of books and it's those guys who I kind of "partner" with. I just have a very good imagination -- I can make up conversations in my head. Some people call me crazy but it worked for me
Junilu Lacar wrote:"Customer Interaction" is kind of an abstract idea, like a "conversation". They're both nouns but they're not really physical things. I would try CustomerInterface, CustomerPanel, CustomerConsole or something like that.
Junilu Lacar wrote:This would probably lead me to refactor the test name to something like hasCoinsDeposited_should_be_false_when_instantiated and follow-up with other tests:
hasCoinsDeposited_should_be_true_after_addAmount
hasCoinsDeposited_should_be_true_when_change_is_due
hasCoinsDeposited_should_be_false_when_no_change_is_due
hasCoinsDeposited_should_be_false_after_change_returned.
. Should I remove the initial slot and selected slot test cases?Also, if they access a private instance member directly, it's not really worth the effort to test getters and setters
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|