di-huang / Amazon-Warehouse-System

Simplified version of the Amazon Warehouse System.
1 stars 1 forks source link

Questions about unit testing #14

Open weigui opened 7 years ago

weigui commented 7 years ago

Now our project has been divided into two part: The main production part (package production), Which is for THE DEMO DAY. and the unitTesting (package production_unitTesting) part.

The main production part was almost entirely written by our master role contributor Di Huang, because for the Demo Day we need a PERFECTLY RUNNABLE system with a friendly visualizer.

And the unitTesting part is for YOUR project evaluation grades: make your own subsystem and testing class with a Main method here. PLEASE DO NOT USE any methods or fields from the main production package. If you need any help writing your own class and testing method( like my Robot need the getRoute() method in Floor class) , please let other people know.

josephLeiferman commented 7 years ago

Easy there Wei Gui, lets not minimize the fact we all have been working hard on the project not just the master role we all have contributed a lot. The work that Di Huang did was great, but so was everyone's else. Given more time and better communication I believe everyone's code that they wrote would have been used.

di-huang commented 7 years ago

weigui, you said you will add some magical functions in Visualizer and you look like very active and motivated about that, so you should be the one who demonstrate your magic visualization xD

weigui commented 7 years ago

@josephLeiferman Err... we may have some kind of misunderstanding here... I'm just explaining what we've already got in our project. I mean, in the unitTesting package we shouldn't implement the production package because that would mess things up: they are two different things!

In the unitTesting package we should focus on our own class: fields,methods,comments. Eliminate those errors and warnings in your class, and then write a good testing main method for it.——That's how they grade your own work.

That would be awesome if everybody is working hard to do something in the main production part, which is for our demo day. We need to show that our group can complete this project and make the whole warehouse system work, then your individual subsystem and testing method.

josephLeiferman commented 7 years ago

@weigui Oh no I understand you, I didn't mean to cause any conflict. I understand we want to keep the production package working so that we have something to demo. I just wanted to make sure no one felt slighted, if some of their code didn't make it into demo even if they had very similar code already complete.

josephLeiferman commented 7 years ago

We just had a cohesion problem, where we were all working in a 'bubble', and not communicating so work overlapped or didn't work together properly that is why some people's code had to be re-written.

weigui commented 7 years ago

:i Anyway, If anybody need help for unitTesting package, please feel free to comment here

NickEBarnes commented 7 years ago

Just trying to get it working, I really don't know why it isn't getting to the main in production


