From MES experience, I had notice some complaints from students to contribute to kiskadee code, and was really difficult to do that, because the main methods from monitor and runner were to coupled and bit coesive. Testing was another problem, because we had a lot of interdependence between then, and was not possible to run a specific test suite ( units, functional, integration). We were only able to run the entirely suite, or a single test. This MR propose to solve this problems implementing the following changes:
Refactor Monitor and Runner classes following a simple rule: Each method must have only one responsibility.
Refactor Monitor and Runner classes following a simple rule: Each method must have at most four arguments.
I took this rules from this talk: https://www.youtube.com/watch?v=npOGOmkxuio, and I think we should use it to all future features that we will add to kiskadee.
All code that interacts with database was moved to the model.py module.
Creates test suites to different test levels. Now we have unit, functional, plugins and integration tests. We can run each one using make command.
Mock all database calls on integration tests. Here I say why: http://davidcarlos.me/magickmock-and-unittest.html
Rename Package model to Project. We do not always analyze packages, but we always analyze projects.
Remove from Monitor the responsibility to start Runner and it self. Now we do that on initializer module.
From MES experience, I had notice some complaints from students to contribute to kiskadee code, and was really difficult to do that, because the main methods from monitor and runner were to coupled and bit coesive. Testing was another problem, because we had a lot of interdependence between then, and was not possible to run a specific test suite ( units, functional, integration). We were only able to run the entirely suite, or a single test. This MR propose to solve this problems implementing the following changes: