egeldenhuys / black-fitch

[DEPRECATED] Black-box Unit Tests for Fitchfork practicals and assignments
GNU General Public License v3.0
8 stars 4 forks source link

COS 212 Assignment 1 #46

Closed egeldenhuys closed 7 years ago

egeldenhuys commented 7 years ago

Discussion thread for COS 212 Assignment 1

The unit tests need to be reviewed/run by at least two other people before merging into master.

TODO

Assumptions

Progress

devosray commented 7 years ago

If you add a demo test so I can see the format again, I'll add my Task 1 tests.

egeldenhuys commented 7 years ago

@devosray, I created a rough framework for how the tests will be structured for task1 using the Catch framework.

Try branching from cos212-a1 then opening a pull request with your tests.

egeldenhuys commented 7 years ago

Should 0 be included in the range of allowed values?

devosray commented 7 years ago

This is very confusing. The wording used in the practical is "positive integer". According to multiple sources, positive integers in mathematics are "Numbers greater than 0 that can be expressed without a fraction."

However, unsigned integers in C++ can be 0. WHO KNOWS :frowning_face:

egeldenhuys commented 7 years ago

For now I will assume that 0 is a valid element.

egeldenhuys commented 7 years ago

I implemented my tests for CircularList.C. @devosray Can you please run it against your code and give feedback?

devosray commented 7 years ago

It seems like the configure script does not add CircularList.C to the project source and thus never gets compiled. I will submit a pull request shortly.

Except from that, all tests seems fine. A few fail because in my code I have assumed that 0 is not a positive integer.

EDIT: See #47

egeldenhuys commented 7 years ago

Sorry, I forgot to apply the changes to the makefile template. I will push the working template some time today

Thank you for testing!

egeldenhuys commented 7 years ago

Added tests for the Stack class. They are derived from the same tests for CircularList, so if any cases are not covered in there they will not be covered in tests_Stack.cpp

egeldenhuys commented 7 years ago

Note: Still need to add tests for isEmpty()

devosray commented 7 years ago

I have uploaded my attempt and got full marks while assuming that 0 is not a positive integer

egeldenhuys commented 7 years ago

@devosray I will adapt the tests accordingly

egeldenhuys commented 7 years ago

If a Stack object is printed and contains the elements 5,4,3 and 2, with 5 being the top element and 2 the bottom, the output MUST be in the following format: [5,4,3,2]

however in my implementation the top of the Stack is at the end. @devosray Did you fail any tests regarding your Stack structure?

devosray commented 7 years ago

@egeldenhuys It seems like all your stack tests are failing with my implementation. I think you got the order the wrong way, because most of the failed cases looks like this:

REQUIRE( getOutput(listA) == "[1,2,3,4]" ) with expansion: "[4,3,2,1]" == "[1,2,3,4]"

I believe the top of the stack can be seen as the front of the CircularList.

egeldenhuys commented 7 years ago

I will modify the tests so that the Top of the stack is at the front.

egeldenhuys commented 7 years ago

Requesting review for Task 1. @devosray @Quantum-Sicarius @Paulo-W @RagingGrim

egeldenhuys commented 7 years ago

21/21 For Task1.

devosray commented 7 years ago

@egeldenhuys Except for 3 tests that still include 0, the C++ part (task 1) seems fine. 21/21

CDuPlooy commented 7 years ago

I got 17/21 and 16/21 ( go figure ) but I assume I have a memory leak in my code or some obscure condition I did not take into account.

I will email you an archive with all of my code.

On another note , why not have your makefile cd to the directory the client's code is in.

I'd much rather do

make CD=~/mycode/myprac 

Than

make -f blackfitch-makefile

It might be more typing but at least I'm not copying the same file to different directories :dagger: It also might be possible to implement both of these as options by having the CD variable be set to empty as default.

mameen-omar commented 7 years ago

How do I use this to test my Task 1 code?

egeldenhuys commented 7 years ago

@mameen-omar

egeldenhuys commented 7 years ago

I am now finished with the tests for Assignment 1. Recieved 21/21 for both tasks and passing all Black Fitch tests.

For testing Task2:

make -f black-fitch-makefile pull
make -f black-fitch-makefile task2

Please review Task2: @RagingGrim @devosray @Quantum-Sicarius @Paulo-W

Edit: Will update make file branch and merge into master once two other people have reviewed Task 2.

Quantum-Sicarius commented 7 years ago

Task1: 100% Task2: 100%

I believe it is ready to be merged. @egeldenhuys Well done and thank you!