SlideShare a Scribd company logo
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Unit	and	Regression	
TesBng	for	PL/SQL	
A	conversaBon	with	three	developers		
who	actually	do	this	
Steven	Feuerstein	
Oracle	Developer	Advocate	for	PL/SQL	
Oracle	CorporaBon	
	
Email:	steven.feuerstein@oracle.com	
TwiOer:	@sfonplsql	
Blog:	stevenfeuersteinonplsql.blogspot.com	
YouTube:	PracBcally	Perfect	PL/SQL
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Agenda	
	
Why	unit	test?	Why	regression	test?	
Using	Excel	as	a	test	harness	
utPLSQL	v3:	the	brave	new	world	
2
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
The	Unit	TesBng	Code	Talkers	
•  Jacek	Gabal		*	Pavel	Kaplya	*	Stefan	Poschenrieder	
3
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Code	Talker:	Jacek	Gabal	
•  Senior	So]ware	Engineer	at	Fidelity	Investments	Ireland	
•  Oracle	SQL	and	PLSQL	developer	since	1998	
•  CerBfied	Scrum	Master	
•  Lean,	Agile	and	TDD	infected	
•  Author	of	utPLSQL	v3	unit	tesBng	framework	
•  Contributor	to	ruby-plsql	and	ruby-plsql-spec	unit	tesBng	
framework	for	PLSQL
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Code	Talker:	Pavel	Kaplya	
•  BI	So]ware	Architect,	OCP	PL/SQL	Developer	
•  Diaso],	Russia	
•  Author	of	utPLSQL	v3	unit	tesBng	framework
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Code	Talker:	Stefan	Poschenrieder	
•  20	years	experience	with	Oracle	SQL	and	PL/SQL.	
•  Freelancer	with	focus	on	development	process	
opBmizaBon	and	emphasis	on	tesBng).	
•  "I	can	not	live	(i.e.,	code)	without	unit	tests."	
•  Last	success	story:	evangelized	a	scrum	team	of	10		
developers	to	unit-tesBng,	changing	the	status	of	the	
project	from	“red”	to	“green”.	
•  Now	supporBng	next	team	in	the	company.	
@utplsqlXL
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
WriBng	so]ware	is	fun.	
7
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Buggy	so]ware	is....	
embarrassing,	
expensive,	and	
someBmes	deadly.	
8
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Unfortunately,	tesBng	so]ware	
is	(hard)	work	and	boring.	
	
(of	course	some	people	like	it	a	lot!)	
9
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Uh-oh.	
10
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Why	Unit	Test?		
	
Clearer	thinking	about	requirements	(TDD).	
Find	bugs	early	(and	cheaply).	
Fewer	bugs	in	producBon.	
Make	changes	with	confidence.	
Forces	you	to	write	testable	code.	
Makes	you	feel	great	–	tesBng	as	a	game!	
11
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Why	(not)	Regression	Test?	
	
Avoid	undesirable	side-effects	and	"FDD."	
Test	more	frequently.	
Upgrade	more	easily.	
Reduce	maintenance	costs.	
Make	users	happy	and	sleep	more	easily.	
12
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Tools	for	Unit	TesBng	PL/SQL	
	
utPLSQL	
SQL	Developer	Unit	TesBng	
Code	Tester	for	Oracle	(commercial)	
PL/Unit	
dbUnit	
dbFit...	
	
13
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Stefan	and		
Using	utPLSQL	with	Excel	(!)	
14
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
PLSQL	/	ETL	Tool	
	
A	"UNIT"	in	BI	/	DWH	
SOURCETABLE	1	
TARGET-TABLE	
The	highest	complexity	in	ETL	is	in	the	T.	
SOURCETABLE	2	 SOURCETABLE	X
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Defining	tests	with	Excel	and	utplsql	
utPLSQL	is	a	very	cool	framework,	but	sBll	much	to	code	
	
it	must	be	very	easy	to	define	unit-tests	to	bring	a	developer	in	tesBng	mood	
	
In	Datawarehousing	a	„unit“	is	a	very	complex	thing	
	
Everybody	should	be	a	able	to	adapt	tests,	even	he	can	not	code,	but	understands	
the	business.	
	
I	always	defined	data	using	Excel.	(generate	Insert/statements,	use	sqlldr)	
I	always	get	data	from	other	people	inside	Excel.	
	
