what do we need to test in database testing

In Database testing, 

Testing of Data Integrity
Testing of Data Validity
Data base related performance
Testing of functions, procedure and triggers
are necessary to test.

What is Database Black Box Testing?

	Database Black Box testing involves:
	•	Data Mapping
	•	Data stored and retrieved
	•	Use of Black Box testing techniques
    such as Equivalence Partitioning 
    and Boundary Value Analysis

0
0
Krish 100200 points

                                    For database testing For manual I use Oracle sql developer for producing SQL
queries
FOR AUTOMATION; I use JDBC library to integrate
java by getting a CONNECTION from oracle database
then creating STATEMENTS using SQL queries and
then storing the data into a RESULTSET object.
I use java data structures to use store data inside and
compare them
and since I'm using DATA DRIVEN and CUCUMBER
BDD framework, all of these tests are stored inside feature
files
I have RUNNER classes that helps generate codes from
FEATURE FILE and implement them into a file called b
I also have HOOK class that implements my codes that
run before and after all my tests - this is where I invoke my
TAKESCREENSHOT interface which triggers when I use
scenario interface (when scenario fails)
It takes a picture when you are on the step that failed
StepDefinition - this is where I stored my codes that
based on gherkin language expected value DDT
If I'm working with small amounts of test data, I'm
going to operate with scenario outlines, this where I create
examples and store data using pipeline
In my automation framework I had database utility class
which handles everything related to setting up
connections, closing connections, getting data from
database and storing results from database into
different collections arrays etc. So that I can easily work with
it.
And I use it in my framework by
 using Connection interface, with getConnection method(url,username, password)
I’m keeping url, username, password in the configuration
file
url starts with oracle or postgresql, mysql...
url:"jdbc:oracle:thin:@url:1521:xe";
Syntax:
Connection connection = DriverManager.getConnection(url,
username, password) //throws SQL exception:checked
exception
Statement statement = connection.CreateStatement()
//throws SQL exception: checked exception
ResultSet resultSet = statement.executeQuery("Query")
resultSet.getObject/String/int(index)
ResultSetMetaData
resultSetMetaData=resultSet.getMetaData() columns
First,
getConnection -> connection.CreateStatement -> Resultset
resultset
ResultSetMetaData rsm = resultSet.getMetaData();
I can retrieve the column names and counts with the help of
rsm.getColumnName(i)/getColumnCount(),
Make sure you start your loop from 1 until <= last value
How did you do DB testing in your framework?
List <Map<String, String>> list = new ArrayList<>();
while(resultset.next()){
Map<String, String> map = new HashMap<>();
for(i = 1; i<= rsm.getColoumnCount;i++ ){
map.put(rsm.getColoumnName(i), result.getString(i))
}
list.add(map);
}
sout(list.get(3).get("key"))

0
0
3.67
3
Phoenix Logan 186120 points

                                    JDBC
It is a Java-based data access technology used for Java database connectivity.
It provides classes and interfaces to connect or communicate Java 
application with database. 
JDBC API is a Java API that can access any kind of data stored in 
a Relational Database. It enables Java programs to execute SQL statements.

How did you do DB testing in your framework?

In my automation framework I have DB Utilities class which handles 
everything related to setting up connections, closing connections, 
getting data from database and storing results from database into 
different collections, arrays, etc. So that I can easily work with it.

3.67 (3 Votes)
0
4
1
Awgiedawgie 440215 points

                                    For database testing For manual I use Oracle sql developer for producing SQL
queries
FOR AUTOMATION; I use JDBC library to integrate
java by getting a CONNECTION from oracle database
then creating STATEMENTS using SQL queries and
then storing the data into a RESULTSET object.
I use java data structures to use store data inside and
compare them
and since I'm using DATA DRIVEN and CUCUMBER
BDD framework, all of these tests are stored inside feature
files
I have RUNNER classes that helps generate codes from
FEATURE FILE and implement them into a file called b
I also have HOOK class that implements my codes that
run before and after all my tests - this is where I invoke my
TAKESCREENSHOT interface which triggers when I use
scenario interface (when scenario fails)
It takes a picture when you are on the step that failed
StepDefinition - this is where I stored my codes that
based on gherkin language expected value DDT
If I'm working with small amounts of test data, I'm
going to operate with scenario outlines, this where I create
examples and store data using pipeline

In my automation framework I had database utility class
which handles everything related to setting up
connections, closing connections, getting data from
database and storing results from database into
different collections arrays etc. So that I can easily work with
it.
And I use it in my framework by
 using Connection interface, with getConnection method(url,username, password)
I’m keeping url, username, password in the configuration
file
url starts with oracle or postgresql, mysql...
url:"jdbc:oracle:thin:@url:1521:xe";
Syntax:
Connection connection = DriverManager.getConnection(url,
username, password) //throws SQL exception:checked
exception
Statement statement = connection.CreateStatement()
//throws SQL exception: checked exception
ResultSet resultSet = statement.executeQuery("Query")
resultSet.getObject/String/int(index)
ResultSetMetaData
resultSetMetaData=resultSet.getMetaData() columns
First,
getConnection -> connection.CreateStatement -> Resultset
resultset
ResultSetMetaData rsm = resultSet.getMetaData();
I can retrieve the column names and counts with the help of
rsm.getColumnName(i)/getColumnCount(),
Make sure you start your loop from 1 until <= last value
How did you do DB testing in your framework?
List <Map<String, String>> list = new ArrayList<>();
while(resultset.next()){
Map<String, String> map = new HashMap<>();
for(i = 1; i<= rsm.getColoumnCount;i++ ){
map.put(rsm.getColoumnName(i), result.getString(i))
}
list.add(map);
}
sout(list.get(3).get("key"))

4 (1 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
online testing database what does database testing include database tester testing a database how to write database test cases test project database testing database for testing database testing manually database in software testing how to create a database for testing testing database testing database create database testing tutorial for beginners how to write tests for a database database testing basics create database test view testing in database database testing sample test cases sql database for testing test database ways of testing a database code ways of testing a database database testing tutorial database testing automation testing your database should i make a testing database how we do database testing issues in database testing Why we should go for Database testing? website database testing database testing examples database testing checks how to cross-check database work proper or not sql in database testing how to check quality of data before inserting them to large database database tetsing about Database schema testing database automation testing tools sql test items database database testing with mabl Check and write whether the data in database is in the database dat validation testcases what to test in database testing what to test in database what do we need to test in database testing how to validate live data in sql what is database testing database testing in software testing software for testing database query speed database testing tools simple testing db database testing case of database for registration test db schema sql db testing database testing tools open source defect database in software testing test live databases for research tools to check for errors in a database database test plan example test plan database design the database system test what common functionalities you used in database testing? what were the common functionalities you used in database testing? how did you do database testing? what tools did you use? what were your responsibilities? database testing in framework how to do database testing database testing how to do database testing in your framework
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source