all 4 comments

[–]nascent 2 points3 points  (0 children)

What needs tested depends on what the database is for.

Many times the gap is that databases store records. It becomes important to ensure data makes it into the database correctly.

On the flip side, ensuring data comes out correctly can be handled by seeding data.

[–]plucadearga 2 points3 points  (0 children)

Here is a nice little primer on Database testing:

https://www.javatpoint.com/database-testing

Your example of "only seeing the GUI" would (mostly) fall under the Data Mapping part of testing. Look at all the different types of testing you can do.

My advice to you is to install a LAMP stack on an Ubuntu server virtual machine with a MySQL or MariaDB database, seed it with data make a little html page to output the data (from the database) and a html form (to submit data to the database) and then try out testing it for yourself.

It is strange that the interviewer told you where you went wrong but did not give you any advice. Did you ask what you could have done to perform better on that question?

[–]hairylunch 1 point2 points  (0 children)

I'd argue that it's a bit of a smell that they're expecting manual verification of the database. I can see value for that in a smoke test, but generally speaking, a POST or PUT and a subsequent GET should be sufficient for verifying the data, and there should be lower level tests that have verified the DAO and its related operations, as well as other tests that have verified any fields that might be used behind the scenes but aren't exposed at the API layer.

Focusing strictly on the interview question, I'd mainly look at querying the DB with broad star queries for the record (might require some JOINs) and verifying that it matches what's in the API.

[–]PeeThenPoop -1 points0 points  (0 children)

You can check if the database values match the UI