Simplifying Unit Testing Main Stored Procedure Which Also Calls a Utility Procedure

Simplifying Unit Testing Main Stored Procedure Which Also Calls a Utility Procedure
3.3 (66.67%) 3 votes

This article provides a walkthrough of database unit testing a stored procedure which contains a utility procedure within it.

In this article, I am going to discuss a database unit testing scenario when a main stored procedure depends on a utility procedure and the main procedure needs to be unit tested in order to make sure that the requirements are met. The key is to ensure that a unit test can only be written for a single unit of code which means we need one unit test for the main procedure and another unit test for the utility procedure. Read More

Unit Testing Report Procedures – Jump to Start TDDD Part-4

Unit Testing Report Procedures – Jump to Start TDDD Part-4
3.9 (77.5%) 8 votes

This article is a walk-through of creating a stored procedure through test-driven database development (TDDD) in order to meet a reporting requirement that cannot be fulfilled by using a database view.

This article also provides some useful hints about cases of preferring stored procedure over database view as a potential object that is going to fulfill the business requirement(s). Read More

Jump to Start Test-Driven Database Development (TDDD) – Part 3

Jump to Start Test-Driven Database Development (TDDD) – Part 3
4.5 (90%) 4 votes

This article is a walk-through of creating a report base on a database object developed and tested by using test-driven development (TDDD). Furthermore, some tips for improving database unit testing via TDDD will be discussed in this article too.

Test-driven database development (TDDD) Recap

In simple words, TDDD is all about writing unit-test before the database object is even created. So, if we want to create a database object to satisfy some business requirement, it should be processed by creating a unit-test that ensures the object exists. Moreover, it has to be followed by another unit-test that will ensure the proper functioning of the database object (at the minimum) though that functioning check should only be limited to meet only the desired requirement. Read More

Jump to Start Test-Driven Database Development (TDDD) – Part 2

Jump to Start Test-Driven Database Development (TDDD) – Part 2
5 (100%) 2 votes

We discussed the basics of test-driven database development (TDDD) with examples and compared it with traditional database development in the first part of this article.

In the second part, we are going to move beyond basics to focus on a more realistic scenario of meeting report requirements by using TDDD.

A quick recap of TDDD at this point is handy in understanding how it can help us to achieve such goals.

Read More

Jump to Start Test-Driven Database Development (TDDD) – Part 1

Jump to Start Test-Driven Database Development (TDDD) – Part 1
3.3 (66.67%) 3 votes

The most common approach to developing database solutions is to start creating database objects based on business requirements which is also known as “Conventional Database Development”.

In this article, we are going to explore the implementation of such approaches as conventional database development and test-driven database development on the particular examples.

To begin with, have a closer look at the conventional database development.

Read More

Replacement of Algorithm Testing with Testing of Effects Being Inserted

Replacement of Algorithm Testing with Testing of Effects Being Inserted
4 (80%) 1 vote

As I expected, Rule 8 from the article “Rules for Implementing TDD in Old Project” stating that we don’t need to test the algorithm of methods raised many “how” and “why” questions. When writing the previous article, it seemed obvious to me, so I did not go into much details on the matter. In this article, I provide a small sample code and two examples of how it could be tested.

Read More

Rules for Implementing TDD in Old Project

Rules for Implementing TDD in Old Project
Rate this post

The article “Sliding Responsibility of the Repository Pattern” raised several questions, which are very difficult to answer. Do we need a repository if the complete disregard of technical details is impossible? How complex must the repository be so that its addition can be regarded worth-while? The answer to these questions varies depending on the emphasis placed in the development of systems. Probably the most difficult question is the following: do you even need a repository? The problem of “flowing abstraction” and the growing complexity of coding with an increase in the level of abstraction do not allow to find a solution that would satisfy both sides of the fence. For example, in reporting, intention design leads to the creation of a large number of methods for each filter and sorting, and a generic solution creates a large coding overhead.

Read More