mardi 30 avril 2019

Is There A Tool To Measure Effectiveness of Django Tests [on hold]

I am trying to gain some kind of metric to show how effective our Django tests are. We have a Django app with a moderately large API surface area, a suite of tests, some of which are skipped. We are aware that there are gaps in what is tested.

The Django app uses django-rest-framework and Django filters libraries. There are class based views based on DRF generic views. This means that the code is highly declarative in nature. Some of those declarations have complicated filters.

We are wanting a metric to show how many of the API URL's are visited when ./manage.py tests is called. Ideally it show what filters have been applied in those views, to gain some idea of what is not exercised in test at all.

The usual python tool, coverage, does not give a good metric for this as it only shows lines executed and the declarative code is always executed upon reading the declaration, despite the filters/views/columns it declares not being used at all.

I have been trying to find a tool that gives API or feature visiting metrics for Django and have turned up a blank. I would be surprised if this is a completely new concept given the rich Django ecosystem. What tools are there in the ecosystem that would do this?

Aucun commentaire:

Enregistrer un commentaire