So	why	don‘t	use	Excel	for	unit-tesBng?
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Jacek:	utPLSQL	v3	Key	Features	
-	mulBple	ways	to	compare	data	with	matchers	
-	naBve	comparison	of	complex	types	(objects/collecBons/cursors)	
-	in-depth	and	consistent	reporBng	of	failures	and	errors	for	tests	
-	tests	idenBfied	and	configured	by	annotaBons	
-	hierarchies	of	test	suites	configured	with	annotaBons	
-	automaBc	(configurable)	transacBon	control	
-	Build-in	coverage	reporBng	
-	IntegraBon	with	SonarQube,	Coveralls,	Jenkins	and	Teamcity	with	
reporters	
-	plugin	architecture	for	reporters	and	matchers	
-	flexible	and	simple	test	invocaBon	
-	mulB-reporBng	from	test-run	from	command	line
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Pavel:	utPLSQL	v3	Demo	
Building	unit	tests	
ExecuBng	tests	
Code	coverage		
Different	reporBng	styles
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
ConBnuous	IntegraBon	/	ConBnuous	Delivery	
What	is	CI/CD?	
Why	should	I	care?	
Running	on	Teamcity	
Running	on	Travis	
Sonar	IntegraBon	
Coveralls
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Resources	for	Unit	TesBng	with	utPLSQL	
	-	documentaBon:	utplsql.github.io/utPLSQL/	
		-	releases:	github.com/utPLSQL/utPLSQL/releases	
		-	project	source:	github.com/utPLSQL/utPLSQL/	
		-	demo	project:	github.com/utPLSQL/utPLSQL-demo-project/	
		-	CI	for	demo	project	with	Travis	
		-	SonarQube	for	demo	project:	
sonarqube.com/dashboard?id=utPLSQL%3AutPLSQL-demo-project%3Adevelop	
		-	SonarQube	for	utPLSQL:	
sonarqube.com/dashboard?id=utPLSQL%3AutPLSQL%3Adevelop	
		-	Coveralls	for	utPLSQL:	coveralls.io/github/utPLSQL/utPLSQL	
	
		-	TwiOer:	#utPLSQL,	@utPLSQL,	@GebalJacek,	@Pazus
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|	
Unit	TesBng	PL/SQL	
take	your	code	to	the	next	level	
	
frameworks	and	tools	gexng	more	powerful	
	
utplsql	v3	in	parBcular	offers	tremendous	promise	
	
	
21

More Related Content

What's hot (20)

PDF
Workshop unit test
Francesco Garavaglia
 
PDF
Quick flask an intro to flask
juzten
 
PDF
Py.test
soasme
 
PDF
ISTQB Foundation Level Basic
Erol Selitektay
 
PPTX
Unit Testing in Java
Ahmed M. Gomaa
 
PDF
Test Driven Development With Python
Siddhi
 
PPTX
Java Unit Testing
Nayanda Haberty
 
PDF
Page Object Model and Implementation in Selenium
Zoe Gilbert
 
PDF
Introduction to Software Test Automation
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
PDF
Unit Testing in Python
Haim Michael
 
PPTX
Setting up Page Object Model in Automation Framework
valuebound
 
PDF
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
Edureka!
 
PPT
Testing and Mocking Object - The Art of Mocking.
Deepak Singhvi
 
PPTX
Unit Testing Concepts and Best Practices
Derek Smith
 
PPTX
Data driven Automation Framework with Selenium
Edureka!
 
PPTX
Unit test
Tran Duc
 
PDF
Ruin your life using robot framework
Prayoch Rujira
 
ODT
Testing in-python-and-pytest-framework
Arulalan T
 
ODP
Introduction to BDD
Knoldus Inc.
 
PDF
Javascript Design Patterns
Subramanyan Murali
 
Workshop unit test
Francesco Garavaglia
 
Quick flask an intro to flask
juzten
 
Py.test
soasme
 
ISTQB Foundation Level Basic
Erol Selitektay
 
Unit Testing in Java
Ahmed M. Gomaa
 
Test Driven Development With Python
Siddhi
 
Java Unit Testing
Nayanda Haberty
 
Page Object Model and Implementation in Selenium
Zoe Gilbert
 
Introduction to Software Test Automation
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Unit Testing in Python
Haim Michael
 
Setting up Page Object Model in Automation Framework
valuebound
 
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
Edureka!
 
Testing and Mocking Object - The Art of Mocking.
Deepak Singhvi
 
Unit Testing Concepts and Best Practices
Derek Smith
 
Data driven Automation Framework with Selenium
Edureka!
 
Unit test
Tran Duc
 
Ruin your life using robot framework
Prayoch Rujira
 
Testing in-python-and-pytest-framework
Arulalan T
 
Introduction to BDD
Knoldus Inc.
 
Javascript Design Patterns
Subramanyan Murali
 

Similar to Unit Testing Oracle PL/SQL Code: utPLSQL, Excel and More (14)

PDF
Bgoug 2019.11 test your pl sql - not your patience
Jacek Gebal
 
PDF
POUG2019 - Test your PL/SQL - your database will love you
Jacek Gebal
 
PDF
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
PPTX
utPLSQL: Unit Testing for Oracle PL/SQL
Steven Feuerstein
 
PDF
Test Driven Development for PLSQL with utPLSQL v3
Jacek Gebal
 
PPTX
ITAG Excellence Awards 2017 - utPLSQL v3
Jacek Gebal
 
PDF
Agile db testing_techniques
Tarik Essawi
 
