Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:40:58+00:00 2026-06-12T15:40:58+00:00

The context is the following we have an MVC web application with a lot

  • 0

The context is the following we have an MVC web application with a lot of legacy code in the database. (We are not allowed to migrate this code to the server side)
For our persistance store we use the Repository pattern.

Our client want to add new features to the application so we obviously added all the new business logic on the server side.

The problem we have now is regarding our functional test suite which is running slower and slower every days.

The main reason is that we are running tests from the browser using selenium to the database (End to end).

I’d like to know if people have been successfull using the following other strategies:

1. Get rid of the UI

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.

2. Get rid of the DB

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.

I think that doing both 1+2 strategies 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”).

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 ?

Any experience or suggestion would be greatly appreciated !


Some of my findings are the following:

  • 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)
  • 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.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:40:59+00:00Added an answer on June 12, 2026 at 3:40 pm

    The growing duration of the tests is the primary concern. Eventually it will grow to a point where you’ll have to abandon some of the tests. That’s a slippery slope.

    To forestall that, I would certainly adopt 1+2 strategy, but I would also maintain a certain amount of end-to-end testing.

    As you add more and more tests that bypass the UI and DB, you can start deciding which end-to-end tests are redundant, and which are necessary in order to test that the system is connected properly.

    The goal, in the end, if for end-to-end tests to be purely plumbing tests, with all business rules and presentation behaviors tested using the 1+2 strategy.

    Your stored procedures are a complication. So long as you aren’t more features to the database code, you can probably manage it. In fact, if you can gradually replace some of that database code with server code you’ll be better off. Some of the database code can be tested without the rest of the system present. And some of the database behavior can be mocked. Unfortunately there are also probably behaviors that can only be tested end-to-end, and so you’ll likely have to keep those tests in place for as long as that legacy database code exists.

    The most important factor here is to take things slowly, and avoid backsliding. Don’t embark upon a huge project to “fix the tests”. Make gradual incremental improvements instead. Practice “The Boy Scout Rule”, always leave the tests better than you found them. Never make them worse. Bit by bit, move more and more tests into strategy 1+2. Bit by bit replace those stored procedures that you feel comfortable replacing. Gradually eliminate the most redundant end-to-end tests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have an application with the following structure. // ASP.NET MVC (Web Project)
I have following code: //preparing DAO objects FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(test-context.xml); surveyDao =
Imagine I have the following code (simplified regarding my real context of course): <div
I have the following code in my context, and no explicit table-class mapping, yet
I have the following code, which is misbehaving: TPM_USER user = UserManager.GetUser(context, UserId); var
I have the following code. but it causes exception. using (var context = new
I've got an ASP.NET 4.0 web application (webforms, not mvc; asp.net routing isn't used)
I have a Spring-MVC 3.0 web application built with Maven. All Spring dependency versions
I have a rather large ASP.NET MVC web application which uses KnockoutJS extensively throughout.
I have an MVC application using Ninject to connect to a single database. Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.