From: weigui notifications@github.com Sent: Tuesday, December 6, 2016 10:23:24 PM To: dhuang12138/CS2820 Subject: Re: [dhuang12138/CS2820] Explaining the Situation (#14)

:i Anyway, If anybody need help for unitTesting package, please feel free to comment here

- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/dhuang12138/CS2820/issues/14#issuecomment-265352170, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASfsBYqdS6t3VK3P_if6mLVUeFusxJGHks5rFjS8gaJpZM4LGKHy.

weigui commented 7 years ago

@NickEBarnes You mean, Eclipse won't run your main method?

josephLeiferman commented 7 years ago

What is your error message?

NickEBarnes commented 7 years ago

Well I guess the main error right now is that Item and other classes have been changed and when I try to run it it just blows up. There are a lot of classes that seem to be different than what they were. Are you guys able to run the unitTesting?


From: Joseph Leiferman notifications@github.com Sent: Tuesday, December 6, 2016 10:25:52 PM To: dhuang12138/CS2820 Cc: Barnes, Nicholas; Mention Subject: Re: [dhuang12138/CS2820] Explaining the Situation (#14)

What is your error message?

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dhuang12138/CS2820/issues/14#issuecomment-265352472, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASfsBeyrlc-fJinKAByYFlAMPsmODEVPks5rFjVQgaJpZM4LGKHy.

NickEBarnes commented 7 years ago

It isn't my main method, it is the production main method that it had been using


From: Barnes, Nicholas Sent: Tuesday, December 6, 2016 10:27:44 PM To: dhuang12138/CS2820 Subject: Re: [dhuang12138/CS2820] Explaining the Situation (#14)

Well I guess the main error right now is that Item and other classes have been changed and when I try to run it it just blows up. There are a lot of classes that seem to be different than what they were. Are you guys able to run the unitTesting?


From: Joseph Leiferman notifications@github.com Sent: Tuesday, December 6, 2016 10:25:52 PM To: dhuang12138/CS2820 Cc: Barnes, Nicholas; Mention Subject: Re: [dhuang12138/CS2820] Explaining the Situation (#14)

What is your error message?

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dhuang12138/CS2820/issues/14#issuecomment-265352472, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASfsBeyrlc-fJinKAByYFlAMPsmODEVPks5rFjVQgaJpZM4LGKHy.

weigui commented 7 years ago

@NickEBarnes Don't use the production main method, because the unitTesting is not a runnable warehouse_system You need to write your own testing main method which will tell the TAs that your subsystem can handle its mission

NickEBarnes commented 7 years ago

It just kinda all got messed up, I hadn't committed my stuff which I admit I can only blame myself, but then I committed/pulled and then it was all gone so yeah. I can do my own main method that's fine.


From: weigui notifications@github.com Sent: Tuesday, December 6, 2016 10:29:58 PM To: dhuang12138/CS2820 Cc: Barnes, Nicholas; Mention Subject: Re: [dhuang12138/CS2820] Questions about unit testing (#14)

@NickEBarneshttps://github.com/NickEBarnes Don't use the production main method, because the unitTesting is not a runnable warehouse_system You need to write your own testing main method which will tell the TAs that your subsystem can handle its mission

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dhuang12138/CS2820/issues/14#issuecomment-265352974, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASfsBXNu6obXkYjWelNQn_QejR7LGWpyks5rFjZGgaJpZM4LGKHy.

josephLeiferman commented 7 years ago

I agree with weigui the best solution is probably create your own class to test the work you did like beltTest.java in production_unitTesting .

di-huang commented 7 years ago

@NickEBarnes It seems like you have to add what you need (like method, variable...) to MockObject which you're gonna call, so that's what MockObject does. For example, your role is Belt and you may use some methods of other role (like Floor), then you can just add what you need in MockFloor. What's more, you also have to build a TestBelt class to finish your own unit test.

weigui commented 7 years ago

That's right, your mockXXX class needs to pretend that other subsystem are working properly ( even though they are not) That's why you need your own main method.

di-huang commented 7 years ago

Every role has its own interface (except Master) which provides some basic method signature, and its MockObject will implement it, but if you find there's still something else you need from that MockObject, you can just add it to that MockObject.

NickEBarnes commented 7 years ago

Right right, I understand what you are saying. I just had everything going through Production earlier, I'll work on it. Props on the demo project, looks nice


From: dhuang12138 notifications@github.com Sent: Tuesday, December 6, 2016 10:38:55 PM To: dhuang12138/CS2820 Cc: Barnes, Nicholas; Mention Subject: Re: [dhuang12138/CS2820] Questions about unit testing (#14)

Every role has its own interface (except Master) which provides some basic method signature, and its MockObject will implement it, but if you find there's still something else you need from that MockObject, you can just add it to that MockObject.

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dhuang12138/CS2820/issues/14#issuecomment-265354059, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASfsBVe4wOawv3guhrLUaWYlUVrhz6Rkks5rFjhfgaJpZM4LGKHy.

di-huang commented 7 years ago

Also, you can just ignore the errors that occur in other MockObject, because he has responsiblity to fix it on his own, and you should still be able to call the methods you need from it (if doesn't exist, just add it). However, you have to assume your MockObject actually does something you expect, so you need to report what it does at each tick (you need to assume you already receive the central tick from Master, so you can add a tick variable for unit test and "tick++" when tick(clk) method is called)by printing on console(method-stub).

ghost commented 7 years ago

Thank you for making your decisions clearer Di Huang and Wei Gui, I was confused yesterday of the status of the project.