PDF
PL/SQL unit testing with Ruby
Raimonds Simanovskis
 
PPTX
Test your PL/SQL with utPLSQL
Daniel Overby Hansen
 
PDF
utplsql.pdf
vijayv991893
 
PDF
Speakers at Nov 2019 PL/SQL Office Hours session
Steven Feuerstein
 
PPTX
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
Alessandro Alpi
 
PDF
Database development unit test with tSQLt
Sergio Govoni
 
PPT
Automated Unit Testing
Simon Boorsma
 
Bgoug 2019.11 test your pl sql - not your patience
Jacek Gebal
 
POUG2019 - Test your PL/SQL - your database will love you
Jacek Gebal
 
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
utPLSQL: Unit Testing for Oracle PL/SQL
Steven Feuerstein
 
Test Driven Development for PLSQL with utPLSQL v3
Jacek Gebal
 
ITAG Excellence Awards 2017 - utPLSQL v3
Jacek Gebal
 
Agile db testing_techniques
Tarik Essawi
 
PL/SQL unit testing with Ruby
Raimonds Simanovskis
 
Test your PL/SQL with utPLSQL
Daniel Overby Hansen
 
utplsql.pdf
vijayv991893
 
Speakers at Nov 2019 PL/SQL Office Hours session
Steven Feuerstein
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
Alessandro Alpi
 
Database development unit test with tSQLt
Sergio Govoni
 
Automated Unit Testing
Simon Boorsma
 
Ad

More from Steven Feuerstein (18)

PDF
New(er) Stuff in PL/SQL
Steven Feuerstein
 
PDF
Six simple steps to unit testing happiness
Steven Feuerstein
 
PDF
New Stuff in the Oracle PL/SQL Language
Steven Feuerstein
 
PDF
AskTOM Office Hours on Database Triggers
Steven Feuerstein
 
PDF
PL/SQL Guilty Pleasures
Steven Feuerstein
 
PDF
Oracle Application Express and PL/SQL: a world-class combo
Steven Feuerstein
 
PDF
Error Management Features of PL/SQL
Steven Feuerstein
 
PDF
JSON and PL/SQL: A Match Made in Database
Steven Feuerstein
 
PDF
OLD APEX and PL/SQL
Steven Feuerstein
 
PDF
High Performance PL/SQL
Steven Feuerstein
 
PDF
Oracle PL/SQL 12c and 18c New Features + RADstack + Community Sites
Steven Feuerstein
 
PDF
AskTOM Office Hours - Dynamic SQL in PL/SQL
Steven Feuerstein
 
PPT
Database Developers: the most important developers on earth?
Steven Feuerstein
 
PDF
Impact Analysis with PL/Scope
Steven Feuerstein
 
PDF
All About PL/SQL Collections
Steven Feuerstein
 
PPTX
The Amazing and Elegant PL/SQL Function Result Cache
Steven Feuerstein
 
PPTX
Turbocharge SQL Performance in PL/SQL with Bulk Processing
Steven Feuerstein
 
PPTX
Take Full Advantage of the Oracle PL/SQL Compiler
Steven Feuerstein
 
New(er) Stuff in PL/SQL
Steven Feuerstein
 
Six simple steps to unit testing happiness
Steven Feuerstein
 
New Stuff in the Oracle PL/SQL Language
Steven Feuerstein
 
AskTOM Office Hours on Database Triggers
Steven Feuerstein
 
PL/SQL Guilty Pleasures
Steven Feuerstein
 
Oracle Application Express and PL/SQL: a world-class combo
Steven Feuerstein
 
Error Management Features of PL/SQL
Steven Feuerstein
 
JSON and PL/SQL: A Match Made in Database
Steven Feuerstein
 
OLD APEX and PL/SQL
Steven Feuerstein
 
High Performance PL/SQL
Steven Feuerstein
 
Oracle PL/SQL 12c and 18c New Features + RADstack + Community Sites
Steven Feuerstein
 
AskTOM Office Hours - Dynamic SQL in PL/SQL
Steven Feuerstein
 
Database Developers: the most important developers on earth?
Steven Feuerstein
 
Impact Analysis with PL/Scope
Steven Feuerstein
 
All About PL/SQL Collections
Steven Feuerstein
 
The Amazing and Elegant PL/SQL Function Result Cache
Steven Feuerstein
 
Turbocharge SQL Performance in PL/SQL with Bulk Processing
Steven Feuerstein
 
Take Full Advantage of the Oracle PL/SQL Compiler
Steven Feuerstein
 
Ad

Recently uploaded (20)

PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
PPTX
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
PPTX
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Practical Applications of AI in Local Government
OnBoard
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
 
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
UiPath Agentic AI ile Akıllı Otomasyonun Yeni Çağı
UiPathCommunity
 
Simplifica la seguridad en la nube y la detección de amenazas con FortiCNAPP
Cristian Garcia G.
 

Unit Testing Oracle PL/SQL Code: utPLSQL, Excel and More