khwang0 / 2018F-COMP3111

19 stars 13 forks source link

[Test]Unit testing of your implemented tasks. #61

Open JackShDr opened 5 years ago

JackShDr commented 5 years ago

There is another previous issue about the unit test but I think that one cannot fully answer my question. In the requiremnt, there is two different tests, a branch cover test and a unit test. About the unit test, it says "Unit testing of your implemented tasks." If most part of my task is inside the controller, do I need to test the controller? Shall I use testfx to test my task? What would be regarded as testing my implemented task sufficiently?

comp3111ta commented 5 years ago

If most part of my task is inside the controller, do I need to test the controller?

You should avoid this in the first place. Of course some tasks are very difficult to avoid.

Shall I use testfx to test my task? What would be regarded as testing my implemented task sufficiently?

You can use testFX or other framework to test it as you wish. In the submission you can declare to include or exclude any part of your class from button click to your function routing/dispatching.

ImC4k commented 5 years ago

If most part of my task is inside the controller, do I need to test the controller?

You should avoid this in the first place. Of course some tasks are very difficult to avoid.

Shall I use testfx to test my task? What would be regarded as testing my implemented task sufficiently?

You can use testFX or other framework to test it as you wish. In the submission you can declare to include or exclude any part of your class from button click to your function routing/dispatching.

@comp3111ta can you elaborate? What do you mean by excluding any part of my class?

comp3111ta commented 5 years ago

My workflow is as follows If coverage of entire project is more than 70%, give everyone two points. Else, count the function you declared in your readme (branch) if over 70% for the individual, give two point for him/her Else, see how the student wants to calculate and if he/she only excludes those are related to UI to controller. If so, adopt his calculation

JackShDr commented 5 years ago

I think you are talking about the coverage test. So what is the difference between coverage test and unit test?

comp3111ta commented 5 years ago

All unit test needs to pass. This is no question. If you write too few unit test then your job is easier. To counter it, we set a bar called coverage and make sure your unit test is exceeding 70% of your branches.