r/MonthlyProgram • u/baffled_bear • Feb 29 '16
[February] End of Month Status Report: Unit Test Framework
It's the last day of February, which means that the target date for the project has been met. Since this is a personal project, and not something that was commissioned by a client, this does not mean that we stop work, however. Personally, I plan to make tweaks an updates as I think of them to make a more presentable project.
This does mean that it's time to relay what we ended up with at this point, as this is /r/MonthlyProgram.
2
u/Zillolo Python Mar 01 '16
Not a lot to be said about it really. The README explains it pretty well I think. Overall I liked the project a lot. It wasn't too hard, but still had some challenges. Very good choice for our first project I must say.
2
u/baffled_bear Mar 01 '16
Nice work! I agree, this project was well suited for the goal and it really opens up a lot of potential for us as participants to explore language features we may not have otherwise.
2
u/Selachian Mar 02 '16
Honestly, I didn't really get started. I was really excited about it, but I didn't know what a unit test framework was before the month started and I didn't really throw my whole weight behind it. I'm very much a beginner programmer. I know a lot of algorithms and data structures, but, I don't know anything about actual programming to make things.
I'm excited for March though! I don't know much about what a "shell" is, but I'm excited to learn!
3
u/baffled_bear Mar 02 '16
That's alright. Feel free to ask questions about the project. I'm sure somebody will be happy to help direct you to some answers. There's also the Gitter in the sidebar where you can ask questions, as well.
6
u/baffled_bear Feb 29 '16
My final status can be found here. For those of you who missed it, I was posting as /u/hothrous before but am no using /u/baffled_bear, here.
Features:###
Python 3.4+ support
CLI interface with a number of provided arguments available
Mutually exclusive arguments available for 3 different processes
Web UI
Console interface using a file for input
Console interface providing a list of files as individual arguments
Support for output to screen or to a specified file
Support for csv and table formatting of the output
Web based UI using Flask and Flask-WTF
Form to enter as many paths to a unit test as needed
Link to download CSV and Text file versions of the results
Table based output on the screen
Fantastic logo provided by my wife
A number of assert methods provided
assert_true
assert_false
assert_equal
assert_not_equal
assert_in
assert_not_in
assert_type_in
assert_type_not_in
assert_is
assert_is_not
assert_is_none
assert_is_not_none
assert_raises
UnitTest class for inheritance that automatically fits into the work flow
Built in setup and teardown methods to be overridden
Annotation based test case creation
Automatically includes any test cases created this way in the workflow
Limitations:###
Strict structure on file locations
The implementation of the parsing of the path to a unit test is very strict at the moment. I will be trying to fix this in the future, though. It specifically needs the entry to have 3 parts (e.g. test.unit_test_file.UnitTestClass)
Each unit test class needs its own file
The way the annotations are implemented for this results in all methods that are annotated in a file being counted as a method within the class. Due to this, there is a requirement that each block of test cases be grouped in it's own class in it's own file.
Lessons Learned:###
Going into this I knew nothing about creating annotations/decorators/whatever your preferred name is. This project taught me a great deal about this. I also ended up working a lot more with wrappers than I had in the past, which I hope to be able to use in the future. This was also my first project using Python 3 instead of 2.7. I had done some small things with Python 3, but this was the first actual project. I also expanded my knowledge of Flask and CSS creating the web ui.
Final Thoughts:###
This project was really great. It gave me the perfect outlet to build up my portfolio as well as highlighting some of my weaknesses to myself. I found a number of places where I would be able to improve my own development cycle when it comes to building apps like this. Especially in the planning stages. While, I may slack off on the occasional monthly program here, this definitely demonstrated how valuable working projects can be. Thanks to /u/Go1denW01f11 for setting this up.