0

I need to write end to end tests for a web api which test various scenarios. However the models logic is pretty tough, if the tests for a case/model takes like 100 code rows, the setup in the background most likely takes 300 - 500 of those, lots of initialization, passing of automatically generated valuesm etc.

In general I tend to have data generated via the models, against which I test in my cases, but this time I'm more inclined in using database scripts to populate the database directly according to my needs, or to just restore a 'predefined' state. What would be all the disadvantages of this approach? The software being tested here is somewhat mission critical.

Vee6
  • 1,527
  • 3
  • 21
  • 40
  • The setup isnt a part of the test. So whatever way sets up the test object the most correct and easiest. – Andreas Waldahl Sep 01 '15 at 08:28
  • I don't agree, setup is part of the test prerequisites and setup information is used inside the test to validate results. – Vee6 Sep 01 '15 at 08:56
  • I agree with you, but it doesn't contradict my statement. Its a prerequisite, but its not a part of the test. If the object is to test an API the setup doesn't necessarily need to use the API. – Andreas Waldahl Sep 01 '15 at 09:00

0 Answers0