Home Database Mysql Tutorial 数据库测试——实用技巧及测试方法_MySQL

数据库测试——实用技巧及测试方法_MySQL

Jun 01, 2016 pm 01:52 PM
database test

导读:作者Rizwan Jafri是一名软件测试专家,他总结了自己在测试程序过程中一些经验,写了一篇文章《Database Testing–Practical Tips and Insight on How to Test Database》。在他看来,测试数据库可以从创建查询、查询数据表和从开发人员查询3个方式进行。

以下是文章摘要:

软件应用程序已经离不开数据库。无论是在Web、桌面应用、客户端服务器、企业和个人业务,都需要数据库在后端操作。同样的在金融、租凭、零售、邮寄、医疗领域中,数据库也是不可缺少的。

随着应用的复杂程度增加需要更强大和安全系数高的数据库才可以满足需求。为了满足高频率的应用程序事务(如银行或财务应用),数据库的安全性成为首要之重。

目前,市场中有很多活跃的数据库工具,例如MS-Access2010,MS SQL Server2008 r2,Oracle 10g,Oracle Financial,MySQL,PostgreSQL,DB2等等。它们在成本、可靠性、功能和安全性都有各自的优势。

下面为大家简单的介绍数据库中‘CRUD’所代表的操作。

C:创建——创建用户。

R:检索——执行检索视图操作。

U:更新——更新数据库信息。

D:删除——执行删除数据库操作。

普遍用户在操作数据时,都会用到以上四种操作。

数据库测试预备工作:

ACID属性

ACID,指数据库事务正确执行的四个基本要素的缩写。包含:原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)、持久性(Durability)。在数据库测试期间必须测试这四个要素,确保正确。

数据完整性

考虑到不同模块的应用程序以不同的方式使用相同的数据,并执行对数据所有的CRUD操作。确保数据库中包含的数据尽可能地准确和一致的数据性质,这就是数据完整性。

业务准确性

数据库发展至今,已不再是单纯的用来存储记录。事实上,数据库系统已经发展成为强大的工具,为开发者们提供了足够的扩展支持。数据库系统比以前具有了更多的强大功能,例如参考完整性,关系约束,触发器和存储过程。

如何测试数据库:

创建查询

为了测试测试数据库正确和准确性。首先,测试人员要熟练掌握SQL和DML(数据库语言)语句。其次,测试人员应该掌握数据库的结构。如果满足这两个条件,即可放心测试。对于小、中型技术开发出的应用程序是个很好的测试方法。此外,如果程序相对的复杂,测试人员需要求助开发人员帮忙。但是我建议大家从初级开始测试,既有信心也能提高自己的SQL技术。

查询数据表

测试人员可以通过查看数据表来验证应用程序GUI的操作结果。但是,这种方式对于拥有大量数据的数据库,查询是相当的乏味和繁琐。验证多个数据表也是相当困难。

从开发人员查询

这个是测试数据库最简单的方法,从GUI执行任何CRUD操作和执行各自的SQL查询,从开发人员获得验证及其结果。这种方式似乎是最好的测试数据库方式。如果开发人员查询出语句错误或是不符合用户的要求,可以尽快的修改错误语句。

总结

数据库是每个软件程序的核心部分。数据库测试已被被高度重视,测试人员需要具备良好的SQL技术。为了保证测试结果正确无误,应将上述四个元素分配给不同的测试人员交叉测试,确保万无一失。(张祺/编译)

原文链接:softwaretestinghelp.com

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Join a new Xianxia adventure! 'Zhu Xian 2' 'Wuwei Test' pre-download is now available Join a new Xianxia adventure! 'Zhu Xian 2' 'Wuwei Test' pre-download is now available Apr 22, 2024 pm 12:50 PM

The "Inaction Test" of the new fantasy fairy MMORPG "Zhu Xian 2" will be launched on April 23. What kind of new fairy adventure story will happen in Zhu Xian Continent thousands of years after the original work? The Six Realm Immortal World, a full-time immortal academy, a free immortal life, and all kinds of fun in the immortal world are waiting for the immortal friends to explore in person! The "Wuwei Test" pre-download is now open. Fairy friends can go to the official website to download. You cannot log in to the game server before the server is launched. The activation code can be used after the pre-download and installation is completed. "Zhu Xian 2" "Inaction Test" opening hours: April 23 10:00 - May 6 23:59 The new fairy adventure chapter of the orthodox sequel to Zhu Xian "Zhu Xian 2" is based on the "Zhu Xian" novel as a blueprint. Based on the world view of the original work, the game background is set

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

What are the differences between function testing and coverage in different languages? What are the differences between function testing and coverage in different languages? Apr 27, 2024 am 11:30 AM

Functional testing verifies function functionality through black-box and white-box testing, while code coverage measures the portion of code covered by test cases. Different languages ​​(such as Python and Java) have different testing frameworks, coverage tools and features. Practical cases show how to use Python's Unittest and Coverage and Java's JUnit and JaCoCo for function testing and coverage evaluation.

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

An in-depth analysis of how HTML reads the database An in-depth analysis of how HTML reads the database Apr 09, 2024 pm 12:36 PM

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

How to use database callback functions in Golang? How to use database callback functions in Golang? Jun 03, 2024 pm 02:20 PM

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

See all articles