Note that there are some explanatory texts on larger screens.

plurals
  1. POFunctional tests and legacy code in database
    primarykey
    data
    text
    <p>The context is the following we have an MVC web application with a <strong>lot of legacy code in the database</strong>. (We are not allowed to migrate this code to the server side) For our persistance store we use the <strong>Repository</strong> pattern.</p> <p>Our client want to add new features to the application so we obviously added <strong>all the new business logic on the server side</strong>.</p> <p>The problem we have now is regarding our <strong>functional test suite which is running slower and slower</strong> every days.</p> <p>The main reason is that we are running tests from the browser using selenium to the database (<strong>End to end</strong>).</p> <p>I'd like to know if people have been successfull using the following other strategies:</p> <p><strong>1. Get rid of the UI</strong></p> <p>Running the tests at the Controller level instead of having to have to go through the browser and web server. To compensate the lost of testing through the UI we would write javascript unit tests or MVC Views unit tests.</p> <p><strong>2. Get rid of the DB</strong></p> <p>Write an "InMemory" version of our repository so that the application can run completely in memory, that should speed up the Test suite too, since we wont hit the disk and less networking. To compensate we would write integration tests for our Database Repositories. </p> <p>I think that doing <strong>both 1+2 strategies</strong> would yield maximum speed execution and we will test the stuff that really matter (controllers,business layer, domain entities and various helpers as an integrated whole) (I consider, UI and the DB as "details").</p> <p>Now, the problem is that in fact since the DB has a lot of legacy code, I don't know if it's safe enought to just rely on integration tests for that stuff and keeping the DB out of the functionnal test suite. Should I leave it in the suite anyway ? Or is it fine ?</p> <p>Any experience or suggestion would be greatly appreciated !</p> <hr> <p>Some of my findings are the following:</p> <ul> <li>The Continuous delivery book suggest that these test should always be end to end even if they are slow (althought they also say that not everybody would agree on that)</li> <li>Uncle bob would, in my understanding, agree on the 1+2 strategy, but I'm not sure if he would think that with a database with legacy code.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload